diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-22 13:34:35 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-22 13:37:00 +0000 |
commit | 0ee29c4ea3b05e9361635a2ef6e7b92c160d68cf (patch) | |
tree | bcd768fd12b348e6c7b70ff9daa1986a7cee83b8 /src/uxa | |
parent | f0021ab2a66fb7c84758ad482f47f023b862360b (diff) |
uxa,sna: Prevent bo exchange when pinned for non-DRI2 clients
With the advent of DRI3 (and previously with Prime and Glamor) we have
external clients who rely on the pixmap<->bo mapping being invariant.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/uxa')
-rw-r--r-- | src/uxa/intel.h | 8 | ||||
-rw-r--r-- | src/uxa/intel_dri.c | 5 | ||||
-rw-r--r-- | src/uxa/intel_uxa.c | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/uxa/intel.h b/src/uxa/intel.h index 131f18ca..ded975ff 100644 --- a/src/uxa/intel.h +++ b/src/uxa/intel.h @@ -97,10 +97,12 @@ struct intel_pixmap { int8_t busy :2; uint8_t dirty :1; uint8_t offscreen :1; - uint8_t pinned :3; + uint8_t pinned :5; #define PIN_SCANOUT 0x1 -#define PIN_DRI 0x2 -#define PIN_GLAMOR 0x4 +#define PIN_DRI2 0x2 +#define PIN_DRI3 0x4 +#define PIN_PRIME 0x8 +#define PIN_GLAMOR 0x10 }; #if HAS_DEVPRIVATEKEYREC diff --git a/src/uxa/intel_dri.c b/src/uxa/intel_dri.c index acedd0b7..1a9bad0b 100644 --- a/src/uxa/intel_dri.c +++ b/src/uxa/intel_dri.c @@ -91,7 +91,7 @@ static uint32_t pixmap_flink(PixmapPtr pixmap) if (dri_bo_flink(priv->bo, &name) != 0) return 0; - priv->pinned |= PIN_DRI; + priv->pinned |= PIN_DRI2; return name; } @@ -984,6 +984,9 @@ can_exchange(DrawablePtr drawable, DRI2BufferPtr front, DRI2BufferPtr back) if (front_intel->tiling != back_intel->tiling) return FALSE; + if (front_intel->pinned & ~(PIN_SCANOUT | PIN_DRI2)) + return FALSE; + return TRUE; } diff --git a/src/uxa/intel_uxa.c b/src/uxa/intel_uxa.c index 6fb1333f..d4ba7fcc 100644 --- a/src/uxa/intel_uxa.c +++ b/src/uxa/intel_uxa.c @@ -1195,7 +1195,7 @@ intel_uxa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr slave, void **fd_handle drm_intel_bo_get_tiling(bo, &tiling, &swizzle); if (tiling == I915_TILING_X) { - if (priv->pinned & ~PIN_DRI) + if (priv->pinned) return FALSE; tiling = I915_TILING_NONE; @@ -1219,7 +1219,7 @@ intel_uxa_share_pixmap_backing(PixmapPtr ppix, ScreenPtr slave, void **fd_handle } drm_intel_bo_get_tiling(bo, &tiling, &swizzle); drm_intel_bo_gem_export_to_prime(bo, &handle); - priv->pinned |= PIN_DRI; + priv->pinned |= PIN_PRIME; *fd_handle = (void *)(long)handle; return TRUE; |