From b0c8558b9d9a9984c0067960392e28f5a7622b29 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. (cherry picked from commit ec83d674167e7045d5317b179c9998e3172a26dc) --- 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 b81c390f19..212352c15b 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 3cd9ef2731..a0696e1701 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 8b760ec9a5..f38f5826a5 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;