summaryrefslogtreecommitdiff
path: root/src/sna/sna_accel.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-05 21:43:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-05 21:44:42 +0000
commite67aece46301ebb77d5fce7ac687a03713956fef (patch)
tree70278942f33dec45cf842875fe7ab94f4a257188 /src/sna/sna_accel.c
parentbc5f81901f1b4451e4187b97f65a8be4c03b2494 (diff)
sna: Assert that the pixmap is not pinned before releasing the GPU bo
Nothing suspicious in this set, just an extra dab of paranoia. 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 e12cb073..25b69c93 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2659,6 +2659,7 @@ sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box,
DBG(("%s: cached upload proxy, discard and revert to GPU\n",
__FUNCTION__));
assert(priv->gpu_damage == NULL);
+ assert(!priv->pinned);
kgem_bo_destroy(&to_sna_from_pixmap(pixmap)->kgem,
priv->gpu_bo);
priv->gpu_bo = NULL;
@@ -3100,6 +3101,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) {
DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
assert(priv->gpu_damage == NULL);
+ assert(!priv->pinned);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = NULL;
}
@@ -4274,6 +4276,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
if (region_subsumes_damage(region, dst_priv->cpu_damage)) {
DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
if (dst_priv->gpu_bo && dst_priv->gpu_bo->proxy) {
+ assert(!dst_priv->pinned);
kgem_bo_destroy(&sna->kgem, dst_priv->gpu_bo);
dst_priv->gpu_bo = NULL;
}
@@ -11815,6 +11818,7 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect)
DBG(("%s: discarding existing CPU damage\n", __FUNCTION__));
if (priv->gpu_bo && priv->gpu_bo->proxy) {
assert(priv->gpu_damage == NULL);
+ assert(!priv->pinned);
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
priv->gpu_bo = NULL;
}