Commit 46a91d2d authored by Søren Sandmann Pedersen's avatar Søren Sandmann Pedersen Committed by Søren Sandmann Pedersen

Make it compile with and without dixLookupPrivate() changes.

parent 7d82b547
......@@ -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)
......
......@@ -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)
......
......@@ -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;
......
......@@ -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 */
......
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment