summaryrefslogtreecommitdiff
path: root/randr/mirandr.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/mirandr.c
parent20e9144c0746943624ff77a61791b8596f3f8458 (diff)
downloadxserver-ec77a95a02329a2ee3a94d7de9d2a234aecb9ca0.tar.gz
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/mirandr.c')
-rw-r--r--randr/mirandr.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/randr/mirandr.c b/randr/mirandr.c
index 11c299133..3f56fe42e 100644
--- a/randr/mirandr.c
+++ b/randr/mirandr.c
@@ -113,17 +113,24 @@ miRandRInit (ScreenPtr pScreen)
modeInfo.height = pScreen->height;
modeInfo.nameLength = strlen (name);
- mode = RRModeGet (pScreen, &modeInfo, name);
+ mode = RRModeGet (&modeInfo, name);
if (!mode)
return FALSE;
- crtc = RRCrtcCreate (pScreen, NULL);
+ crtc = RRCrtcCreate (NULL);
if (!crtc)
return FALSE;
+ if (!RRCrtcAttachScreen (crtc, pScreen))
+ {
+ RRCrtcDestroy (crtc);
+ return FALSE;
+ }
- output = RROutputCreate (pScreen, "screen", 6, NULL);
+ output = RROutputCreate ("screen", 6, NULL);
if (!output)
return FALSE;
+ if (!RROutputAttachScreen (output, pScreen))
+ return FALSE;
if (!RROutputSetClones (output, NULL, 0))
return FALSE;
if (!RROutputSetModes (output, &mode, 1, 0))