summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-09 12:34:58 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-09 12:35:51 +0000
commitbfabdb7ebf5e491da1e74f8b362f9c2f0b6f1ac5 (patch)
treebc37f009ad101bd91c513ff725fc2b617b22950c /src/sna/sna_accel.c
parenta2fc9e5f86096dbc2461eaf7e5ad5cf071f8d472 (diff)
sna: Add regular refcnt checks on pixmap bo
References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r--src/sna/sna_accel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index f1be82a2..926365a6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -343,6 +343,8 @@ static void assert_pixmap_damage(PixmapPtr p)
return;
assert(priv->gpu_damage == NULL || priv->gpu_bo);
+ assert(priv->gpu_bo == NULL || priv->gpu_bo->refcnt);
+ assert(priv->cpu_bo == NULL || priv->cpu_bo->refcnt);
assert_pixmap_map(p, priv);
if (priv->clear) {
@@ -395,6 +397,8 @@ static void assert_pixmap_damage(PixmapPtr p)
#define assert_pixmap_damage(p) do { \
struct sna_pixmap *priv__ = sna_pixmap(p); \
assert(priv__ == NULL || priv__->gpu_damage == NULL || priv__->gpu_bo); \
+ assert(priv__ == NULL || priv__->gpu_bo == NULL || priv__->gpu_bo->refcnt); \
+ assert(priv__ == NULL || priv__->cpu_bo == NULL || priv__->cpu_bo->refcnt); \
} while (0)
#else
#define assert_pixmap_damage(p)