summaryrefslogtreecommitdiff
path: root/src/radeon_glamor.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2014-04-10 11:43:04 +0900
committerMichel Dänzer <michel@daenzer.net>2014-04-14 17:58:45 +0900
commit409786a8f780d78a83bf0bddea5d37117ff6fa39 (patch)
tree3a690895304c2810776a9b529a0dfa2bb1402afd /src/radeon_glamor.c
parentaecf1c4e5f4718adcfb85836830d065d3f4f97a5 (diff)
glamor: Fix test for creating shared pixmaps
The pixmap usage hint is not a bitmask in general. The test for CREATE_PIXMAP_USAGE_SHARED was incorrectly triggering for a glamor internal usage hint being added in the xserver tree. Tested-by: Ed Tomlinson <edtoml@gmail.com>
Diffstat (limited to 'src/radeon_glamor.c')
-rw-r--r--src/radeon_glamor.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index 7f1247c9..4aea51d4 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -172,12 +172,14 @@ Bool radeon_glamor_pixmap_is_offscreen(PixmapPtr pixmap)
return priv && priv->bo;
}
-#ifdef CREATE_PIXMAP_USAGE_SHARED
-#define RADEON_CREATE_PIXMAP_SHARED (CREATE_PIXMAP_USAGE_SHARED | RADEON_CREATE_PIXMAP_DRI2)
-#else
-#define RADEON_CREATE_PIXMAP_SHARED RADEON_CREATE_PIXMAP_DRI2
+#ifndef CREATE_PIXMAP_USAGE_SHARED
+#define CREATE_PIXMAP_USAGE_SHARED RADEON_CREATE_PIXMAP_DRI2
#endif
+#define RADEON_CREATE_PIXMAP_SHARED(usage) \
+ (((usage) & ~RADEON_CREATE_PIXMAP_TILING_FLAGS) == RADEON_CREATE_PIXMAP_DRI2 || \
+ (usage) == CREATE_PIXMAP_USAGE_SHARED)
+
static PixmapPtr
radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
unsigned usage)
@@ -186,7 +188,7 @@ radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
struct radeon_pixmap *priv;
PixmapPtr pixmap, new_pixmap = NULL;
- if (!(usage & RADEON_CREATE_PIXMAP_SHARED)) {
+ if (!RADEON_CREATE_PIXMAP_SHARED(usage)) {
pixmap = glamor_create_pixmap(screen, w, h, depth, usage);
if (pixmap)
return pixmap;
@@ -229,7 +231,7 @@ radeon_glamor_create_pixmap(ScreenPtr screen, int w, int h, int depth,
return pixmap;
fallback_glamor:
- if (usage & RADEON_CREATE_PIXMAP_SHARED) {
+ if (RADEON_CREATE_PIXMAP_SHARED(usage)) {
/* XXX need further work to handle the DRI2 failure case.
* Glamor don't know how to handle a BO only pixmap. Put
* a warning indicator here.