From b83ac303fa36f5fa6025610e6b49ccc3511da416 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 7 Jun 2010 00:20:35 +0100 Subject: 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 (cherry picked from commit d56ea7a852d7090360fe080acec268de55ee908d) Signed-off-by: Owain G. Ainsworth --- src/i830.h | 4 ++++ uxa/uxa-priv.h | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i830.h b/src/i830.h index d57192d1..4d46d7b7 100644 --- a/src/i830.h +++ b/src/i830.h @@ -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 */ -- cgit v1.2.3