summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-03-14 09:42:37 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-03-14 10:12:46 +0000
commit92023f39a9c8897e5a978f44b7970773b118f628 (patch)
tree5a713f7d2c2f18c085132b5cbda3084743c129f0
parent80401f4fe54142c16ea7578b587529610b68cb67 (diff)
sna: Add a few more assertions to track userptr through the caches
i.e. make sure they don't end up in any caches. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-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));