summaryrefslogtreecommitdiff
path: root/hw/xgl/egl/xegl.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xgl/egl/xegl.c')
-rw-r--r--hw/xgl/egl/xegl.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/hw/xgl/egl/xegl.c b/hw/xgl/egl/xegl.c
index c671dbe7c..1cf615bb6 100644
--- a/hw/xgl/egl/xegl.c
+++ b/hw/xgl/egl/xegl.c
@@ -42,14 +42,13 @@
#define XEGL_DEFAULT_SCREEN_WIDTH 800
#define XEGL_DEFAULT_SCREEN_HEIGHT 600
-int xeglScreenGeneration = -1;
-int xeglScreenPrivateIndex;
+DevPrivateKey xeglScreenPrivateKey = &xeglScreenPrivateKey;
-#define XEGL_GET_SCREEN_PRIV(pScreen) \
- ((xeglScreenPtr) (pScreen)->devPrivates[xeglScreenPrivateIndex].ptr)
+#define XEGL_GET_SCREEN_PRIV(pScreen) ((xeglScreenPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, xeglScreenPrivateKey))
-#define XEGL_SET_SCREEN_PRIV(pScreen, v) \
- ((pScreen)->devPrivates[xeglScreenPrivateIndex].ptr = (pointer) v)
+#define XEGL_SET_SCREEN_PRIV(pScreen, v) \
+ dixSetPrivate(&(pScreen)->devPrivates, xeglScreenPrivateKey, v)
#define XEGL_SCREEN_PRIV(pScreen) \
xeglScreenPtr pScreenPriv = XEGL_GET_SCREEN_PRIV (pScreen)
@@ -66,15 +65,6 @@ xeglAllocatePrivates (ScreenPtr pScreen)
{
xeglScreenPtr pScreenPriv;
- if (xeglScreenGeneration != serverGeneration)
- {
- xeglScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (xeglScreenPrivateIndex < 0)
- return FALSE;
-
- xeglScreenGeneration = serverGeneration;
- }
-
pScreenPriv = xalloc (sizeof (xeglScreenRec));
if (!pScreenPriv)
return FALSE;