From ec83d674167e7045d5317b179c9998e3172a26dc Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 26 Nov 2006 19:31:48 -0800 Subject: [PATCH] Ensure RandR resource types are registered before resources are created. Now that resources can be created during server initialization, make sure the crtc, output and mode resource types are created before attempting to create associated resources. --- randr/rrcrtc.c | 2 ++ randr/rrmode.c | 3 +++ randr/rroutput.c | 2 ++ 3 files changed, 7 insertions(+) diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index b81c390f1..212352c15 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -55,6 +55,8 @@ RRCrtcCreate (void *devPrivate) { RRCrtcPtr crtc; + if (!RRInit()) + return NULL; crtc = xalloc (sizeof (RRCrtcRec)); if (!crtc) return NULL; diff --git a/randr/rrmode.c b/randr/rrmode.c index 3cd9ef273..a0696e170 100644 --- a/randr/rrmode.c +++ b/randr/rrmode.c @@ -67,6 +67,9 @@ RRModeGet (xRRModeInfo *modeInfo, } } + if (!RRInit ()) + return NULL; + mode = xalloc (sizeof (RRModeRec) + modeInfo->nameLength + 1); if (!mode) return NULL; diff --git a/randr/rroutput.c b/randr/rroutput.c index 8b760ec9a..f38f5826a 100644 --- a/randr/rroutput.c +++ b/randr/rroutput.c @@ -51,6 +51,8 @@ RROutputCreate (const char *name, { RROutputPtr output; + if (!RRInit()) + return NULL; output = xalloc (sizeof (RROutputRec) + nameLength + 1); if (!output) return NULL;