summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/kgem.c10
-rw-r--r--src/sna/sna_accel.c2
-rw-r--r--src/sna/sna_display.c1
3 files changed, 9 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 8d3e9df7..538231f8 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1514,6 +1514,7 @@ inline static void kgem_bo_move_to_inactive(struct kgem *kgem,
assert(!bo->proxy);
assert(!bo->io);
assert(!bo->scanout);
+ assert(!bo->snoop);
assert(!bo->needs_flush);
assert(list_is_empty(&bo->vma));
ASSERT_IDLE(kgem, bo->handle);
@@ -1647,6 +1648,9 @@ static void kgem_bo_move_to_scanout(struct kgem *kgem, struct kgem_bo *bo)
static void kgem_bo_move_to_snoop(struct kgem *kgem, struct kgem_bo *bo)
{
+ assert(bo->reusable);
+ assert(!bo->flush);
+ assert(!bo->needs_flush);
assert(bo->refcnt == 0);
assert(bo->exec == NULL);
@@ -1738,14 +1742,12 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
if (bo->snoop && !bo->flush) {
DBG(("%s: handle=%d is snooped\n", __FUNCTION__, bo->handle));
- assert(!bo->flush);
+ assert(bo->reusable);
assert(list_is_empty(&bo->list));
if (bo->exec == NULL && bo->rq && !__kgem_busy(kgem, bo->handle))
__kgem_bo_clear_busy(bo);
- if (bo->rq == NULL) {
- assert(!bo->needs_flush);
+ if (bo->rq == NULL)
kgem_bo_move_to_snoop(kgem, bo);
- }
return;
}
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index ead4692b..ea7dc7a7 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4463,6 +4463,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
box, n, COPY_LAST);
kgem_bo_sync__cpu(&sna->kgem, src_bo);
+ assert(src_bo->rq == NULL);
kgem_bo_destroy(&sna->kgem, src_bo);
}
@@ -13534,6 +13535,7 @@ sna_get_image_blt(DrawablePtr drawable,
COPY_LAST);
kgem_bo_sync__cpu(&sna->kgem, dst_bo);
+ assert(dst_bo->rq == NULL);
kgem_bo_destroy(&sna->kgem, dst_bo);
}
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 5d14af73..a80a3c16 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -136,6 +136,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
assert(bo->refcnt);
assert(bo->proxy == NULL);
+ assert(!bo->snoop);
if (bo->delta) {
DBG(("%s: reusing fb=%d for handle=%d\n",
__FUNCTION__, bo->delta, bo->handle));