Add DGAReInitModes in order to allow the driver to change the list of

supported DGA modes. (Part 1)
This commit is contained in:
Thomas Winischhofer 2005-10-11 19:02:18 +00:00
parent c1a2abadfb
commit d91d18e1d6
2 changed files with 52 additions and 0 deletions

View File

@ -209,6 +209,7 @@ Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
int num);
Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
xf86SetDGAModeProc xf86SetDGAMode;
/* xf86Events.c */

View File

@ -170,6 +170,57 @@ DGAInit(
return TRUE;
}
/* DGAReInitModes allows the driver to re-initialize
* the DGA mode list.
*/
Bool
DGAReInitModes(
ScreenPtr pScreen,
DGAModePtr modes,
int num
){
DGAScreenPtr pScreenPriv;
int i;
/* No DGA? Ignore call (but don't make it look like it failed) */
if(DGAScreenIndex < 0)
return TRUE;
pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen);
/* Same as above */
if(!pScreenPriv)
return TRUE;
/* Can't do this while DGA is active */
if(pScreenPriv->current)
return FALSE;
/* Quick sanity check */
if(!num)
modes = NULL;
else if(!modes)
num = 0;
pScreenPriv->numModes = num;
pScreenPriv->modes = modes;
/* This practically disables DGA. So be it. */
if(!num)
return TRUE;
for(i = 0; i < num; i++)
modes[i].num = i + 1;
#ifdef PANORAMIX
if(!noPanoramiXExtension)
for(i = 0; i < num; i++)
modes[i].flags &= ~DGA_PIXMAP_AVAILABLE;
#endif
return TRUE;
}
static void
FreeMarkedVisuals(ScreenPtr pScreen)