From f0c55637907f42b01dabbacc29a8a5de2e82e06c Mon Sep 17 00:00:00 2001 From: Søren Sandmann Pedersen Date: Mon, 24 Jan 2011 21:50:53 -0500 Subject: Make it compile with and without dixLookupPrivate() changes. --- src/qxl.h | 9 ++++++++- src/qxl_driver.c | 10 +++++++++- src/uxa/uxa-glyphs.c | 13 +++++++++++++ src/uxa/uxa-priv.h | 8 ++++++++ src/uxa/uxa.c | 6 ++++++ 5 files changed, 44 insertions(+), 2 deletions(-) diff --git a/src/qxl.h b/src/qxl.h index 7055be8..801fe77 100644 --- a/src/qxl.h +++ b/src/qxl.h @@ -809,12 +809,19 @@ Bool qxl_surface_put_image (qxl_surface_t *dest, void qxl_surface_unref (surface_cache_t *cache, uint32_t surface_id); - +#if HAS_DEVPRIVATEKEYREC extern DevPrivateKeyRec uxa_pixmap_index; +#else +extern int uxa_pixmap_index; +#endif static inline qxl_surface_t *get_surface (PixmapPtr pixmap) { +#if HAS_DEVPRIVATEKEYREC return dixGetPrivate(&pixmap->devPrivates, &uxa_pixmap_index); +#else + return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index); +#endif } static inline void set_surface (PixmapPtr pixmap, qxl_surface_t *surface) diff --git a/src/qxl_driver.c b/src/qxl_driver.c index f1c7cd2..4240c8a 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -519,7 +519,11 @@ qxl_create_screen_resources(ScreenPtr pScreen) return TRUE; } +#if HAS_DEVPRIVATEKEYREC DevPrivateKeyRec uxa_pixmap_index; +#else +int uxa_pixmap_index; +#endif static Bool unaccel (void) @@ -747,9 +751,13 @@ static Bool setup_uxa (qxl_screen_t *qxl, ScreenPtr screen) { ScrnInfoPtr scrn = xf86Screens[screen->myNum]; - +#if HAS_DIXREGISTERPRIVATEKEY if (!dixRegisterPrivateKey(&uxa_pixmap_index, PRIVATE_PIXMAP, 0)) return FALSE; +#else + if (!dixRequestPrivate(&uxa_pixmap_index, 0)) + return FALSE; +#endif qxl->uxa = uxa_driver_alloc(); if (qxl->uxa == NULL) diff --git a/src/uxa/uxa-glyphs.c b/src/uxa/uxa-glyphs.c index 8bd4fc8..c9fae0f 100644 --- a/src/uxa/uxa-glyphs.c +++ b/src/uxa/uxa-glyphs.c @@ -83,11 +83,19 @@ struct uxa_glyph { uint16_t size, pos; }; +#if HAS_DEVPRIVATEKEYREC static DevPrivateKeyRec uxa_glyph_key; +#else +static int uxa_glyph_key; +#endif static inline struct uxa_glyph *uxa_glyph_get_private(GlyphPtr glyph) { +#if HAS_DEVPRIVATEKEYREC return dixGetPrivate(&glyph->devPrivates, &uxa_glyph_key); +#else + return dixLookupPrivate(&glyph->devPrivates, &uxa_glyph_key); +#endif } static inline void uxa_glyph_set_private(GlyphPtr glyph, struct uxa_glyph *priv) @@ -190,8 +198,13 @@ bail: Bool uxa_glyphs_init(ScreenPtr pScreen) { +#if HAS_DIXREGISTERPRIVATEKEY if (!dixRegisterPrivateKey(&uxa_glyph_key, PRIVATE_GLYPH, 0)) return FALSE; +#else + if (!dixRequestPrivate(&uxa_glyph_key, 0)) + return FALSE; +#endif if (!uxa_realize_glyph_caches(pScreen)) return FALSE; diff --git a/src/uxa/uxa-priv.h b/src/uxa/uxa-priv.h index 21c1623..80095ac 100644 --- a/src/uxa/uxa-priv.h +++ b/src/uxa/uxa-priv.h @@ -158,10 +158,18 @@ typedef struct { (PixmapWidthPaddingInfo[d].padRoundUp+1))) #endif +#if HAS_DEVPRIVATEKEYREC extern DevPrivateKeyRec uxa_screen_index; +#else +extern int uxa_screen_index; +#endif static inline uxa_screen_t *uxa_get_screen(ScreenPtr screen) { +#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 */ diff --git a/src/uxa/uxa.c b/src/uxa/uxa.c index 7d6efe1..71609fa 100644 --- a/src/uxa/uxa.c +++ b/src/uxa/uxa.c @@ -39,7 +39,11 @@ #include "dixfontstr.h" #include "uxa.h" +#if HAS_DEVPRIVATEKEYREC DevPrivateKeyRec uxa_screen_index; +#else +int uxa_screen_index; +#endif /** * uxa_get_drawable_pixmap() returns a backing pixmap for a given drawable. @@ -497,8 +501,10 @@ Bool uxa_driver_init(ScreenPtr screen, uxa_driver_t * uxa_driver) "non-NULL\n", screen->myNum); return FALSE; } +#if HAS_DIXREGISTERPRIVATEKEY if (!dixRegisterPrivateKey(&uxa_screen_index, PRIVATE_SCREEN, 0)) return FALSE; +#endif uxa_screen = calloc(sizeof(uxa_screen_t), 1); if (!uxa_screen) { -- cgit v1.2.3