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 /exa | |
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 'exa')
-rw-r--r-- | exa/exa.c | 24 |
1 files changed, 15 insertions, 9 deletions
@@ -37,12 +37,12 @@ #include "exa_priv.h" #include "exa.h" -static int exaScreenPrivateKeyIndex; -DevPrivateKey exaScreenPrivateKey = &exaScreenPrivateKeyIndex; -static int exaPixmapPrivateKeyIndex; -DevPrivateKey exaPixmapPrivateKey = &exaPixmapPrivateKeyIndex; -static int exaGCPrivateKeyIndex; -DevPrivateKey exaGCPrivateKey = &exaGCPrivateKeyIndex; +static DevPrivateKeyRec exaScreenPrivateKeyRec; +#define exaScreenPrivateKey (&exaScreenPrivateKeyRec) +static DevPrivateKeyRec exaPixmapPrivateKeyRec; +#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec) +static DevPrivateKeyRec exaGCPrivateKeyRec; +#define exaGCPrivateKey (&exaGCPrivateKeyRec) #ifdef MITSHM static ShmFuncs exaShmFuncs = { NULL, NULL }; @@ -889,7 +889,13 @@ exaDriverInit (ScreenPtr pScreen, ps = GetPictureScreenIfSet(pScreen); - pExaScr = calloc(sizeof (ExaScreenPrivRec), 1); + if (!dixRegisterPrivateKey(&exaScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) { + LogMessage(X_WARNING, "EXA(%d): Failed to register screen private\n", + pScreen->myNum); + return FALSE; + } + + pExaScr = calloc (sizeof (ExaScreenPrivRec), 1); if (!pExaScr) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate screen private\n", pScreen->myNum); @@ -904,7 +910,7 @@ exaDriverInit (ScreenPtr pScreen, exaDDXDriverInit(pScreen); - if (!dixRequestPrivate(exaGCPrivateKey, sizeof(ExaGCPrivRec))) { + if (!dixRegisterPrivateKey(&exaGCPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate GC private\n", pScreen->myNum); @@ -953,7 +959,7 @@ exaDriverInit (ScreenPtr pScreen, */ if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) { - if (!dixRequestPrivate(exaPixmapPrivateKey, sizeof(ExaPixmapPrivRec))) { + if (!dixRegisterPrivateKey(&exaPixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof(ExaPixmapPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate pixmap private\n", pScreen->myNum); |