summaryrefslogtreecommitdiff
path: root/randr/rrinfo.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@mandolin.keithp.com>2006-11-08 21:36:35 -0800
committerKeith Packard <keithp@mandolin.keithp.com>2006-11-08 21:36:35 -0800
commitec77a95a02329a2ee3a94d7de9d2a234aecb9ca0 (patch)
tree205413395daca04433d8d97b67ca702425d35479 /randr/rrinfo.c
parent20e9144c0746943624ff77a61791b8596f3f8458 (diff)
Allow RandR objects to be created before the associated ScreenRec.
xf86 drivers need to create RandR object in the PreInit stage, before the ScreenRec is allocated. Changing the RandR DIX code to permit this required the addition of functions that later associate the objects with the related screen. An additional change is that modes are now global, and no longer associated with a specific screen. This change actually makes mode management cleaner as there is no more per-screen list of modes to deal with. This changes the RandR 1.2 ABI/API for drivers.
Diffstat (limited to 'randr/rrinfo.c')
-rw-r--r--randr/rrinfo.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/randr/rrinfo.c b/randr/rrinfo.c
index e92caadfa..244b089f3 100644
--- a/randr/rrinfo.c
+++ b/randr/rrinfo.c
@@ -44,7 +44,7 @@ RROldModeAdd (RROutputPtr output, RRScreenSizePtr size, int refresh)
modeInfo.dotClock = ((CARD32) size->width * (CARD32) size->height *
(CARD32) refresh);
modeInfo.nameLength = strlen (name);
- mode = RRModeGet (pScreen, &modeInfo, name);
+ mode = RRModeGet (&modeInfo, name);
if (!mode)
return NULL;
for (i = 0; i < output->numModes; i++)
@@ -90,12 +90,19 @@ RRScanOldConfig (ScreenPtr pScreen, Rotation rotations)
if (pScrPriv->numOutputs == 0 &&
pScrPriv->numCrtcs == 0)
{
- crtc = RRCrtcCreate (pScreen, NULL);
+ crtc = RRCrtcCreate (NULL);
if (!crtc)
return;
- output = RROutputCreate (pScreen, "default", 7, NULL);
+ if (!RRCrtcAttachScreen (crtc, pScreen))
+ {
+ RRCrtcDestroy (crtc);
+ return;
+ }
+ output = RROutputCreate ("default", 7, NULL);
if (!output)
return;
+ if (!RROutputAttachScreen (output, pScreen))
+ return;
RROutputSetCrtcs (output, &crtc, 1);
RROutputSetCrtc (output, crtc);
RROutputSetConnection (output, RR_Connected);
@@ -206,7 +213,6 @@ RRGetInfo (ScreenPtr pScreen)
if (pScrPriv->nSizes)
RRScanOldConfig (pScreen, rotations);
#endif
- RRModePruneUnused (pScreen);
RRTellChanged (pScreen);
return TRUE;
}