aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common/xf86VidMode.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common/xf86VidMode.c')
-rw-r--r--xorg-server/hw/xfree86/common/xf86VidMode.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86VidMode.c b/xorg-server/hw/xfree86/common/xf86VidMode.c
index 08f27b8e4..591c338b1 100644
--- a/xorg-server/hw/xfree86/common/xf86VidMode.c
+++ b/xorg-server/hw/xfree86/common/xf86VidMode.c
@@ -47,7 +47,7 @@
#include "vidmodeproc.h"
#include "xf86cmap.h"
-static int VidModeKeyIndex;
+static DevPrivateKeyRec VidModeKeyRec;
static DevPrivateKey VidModeKey;
static int VidModeCount = 0;
static Bool VidModeClose(int i, ScreenPtr pScreen);
@@ -67,15 +67,17 @@ VidModeExtensionInit(ScreenPtr pScreen)
return FALSE;
}
- VidModeKey = &VidModeKeyIndex;
+ VidModeKey = &VidModeKeyRec;
- if (!dixSetPrivate(&pScreen->devPrivates, VidModeKey,
- calloc(sizeof(VidModeRec), 1))) {
- DebugF("xcalloc failed\n");
+ if (!dixRegisterPrivateKey(&VidModeKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
- }
- pVidMode = VMPTR(pScreen);
+ pVidMode = calloc(sizeof(VidModeRec), 1);
+ if (!pVidMode)
+ return FALSE;
+
+ dixSetPrivate(&pScreen->devPrivates, VidModeKey, pVidMode);
+
pVidMode->Flags = 0;
pVidMode->Next = NULL;
pVidMode->CloseScreen = pScreen->CloseScreen;