summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/amd_gx_randr.c23
-rw-r--r--src/amd_lx_randr.c21
2 files changed, 39 insertions, 5 deletions
diff --git a/src/amd_gx_randr.c b/src/amd_gx_randr.c
index a4fa743..1034939 100644
--- a/src/amd_gx_randr.c
+++ b/src/amd_gx_randr.c
@@ -40,7 +40,6 @@
#include "amd.h"
-static int GXRandRIndex;
static int GXRandRGeneration;
typedef struct _GXRandRInfo
@@ -55,7 +54,16 @@ typedef struct _GXRandRInfo
Rotation supported_rotations; /* driver supported */
} XF86RandRInfoRec, *XF86RandRInfoPtr;
-#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+
+static DevPrivateKey GXRandRKey;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
+ dixLookupPrivate(&(p)->devPrivates, GXRandRKey));
+#else
+
+static int GXRandRIndex;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
+#endif
static int
GXRandRModeRefresh(DisplayModePtr mode)
@@ -299,10 +307,15 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
rrScrPrivPtr rp;
if (GXRandRGeneration != serverGeneration) {
- GXRandRIndex = AllocateScreenPrivateIndex();
GXRandRGeneration = serverGeneration;
}
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+ GXRandRIndex = AllocateScreenPrivateIndex();
+#else
+ GXRandRKey = &GXRandRKey;
+#endif
+
pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
if (pRandr == NULL)
return FALSE;
@@ -326,6 +339,10 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
pRandr->supported_rotations = rotation;
pRandr->maxX = pRandr->maxY = 0;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+ dixSetPrivate(&pScreen->devPrivates, GXRandRKey, pRandr);
+#else
pScreen->devPrivates[GXRandRIndex].ptr = pRandr;
+#endif
return TRUE;
}
diff --git a/src/amd_lx_randr.c b/src/amd_lx_randr.c
index e46ae20..19880bb 100644
--- a/src/amd_lx_randr.c
+++ b/src/amd_lx_randr.c
@@ -40,7 +40,6 @@
#include "amd.h"
-static int LXRandRIndex;
static int LXRandRGeneration;
typedef struct _LXRandRInfo
@@ -55,7 +54,16 @@ typedef struct _LXRandRInfo
Rotation supported_rotations; /* driver supported */
} XF86RandRInfoRec, *XF86RandRInfoPtr;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+
+static DevPrivateKey LXRandRKey;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
+ dixLookupPrivate(&(p)->devPrivates, LXRandRKey));
+#else
+
+static int LXRandRIndex;
#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[LXRandRIndex].ptr)
+#endif
static int
LXRandRModeRefresh(DisplayModePtr mode)
@@ -299,10 +307,15 @@ LXRandRInit(ScreenPtr pScreen, int rotation)
rrScrPrivPtr rp;
if (LXRandRGeneration != serverGeneration) {
- LXRandRIndex = AllocateScreenPrivateIndex();
LXRandRGeneration = serverGeneration;
}
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+ LXRandRIndex = AllocateScreenPrivateIndex();
+#else
+ LXRandRKey = &LXRandRKey;
+#endif
+
pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
if (pRandr == NULL)
return FALSE;
@@ -326,6 +339,10 @@ LXRandRInit(ScreenPtr pScreen, int rotation)
pRandr->supported_rotations = rotation;
pRandr->maxX = pRandr->maxY = 0;
+#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(7,0,0,0,0)
+ dixSetPrivate(&pScreen->devPrivates, LXRandRKey, pRandr);
+#else
pScreen->devPrivates[LXRandRIndex].ptr = pRandr;
+#endif
return TRUE;
}