Fix initialization of shadowfb with modern X servers.

This commit is contained in:
matthieu 2013-06-13 21:48:11 +00:00
parent cd7cbb53aa
commit 9a190ffb97
2 changed files with 40 additions and 1 deletions

View File

@ -180,6 +180,7 @@ typedef struct {
int OverrideRskew;
OptionInfoPtr Options;
Bool shadowNew;
CreateScreenResourcesProcPtr CreateScreenResources;
int displaySize;
int dspOverride;
Bool GammaBrightnessOn;

View File

@ -2753,6 +2753,44 @@ TRIDENTRestore(ScrnInfoPtr pScrn)
vgaHWProtect(pScrn, FALSE);
}
static Bool
TRIDENTCreateScreenResources(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
PixmapPtr pPixmap;
Bool ret;
pScreen->CreateScreenResources = pTrident->CreateScreenResources;
ret = pScreen->CreateScreenResources(pScreen);
pScreen->CreateScreenResources = TRIDENTCreateScreenResources;
if (!ret)
return FALSE;
pPixmap = pScreen->GetScreenPixmap(pScreen);
if (!shadowAdd(pScreen, pPixmap, TRIDENTShadowUpdate,
NULL, 0, NULL)) {
return FALSE;
}
return TRUE;
}
static Bool
TRIDENTShadowInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
TRIDENTPtr pTrident = TRIDENTPTR(pScrn);
if (!shadowSetup(pScreen))
return FALSE;
pTrident->CreateScreenResources = pScreen->CreateScreenResources;
pScreen->CreateScreenResources = TRIDENTCreateScreenResources;
return TRUE;
}
/* Mandatory */
@ -3077,7 +3115,7 @@ TRIDENTScreenInit(SCREEN_INIT_ARGS_DECL)
} else {
pTrident->RefreshArea = TRIDENTRefreshArea;
}
shadowInit (pScreen, TRIDENTShadowUpdate, 0);
TRIDENTShadowInit(pScreen);
}
xf86DPMSInit(pScreen, (DPMSSetProcPtr)TRIDENTDisplayPowerManagementSet, 0);