summaryrefslogtreecommitdiff
path: root/GL
diff options
context:
space:
mode:
Diffstat (limited to 'GL')
-rw-r--r--GL/glx/glxext.c9
-rw-r--r--GL/glx/glxscreens.c19
2 files changed, 9 insertions, 19 deletions
diff --git a/GL/glx/glxext.c b/GL/glx/glxext.c
index f9b872c41..85d8debd4 100644
--- a/GL/glx/glxext.c
+++ b/GL/glx/glxext.c
@@ -27,6 +27,7 @@
#include "glxserver.h"
#include <windowstr.h>
#include <propertyst.h>
+#include "privates.h"
#include <os.h>
#include "g_disptab.h"
#include "unpack.h"
@@ -53,7 +54,7 @@ RESTYPE __glXSwapBarrierRes;
*/
xGLXSingleReply __glXReply;
-static int glxClientPrivateIndex;
+static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKey;
/*
** Client that called into GLX dispatch.
@@ -204,7 +205,7 @@ int __glXError(int error)
__GLXclientState *
glxGetClient(ClientPtr pClient)
{
- return (__GLXclientState *) pClient->devPrivates[glxClientPrivateIndex].ptr;
+ return dixLookupPrivate(&pClient->devPrivates, glxClientPrivateKey);
}
static void
@@ -274,9 +275,7 @@ void GlxExtensionInit(void)
__glXDrawableRes = CreateNewResourceType((DeleteType)DrawableGone);
__glXSwapBarrierRes = CreateNewResourceType((DeleteType)SwapBarrierGone);
- glxClientPrivateIndex = AllocateClientPrivateIndex ();
- if (!AllocateClientPrivate (glxClientPrivateIndex,
- sizeof (__GLXclientState)))
+ if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState)))
return;
if (!AddCallback (&ClientStateCallback, glxClientCallback, 0))
return;
diff --git a/GL/glx/glxscreens.c b/GL/glx/glxscreens.c
index d6002532d..bf090662a 100644
--- a/GL/glx/glxscreens.c
+++ b/GL/glx/glxscreens.c
@@ -42,12 +42,13 @@
#include <os.h>
#include <colormapst.h>
+#include "privates.h"
#include "glxserver.h"
#include "glxutil.h"
#include "glxext.h"
#include "glcontextmodes.h"
-static int glxScreenPrivateIndex;
+static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKey;
const char GLServerVersion[] = "1.4";
static const char GLServerExtensions[] =
@@ -269,7 +270,7 @@ glxCloseScreen (int index, ScreenPtr pScreen)
__GLXscreen *
glxGetScreen(ScreenPtr pScreen)
{
- return (__GLXscreen *) pScreen->devPrivates[glxScreenPrivateIndex].ptr;
+ return dixLookupPrivate(&pScreen->devPrivates, glxScreenPrivateKey);
}
void GlxSetVisualConfigs(int nconfigs,
@@ -497,19 +498,9 @@ void GlxSetVisualConfig(int config)
void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
{
- static int glxGeneration;
__GLcontextModes *m;
int i;
- if (glxGeneration != serverGeneration)
- {
- glxScreenPrivateIndex = AllocateScreenPrivateIndex ();
- if (glxScreenPrivateIndex == -1)
- return;
-
- glxGeneration = serverGeneration;
- }
-
pGlxScreen->pScreen = pScreen;
pGlxScreen->GLextensions = xstrdup(GLServerExtensions);
pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName);
@@ -548,9 +539,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
break;
}
- pScreen->devPrivates[glxScreenPrivateIndex].ptr = (pointer) pGlxScreen;
+ dixSetPrivate(&pScreen->devPrivates, glxScreenPrivateKey, pGlxScreen);
}
-
+
void __glXScreenDestroy(__GLXscreen *screen)
{
xfree(screen->GLXvendor);