summaryrefslogtreecommitdiff
path: root/src/i830_dga.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@guitar.keithp.com>2006-12-19 22:39:57 -0800
committerKeith Packard <keithp@guitar.keithp.com>2006-12-19 22:39:57 -0800
commit4ba72fc408e7fab7c384aff5e73f0cfb8fd86cf3 (patch)
treed63d8b33c80c961a1a02fa6213b18bf376619490 /src/i830_dga.c
parentc28075e1d70c98b39fc9829a6a01da171a9b9426 (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.
Diffstat (limited to 'src/i830_dga.c')
-rw-r--r--src/i830_dga.c43
1 files changed, 38 insertions, 5 deletions
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;