Re-fix DGA removal.
Removing DGA ended up breaking any drivers calling into the old xf86DiDGAInit function as it tried to see if DGA was already enabled and ended up crashing if the VT wasn't completely initialized. Oops. Also, if the driver initializes DGA itself, have the DiDGA initialization overwrite that information as the DiDGA code will call ReInit on mode detect. Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
873467adad
commit
db98b26ee1
|
@ -120,8 +120,22 @@ DGAInit(
|
||||||
|
|
||||||
DGAScreenKey = &DGAScreenKeyIndex;
|
DGAScreenKey = &DGAScreenKeyIndex;
|
||||||
|
|
||||||
|
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
|
if (!pScreenPriv)
|
||||||
|
{
|
||||||
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
|
if(!(pScreenPriv = (DGAScreenPtr)xalloc(sizeof(DGAScreenRec))))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
|
||||||
|
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
||||||
|
pScreen->CloseScreen = DGACloseScreen;
|
||||||
|
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
|
||||||
|
pScreen->DestroyColormap = DGADestroyColormap;
|
||||||
|
pScreenPriv->InstallColormap = pScreen->InstallColormap;
|
||||||
|
pScreen->InstallColormap = DGAInstallColormap;
|
||||||
|
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
|
||||||
|
pScreen->UninstallColormap = DGAUninstallColormap;
|
||||||
|
}
|
||||||
|
|
||||||
pScreenPriv->pScrn = pScrn;
|
pScreenPriv->pScrn = pScrn;
|
||||||
pScreenPriv->numModes = num;
|
pScreenPriv->numModes = num;
|
||||||
|
@ -146,17 +160,6 @@ DGAInit(
|
||||||
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
|
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, DGAScreenKey, pScreenPriv);
|
|
||||||
pScreenPriv->CloseScreen = pScreen->CloseScreen;
|
|
||||||
pScreen->CloseScreen = DGACloseScreen;
|
|
||||||
pScreenPriv->DestroyColormap = pScreen->DestroyColormap;
|
|
||||||
pScreen->DestroyColormap = DGADestroyColormap;
|
|
||||||
pScreenPriv->InstallColormap = pScreen->InstallColormap;
|
|
||||||
pScreen->InstallColormap = DGAInstallColormap;
|
|
||||||
pScreenPriv->UninstallColormap = pScreen->UninstallColormap;
|
|
||||||
pScreen->UninstallColormap = DGAUninstallColormap;
|
|
||||||
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -806,7 +806,7 @@ xf86CrtcScreenInit (ScreenPtr screen)
|
||||||
screen->CloseScreen = xf86CrtcCloseScreen;
|
screen->CloseScreen = xf86CrtcCloseScreen;
|
||||||
|
|
||||||
#ifdef XFreeXDGA
|
#ifdef XFreeXDGA
|
||||||
xf86DiDGAInit(screen, 0);
|
_xf86_di_dga_init_internal(screen);
|
||||||
#endif
|
#endif
|
||||||
#ifdef RANDR_13_INTERFACE
|
#ifdef RANDR_13_INTERFACE
|
||||||
return RANDR_INTERFACE_VERSION;
|
return RANDR_INTERFACE_VERSION;
|
||||||
|
@ -1928,7 +1928,7 @@ xf86SetScrnInfoModes (ScrnInfoPtr scrn)
|
||||||
scrn->currentMode = scrn->modes;
|
scrn->currentMode = scrn->modes;
|
||||||
#ifdef XFreeXDGA
|
#ifdef XFreeXDGA
|
||||||
if (scrn->pScreen)
|
if (scrn->pScreen)
|
||||||
xf86DiDGAReInit(scrn->pScreen);
|
_xf86_di_dga_reinit_internal(scrn->pScreen);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -833,6 +833,10 @@ xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus);
|
||||||
extern _X_EXPORT Bool
|
extern _X_EXPORT Bool
|
||||||
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address);
|
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address);
|
||||||
|
|
||||||
|
/* this is the real function, used only internally */
|
||||||
|
_X_INTERNAL Bool
|
||||||
|
_xf86_di_dga_init_internal (ScreenPtr pScreen);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Re-initialize dga for this screen (as when the set of modes changes)
|
* Re-initialize dga for this screen (as when the set of modes changes)
|
||||||
*/
|
*/
|
||||||
|
@ -841,6 +845,10 @@ extern _X_EXPORT Bool
|
||||||
xf86DiDGAReInit (ScreenPtr pScreen);
|
xf86DiDGAReInit (ScreenPtr pScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* This is the real function, used only internally */
|
||||||
|
_X_INTERNAL Bool
|
||||||
|
_xf86_di_dga_reinit_internal (ScreenPtr pScreen);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set the subpixel order reported for the screen using
|
* Set the subpixel order reported for the screen using
|
||||||
* the information from the outputs
|
* the information from the outputs
|
||||||
|
|
|
@ -174,6 +174,12 @@ static DGAFunctionRec xf86_dga_funcs = {
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xf86DiDGAReInit (ScreenPtr pScreen)
|
xf86DiDGAReInit (ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
_xf86_di_dga_reinit_internal (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
|
||||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||||
|
@ -189,13 +195,16 @@ xf86DiDGAReInit (ScreenPtr pScreen)
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
|
xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool
|
||||||
|
_xf86_di_dga_init_internal (ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
|
||||||
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
|
||||||
|
|
||||||
if (DGAAvailable(pScreen->myNum))
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
xf86_config->dga_flags = 0;
|
xf86_config->dga_flags = 0;
|
||||||
xf86_config->dga_address = 0;
|
xf86_config->dga_address = 0;
|
||||||
xf86_config->dga_width = 0;
|
xf86_config->dga_width = 0;
|
||||||
|
|
Loading…
Reference in New Issue