diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-06-07 00:20:35 +0100 |
---|---|---|
committer | Owain G. Ainsworth <oga@openbsd.org> | 2010-06-07 21:10:59 +0100 |
commit | b83ac303fa36f5fa6025610e6b49ccc3511da416 (patch) | |
tree | 07e4bb3054628beb5ffd1e50a6bfa90fa6889ed4 | |
parent | cafcbe45c5645b4db5dd87092e08b5bcf28423f5 (diff) |
Use the direct dixGevPrivate() API when available
This is quicker and smaller than the old indirect function call to
dixLookupPrivate().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit d56ea7a852d7090360fe080acec268de55ee908d)
Signed-off-by: Owain G. Ainsworth <oga@openbsd.org>
-rw-r--r-- | src/i830.h | 4 | ||||
-rw-r--r-- | uxa/uxa-priv.h | 7 |
2 files changed, 9 insertions, 2 deletions
@@ -163,7 +163,11 @@ extern int uxa_pixmap_index; static inline struct intel_pixmap *i830_get_pixmap_intel(PixmapPtr pixmap) { +#if HAS_DEVPRIVATEKEYREC + return dixGetPrivate(&pixmap->devPrivates, &uxa_pixmap_index); +#else return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index); +#endif } static inline void i830_set_pixmap_intel(PixmapPtr pixmap, struct intel_pixmap *intel) diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h index 01a292e2..75089657 100644 --- a/uxa/uxa-priv.h +++ b/uxa/uxa-priv.h @@ -173,8 +173,11 @@ extern int uxa_screen_index; static inline uxa_screen_t *uxa_get_screen(ScreenPtr screen) { - return (uxa_screen_t *) dixLookupPrivate(&screen->devPrivates, - &uxa_screen_index); +#if HAS_DEVPRIVATEKEYREC + return dixGetPrivate(&screen->devPrivates, &uxa_screen_index); +#else + return dixLookupPrivate(&screen->devPrivates, &uxa_screen_index); +#endif } /** Align an offset to an arbitrary alignment */ |