aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-09-27 11:49:20 +0000
committermarha <marha@users.sourceforge.net>2010-09-27 11:49:20 +0000
commitf331b3c351021681044b2594d1ec5b49bd8edb47 (patch)
tree3f593072cd3390f173857a4d0484938aed8863c1 /xorg-server/dix
parent4e512860d6f0a7644ae3872d91edafa9040f608a (diff)
parent84b35d18d0b84909f7216fc6a7487ffa72bd3f18 (diff)
downloadvcxsrv-f331b3c351021681044b2594d1ec5b49bd8edb47.tar.gz
vcxsrv-f331b3c351021681044b2594d1ec5b49bd8edb47.tar.bz2
vcxsrv-f331b3c351021681044b2594d1ec5b49bd8edb47.zip
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/privates.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/xorg-server/dix/privates.c b/xorg-server/dix/privates.c
index 09014b6e6..3c743deb3 100644
--- a/xorg-server/dix/privates.c
+++ b/xorg-server/dix/privates.c
@@ -256,28 +256,35 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size)
return TRUE;
}
-/*
- * Allocate a new private key.
- *
- * This manages the storage of the key object itself, freeing it when the
- * privates system is restarted at server reset time. All other keys
- * are expected to be statically allocated as the privates must be
- * reset after all objects have been freed
- */
-DevPrivateKey
-dixCreatePrivateKey(DevPrivateType type, unsigned size)
+Bool
+dixRegisterScreenPrivateKey(DevScreenPrivateKey screenKey, ScreenPtr pScreen, DevPrivateType type, unsigned size)
{
DevPrivateKey key;
+ if (!dixRegisterPrivateKey(&screenKey->screenKey, PRIVATE_SCREEN, 0))
+ return FALSE;
+ key = dixGetPrivate(&pScreen->devPrivates, &screenKey->screenKey);
+ if (key != NULL) {
+ assert(key->size == size);
+ assert(key->type == type);
+ return TRUE;
+ }
key = calloc(sizeof (DevPrivateKeyRec), 1);
if (!key)
- return NULL;
+ return FALSE;
if (!dixRegisterPrivateKey(key, type, size)) {
free(key);
- return NULL;
+ return FALSE;
}
key->allocated = TRUE;
- return key;
+ dixSetPrivate(&pScreen->devPrivates, &screenKey->screenKey, key);
+ return TRUE;
+}
+
+DevPrivateKey
+_dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen)
+{
+ return dixGetPrivate(&pScreen->devPrivates, &key->screenKey);
}
/*