From 14b1561dac796c6ad05648e6857028a87acde9ef Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Tue, 22 Jun 2010 08:30:52 -0700 Subject: Adapt to DevPrivate API changes. This allows the driver to be built against either the old or new DevPrivate API. Signed-off-by: Jamey Sharp --- src/gx_randr.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/gx_randr.c b/src/gx_randr.c index aa8b995..5a0b9f5 100644 --- a/src/gx_randr.c +++ b/src/gx_randr.c @@ -55,7 +55,11 @@ typedef struct _GXRandRInfo Rotation supported_rotations; /* driver supported */ } XF86RandRInfoRec, *XF86RandRInfoPtr; +#if HAS_DEVPRIVATEKEYREC +static DevPrivateKeyRec GXRandRIndex; +#else static int GXRandRIndex; +#endif #define OLD_VIDEODRV_INTERFACE (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4) @@ -331,6 +335,10 @@ GXRandRInit(ScreenPtr pScreen, int rotation) #if OLD_VIDEODRV_INTERFACE GXRandRIndex = AllocateScreenPrivateIndex(); #endif +#if HAS_DIXREGISTERPRIVATEKEY + if (!dixRegisterPrivateKey(&GXRandRIndex, PRIVATE_SCREEN, 0)) + return FALSE; +#endif pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1); if (pRandr == NULL) -- cgit v1.2.3