diff options
author | Keith Packard <keithp@keithp.com> | 2010-04-26 17:22:21 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-05 19:23:03 -0700 |
commit | faeebead7bfcc78535757ca7acc1faf7554c03b7 (patch) | |
tree | 1a8f13a3b1ae968011efb9679bc3ed79a29020be /glx | |
parent | c865a24401f06bcf1347d8b41f736a066ab25693 (diff) |
Change the devPrivates API to require dixRegisterPrivateKey
This patch only changes the API, not the implementation of the
devPrivates infrastructure. This will permit a new devPrivates
implementation to be layed into the server without requiring
simultaneous changes in every devPrivates user.
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Diffstat (limited to 'glx')
-rw-r--r-- | glx/glxext.c | 6 | ||||
-rw-r--r-- | glx/glxscreens.c | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/glx/glxext.c b/glx/glxext.c index b234afcd0..4d02b4778 100644 --- a/glx/glxext.c +++ b/glx/glxext.c @@ -65,8 +65,8 @@ RESTYPE __glXSwapBarrierRes; */ xGLXSingleReply __glXReply; -static int glxClientPrivateKeyIndex; -static DevPrivateKey glxClientPrivateKey = &glxClientPrivateKeyIndex; +static DevPrivateKeyRec glxClientPrivateKeyRec; +#define glxClientPrivateKey (&glxClientPrivateKeyRec) /* ** Client that called into GLX dispatch. @@ -364,7 +364,7 @@ void GlxExtensionInit(void) if (!__glXContextRes || !__glXDrawableRes || !__glXSwapBarrierRes) return; - if (!dixRequestPrivate(glxClientPrivateKey, sizeof (__GLXclientState))) + if (!dixRegisterPrivateKey(&glxClientPrivateKeyRec, PRIVATE_CLIENT, sizeof (__GLXclientState))) return; if (!AddCallback (&ClientStateCallback, glxClientCallback, 0)) return; diff --git a/glx/glxscreens.c b/glx/glxscreens.c index ffe70c31c..a5b61df9f 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -44,8 +44,8 @@ #include "glxext.h" #include "protocol-versions.h" -static int glxScreenPrivateKeyIndex; -static DevPrivateKey glxScreenPrivateKey = &glxScreenPrivateKeyIndex; +static DevPrivateKeyRec glxScreenPrivateKeyRec; +#define glxScreenPrivateKey (&glxScreenPrivateKeyRec) const char GLServerVersion[] = "1.4"; static const char GLServerExtensions[] = @@ -352,6 +352,9 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen) __GLXconfig *config; int i; + if (!dixRegisterPrivateKey(&glxScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) + return; + pGlxScreen->pScreen = pScreen; pGlxScreen->GLextensions = xstrdup(GLServerExtensions); pGlxScreen->GLXvendor = xstrdup(GLXServerVendorName); |