Reinitialize DGA mode list whenever we update the global list.

DGA has a copy of the current mode list (yes, this is broken).
Regenerate it whenever the ddx mode list changes.
This commit is contained in:
Keith Packard 2006-12-19 22:39:57 -08:00
parent c28075e1d7
commit 4ba72fc408
4 changed files with 42 additions and 5 deletions

View File

@ -508,6 +508,7 @@ extern void I830SelectBuffer(ScrnInfoPtr pScrn, int buffer);
extern void I830RefreshRing(ScrnInfoPtr pScrn);
extern void I830EmitFlush(ScrnInfoPtr pScrn);
extern Bool I830DGAReInit(ScreenPtr pScreen);
extern Bool I830DGAInit(ScreenPtr pScreen);
#ifdef I830_XV

View File

@ -83,8 +83,8 @@ DGAFunctionRec I830DGAFuncs = {
#endif
};
Bool
I830DGAInit(ScreenPtr pScreen)
static DGAModePtr
I830DGAModes (ScreenPtr pScreen, int *nump)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
@ -93,8 +93,6 @@ I830DGAInit(ScreenPtr pScreen)
int Bpp = pScrn->bitsPerPixel >> 3;
int num = 0;
MARKER();
pMode = firstMode = pScrn->modes;
while (pMode) {
@ -103,7 +101,7 @@ I830DGAInit(ScreenPtr pScreen)
if (!newmodes) {
xfree(modes);
return FALSE;
return NULL;
}
modes = newmodes;
@ -159,7 +157,42 @@ I830DGAInit(ScreenPtr pScreen)
if (pMode == firstMode)
break;
}
*nump = num;
return modes;
}
Bool
I830DGAReInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
int num;
DGAModePtr modes;
modes = I830DGAModes (pScreen, &num);
if (!modes)
return FALSE;
if (pI830->DGAModes)
xfree (pI830->DGAModes);
pI830->numDGAModes = num;
pI830->DGAModes = modes;
return DGAReInitModes (pScreen, modes, num);
}
Bool
I830DGAInit(ScreenPtr pScreen)
{
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
int num;
DGAModePtr modes;
modes = I830DGAModes (pScreen, &num);
if (!modes)
return FALSE;
pI830->numDGAModes = num;
pI830->DGAModes = modes;

View File

@ -3600,6 +3600,7 @@ I830CheckDevicesTimer(OsTimerPtr timer, CARD32 now, pointer arg)
xf86ProbeOutputModes (pScrn);
xf86SetScrnInfoModes (pScrn);
I830DGAReInit (pScrn->pScreen);
xf86SwitchMode(pScrn->pScreen, pScrn->currentMode);
/* Clear the BIOS's hotkey press flags */

View File

@ -97,6 +97,7 @@ xf86RandR12GetInfo (ScreenPtr pScreen, Rotation *rotations)
/* Re-probe the outputs for new monitors or modes */
xf86ProbeOutputModes (scrp);
xf86SetScrnInfoModes (scrp);
I830DGAReInit (pScreen);
for (mode = scrp->modes; ; mode = mode->next)
{
@ -787,6 +788,7 @@ xf86RandR12GetInfo12 (ScreenPtr pScreen, Rotation *rotations)
xf86ProbeOutputModes (pScrn);
xf86SetScrnInfoModes (pScrn);
I830DGAReInit (pScreen);
return xf86RandR12SetInfo12 (pScreen);
}