From 9bdf46d6c1a29b7b9e3d35e39a2e789334c0e1be Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 6 Sep 2012 11:38:08 +0100 Subject: sna/prime: Distinguish forms of pinned pixmap So that we can allow prime to replace the backing bo of currently exported pixmaps through DRI2. Signed-off-by: Chris Wilson --- src/sna/sna.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/sna/sna.h') diff --git a/src/sna/sna.h b/src/sna/sna.h index b8760616..44e7f6e4 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -123,7 +123,10 @@ struct sna_pixmap { #define SOURCE_BIAS 4 uint16_t source_count; - uint8_t pinned :1; + uint8_t pinned :3; +#define PIN_SCANOUT 0x1 +#define PIN_DRI 0x2 +#define PIN_PRIME 0x4 uint8_t mapped :1; uint8_t shm :1; uint8_t clear :1; @@ -542,7 +545,7 @@ static inline struct kgem_bo *sna_pixmap_get_bo(PixmapPtr pixmap) return sna_pixmap(pixmap)->gpu_bo; } -static inline struct kgem_bo *sna_pixmap_pin(PixmapPtr pixmap) +static inline struct kgem_bo *sna_pixmap_pin(PixmapPtr pixmap, unsigned flags) { struct sna_pixmap *priv; @@ -550,7 +553,7 @@ static inline struct kgem_bo *sna_pixmap_pin(PixmapPtr pixmap) if (!priv) return NULL; - priv->pinned = 1; + priv->pinned |= flags; return priv->gpu_bo; } -- cgit v1.2.3