Commit e0bce0d0 authored by Adam Jackson's avatar Adam Jackson
Browse files

Use shadowUpdate32to24 at 24bpp


Signed-off-by: default avatarAdam Jackson <ajax@redhat.com>
parent 3cf99231
...@@ -47,12 +47,14 @@ are supported: ...@@ -47,12 +47,14 @@ are supported:
The framebuffer device to use. Default: /dev/fb0. The framebuffer device to use. Default: /dev/fb0.
.TP .TP
.BI "Option \*qShadowFB\*q \*q" boolean \*q .BI "Option \*qShadowFB\*q \*q" boolean \*q
Enable or disable use of the shadow framebuffer layer. Default: on. Enable or disable use of the shadow framebuffer layer. Mandatory for 24bpp
framebuffers on newer servers. Default: on.
.TP .TP
.BI "Option \*qRotate\*q \*q" string \*q .BI "Option \*qRotate\*q \*q" string \*q
Enable rotation of the display. The supported values are "CW" (clockwise, Enable rotation of the display. The supported values are "CW" (clockwise,
90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise, 90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise,
270 degrees). Implies use of the shadow framebuffer layer. Default: off. 270 degrees). Implies use of the shadow framebuffer layer. Disabled for 24bpp
framebuffers. Default: off.
.SH "SEE ALSO" .SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__),
X(__miscmansuffix__), fbdevhw(__drivermansuffix__) X(__miscmansuffix__), fbdevhw(__drivermansuffix__)
......
...@@ -41,6 +41,10 @@ ...@@ -41,6 +41,10 @@
/* for xf86{Depth,FbBpp}. i am a terrible person, and i am sorry. */ /* for xf86{Depth,FbBpp}. i am a terrible person, and i am sorry. */
#include "xf86Priv.h" #include "xf86Priv.h"
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) > 23
#define HAVE_SHADOW_3224
#endif
static Bool debug = 0; static Bool debug = 0;
#define TRACE_ENTER(str) \ #define TRACE_ENTER(str) \
...@@ -181,6 +185,7 @@ typedef struct { ...@@ -181,6 +185,7 @@ typedef struct {
int lineLength; int lineLength;
int rotate; int rotate;
Bool shadowFB; Bool shadowFB;
Bool shadow24;
void *shadow; void *shadow;
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
CreateScreenResourcesProcPtr CreateScreenResources; CreateScreenResourcesProcPtr CreateScreenResources;
...@@ -482,6 +487,15 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags) ...@@ -482,6 +487,15 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
fbbpp = 32; fbbpp = 32;
} while (0); } while (0);
fPtr->shadow24 = FALSE;
#if HAVE_SHADOW_3224
/* okay but 24bpp is awful */
if (fbbpp == 24) {
fPtr->shadow24 = TRUE;
fbbpp = 32;
}
#endif
if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp, if (!xf86SetDepthBpp(pScrn, default_depth, default_depth, fbbpp,
Support24bppFb | Support32bppFb | SupportConvert32to24 | SupportConvert24to32)) Support24bppFb | Support32bppFb | SupportConvert32to24 | SupportConvert24to32))
return FALSE; return FALSE;
...@@ -531,12 +545,18 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags) ...@@ -531,12 +545,18 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
/* use shadow framebuffer by default */ /* use shadow framebuffer by default */
fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE); fPtr->shadowFB = xf86ReturnOptValBool(fPtr->Options, OPTION_SHADOW_FB, TRUE);
if (!fPtr->shadowFB && fPtr->shadow24) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
"24bpp requires shadow framebuffer, forcing\n");
fPtr->shadowFB = TRUE;
}
debug = xf86ReturnOptValBool(fPtr->Options, OPTION_DEBUG, FALSE); debug = xf86ReturnOptValBool(fPtr->Options, OPTION_DEBUG, FALSE);
/* rotation */ /* rotation */
fPtr->rotate = FBDEV_ROTATE_NONE; fPtr->rotate = FBDEV_ROTATE_NONE;
if ((s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE))) s = xf86GetOptValString(fPtr->Options, OPTION_ROTATE);
if (s && !fPtr->shadow24)
{ {
if(!xf86NameCmp(s, "CW")) if(!xf86NameCmp(s, "CW"))
{ {
...@@ -657,6 +677,14 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags) ...@@ -657,6 +677,14 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
return TRUE; return TRUE;
} }
static void
fbdevUpdate32to24(ScreenPtr pScreen, shadowBufPtr pBuf)
{
#ifdef HAVE_SHADOW_3224
shadowUpdate32to24(pScreen, pBuf);
#endif
}
static void static void
fbdevUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) fbdevUpdateRotatePacked(ScreenPtr pScreen, shadowBufPtr pBuf)
{ {
...@@ -676,6 +704,7 @@ FBDevCreateScreenResources(ScreenPtr pScreen) ...@@ -676,6 +704,7 @@ FBDevCreateScreenResources(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
FBDevPtr fPtr = FBDEVPTR(pScrn); FBDevPtr fPtr = FBDEVPTR(pScrn);
Bool ret; Bool ret;
void (*update)(ScreenPtr, shadowBufPtr);
pScreen->CreateScreenResources = fPtr->CreateScreenResources; pScreen->CreateScreenResources = fPtr->CreateScreenResources;
ret = pScreen->CreateScreenResources(pScreen); ret = pScreen->CreateScreenResources(pScreen);
...@@ -686,9 +715,15 @@ FBDevCreateScreenResources(ScreenPtr pScreen) ...@@ -686,9 +715,15 @@ FBDevCreateScreenResources(ScreenPtr pScreen)
pPixmap = pScreen->GetScreenPixmap(pScreen); pPixmap = pScreen->GetScreenPixmap(pScreen);
if (!shadowAdd(pScreen, pPixmap, fPtr->rotate ? if (fPtr->shadow24)
fbdevUpdateRotatePacked : fbdevUpdatePacked, update = fbdevUpdate32to24;
FBDevWindowLinear, fPtr->rotate, NULL)) { else if (fPtr->rotate)
update = fbdevUpdateRotatePacked;
else
update = fbdevUpdatePacked;
if (!shadowAdd(pScreen, pPixmap, update, FBDevWindowLinear, fPtr->rotate,
NULL)) {
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment