From bfabdb7ebf5e491da1e74f8b362f9c2f0b6f1ac5 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 9 Jan 2014 12:34:58 +0000 Subject: [PATCH] sna: Add regular refcnt checks on pixmap bo References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f1be82a..926365a 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) -- 2.7.4