diff options
author | Keith Packard <keithp@keithp.com> | 2014-04-02 14:05:35 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-06-15 22:02:40 +0100 |
commit | 0e08a79599c773f77c0667d557376a5ccee3f89c (patch) | |
tree | b4f38ee2d697eeab2653f576837284786338e9df | |
parent | 15e4d14dfae054c026b7e965ac33985e5cf6a168 (diff) |
glamor: Directly reference the private key records
There's no reason to use a pointer here, it just wastes time.
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r-- | glamor/glamor.c | 16 | ||||
-rw-r--r-- | glamor/glamor_priv.h | 13 |
2 files changed, 14 insertions, 15 deletions
diff --git a/glamor/glamor.c b/glamor/glamor.c index 6aaf1b40f..ac23d5216 100644 --- a/glamor/glamor.c +++ b/glamor/glamor.c @@ -35,10 +35,8 @@ #include "glamor_priv.h" -static DevPrivateKeyRec glamor_screen_private_key_index; -DevPrivateKey glamor_screen_private_key = &glamor_screen_private_key_index; -static DevPrivateKeyRec glamor_pixmap_private_key_index; -DevPrivateKey glamor_pixmap_private_key = &glamor_pixmap_private_key_index; +DevPrivateKeyRec glamor_screen_private_key; +DevPrivateKeyRec glamor_pixmap_private_key; /** * glamor_get_drawable_pixmap() returns a backing pixmap for a given drawable. @@ -68,7 +66,7 @@ glamor_set_pixmap_type(PixmapPtr pixmap, glamor_pixmap_type_t type) glamor_get_screen_private(pixmap->drawable.pScreen); pixmap_priv = dixLookupPrivate(&pixmap->devPrivates, - glamor_pixmap_private_key); + &glamor_pixmap_private_key); if (pixmap_priv == NULL) { pixmap_priv = calloc(sizeof(*pixmap_priv), 1); glamor_set_pixmap_private(pixmap, pixmap_priv); @@ -335,7 +333,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) else glamor_priv->yInverted = FALSE; - if (!dixRegisterPrivateKey(glamor_screen_private_key, PRIVATE_SCREEN, 0)) { + if (!dixRegisterPrivateKey(&glamor_screen_private_key, PRIVATE_SCREEN, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate screen private\n", screen->myNum); @@ -344,7 +342,7 @@ glamor_init(ScreenPtr screen, unsigned int flags) glamor_set_screen_private(screen, glamor_priv); - if (!dixRegisterPrivateKey(glamor_pixmap_private_key, PRIVATE_PIXMAP, 0)) { + if (!dixRegisterPrivateKey(&glamor_pixmap_private_key, PRIVATE_PIXMAP, 0)) { LogMessage(X_WARNING, "glamor%d: Failed to allocate pixmap private\n", screen->myNum); @@ -559,7 +557,7 @@ glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv) glamor_pixmap_private *old_priv; glamor_pixmap_fbo *fbo; - old_priv = dixGetPrivate(&pixmap->devPrivates, glamor_pixmap_private_key); + old_priv = dixGetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (priv) { assert(old_priv == NULL); @@ -572,7 +570,7 @@ glamor_set_pixmap_private(PixmapPtr pixmap, glamor_pixmap_private *priv) free(old_priv); } - dixSetPrivate(&pixmap->devPrivates, glamor_pixmap_private_key, priv); + dixSetPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key, priv); } Bool diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h index 531d25d17..0af6092b5 100644 --- a/glamor/glamor_priv.h +++ b/glamor/glamor_priv.h @@ -548,19 +548,20 @@ typedef enum glamor_pixmap_status { GLAMOR_UPLOAD_FAILED } glamor_pixmap_status_t; -extern DevPrivateKey glamor_screen_private_key; -extern DevPrivateKey glamor_pixmap_private_key; +extern DevPrivateKeyRec glamor_screen_private_key; +extern DevPrivateKeyRec glamor_pixmap_private_key; + static inline glamor_screen_private * glamor_get_screen_private(ScreenPtr screen) { return (glamor_screen_private *) - dixLookupPrivate(&screen->devPrivates, glamor_screen_private_key); + dixLookupPrivate(&screen->devPrivates, &glamor_screen_private_key); } static inline void glamor_set_screen_private(ScreenPtr screen, glamor_screen_private *priv) { - dixSetPrivate(&screen->devPrivates, glamor_screen_private_key, priv); + dixSetPrivate(&screen->devPrivates, &glamor_screen_private_key, priv); } static inline glamor_pixmap_private * @@ -568,11 +569,11 @@ glamor_get_pixmap_private(PixmapPtr pixmap) { glamor_pixmap_private *priv; - priv = dixLookupPrivate(&pixmap->devPrivates, glamor_pixmap_private_key); + priv = dixLookupPrivate(&pixmap->devPrivates, &glamor_pixmap_private_key); if (!priv) { glamor_set_pixmap_type(pixmap, GLAMOR_MEMORY); priv = dixLookupPrivate(&pixmap->devPrivates, - glamor_pixmap_private_key); + &glamor_pixmap_private_key); } return priv; } |