diff options
author | Keith Packard <keithp@guitar.keithp.com> | 2006-12-19 22:39:57 -0800 |
---|---|---|
committer | Keith Packard <keithp@guitar.keithp.com> | 2006-12-19 22:39:57 -0800 |
commit | 4ba72fc408e7fab7c384aff5e73f0cfb8fd86cf3 (patch) | |
tree | d63d8b33c80c961a1a02fa6213b18bf376619490 | |
parent | c28075e1d70c98b39fc9829a6a01da171a9b9426 (diff) |
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.
-rw-r--r-- | src/i830.h | 1 | ||||
-rw-r--r-- | src/i830_dga.c | 43 | ||||
-rw-r--r-- | src/i830_driver.c | 1 | ||||
-rw-r--r-- | src/i830_randr.c | 2 |
4 files changed, 42 insertions, 5 deletions
@@ -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 diff --git a/src/i830_dga.c b/src/i830_dga.c index b53b667e..c312c6d6 100644 --- a/src/i830_dga.c +++ b/src/i830_dga.c @@ -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; diff --git a/src/i830_driver.c b/src/i830_driver.c index 7309675b..d30af07c 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -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 */ diff --git a/src/i830_randr.c b/src/i830_randr.c index 0a103846..3d6febc1 100644 --- a/src/i830_randr.c +++ b/src/i830_randr.c @@ -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); } |