summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-20 15:58:03 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-20 16:06:13 +0100
commitdd6c67b32f726b6ad7f12f3b83f6d8c868ff4dc1 (patch)
tree9ce8b83f61d923108ad9c7e4265eb1e82e764533 /src
parent01ebdb4d7a8bb751167153554f9122d996e4ea91 (diff)
sna: Add a couple of buffer cache management assertions
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/kgem.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index a3df628e..3cb9eb63 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1280,6 +1280,7 @@ inline static void kgem_bo_remove_from_inactive(struct kgem *kgem,
list_del(&bo->list);
assert(bo->rq == NULL);
+ assert(bo->exec == NULL);
if (bo->map) {
assert(!list_is_empty(&bo->vma));
list_del(&bo->vma);
@@ -1293,6 +1294,7 @@ inline static void kgem_bo_remove_from_active(struct kgem *kgem,
DBG(("%s: removing handle=%d from active\n", __FUNCTION__, bo->handle));
list_del(&bo->list);
+ assert(bo->rq != NULL);
if (bo->rq == &_kgem_static_request)
list_del(&bo->request);
assert(list_is_empty(&bo->vma));
@@ -1366,6 +1368,7 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
assert(bo->proxy == NULL);
assert(bo->tiling == I915_TILING_NONE);
assert(bo->rq == NULL);
+ assert(bo->exec == NULL);
if (num_pages > num_pages(bo))
continue;
@@ -1753,6 +1756,7 @@ static void kgem_commit(struct kgem *kgem)
(unsigned)bo->exec->offset));
assert(!bo->purged);
+ assert(bo->exec);
assert(bo->rq == rq || (bo->proxy->rq == rq));
bo->presumed_offset = bo->exec->offset;
@@ -2485,6 +2489,8 @@ search_linear_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags)
assert(IS_CPU_MAP(bo->map) == for_cpu);
assert(bucket(bo) == cache_bucket(num_pages));
assert(bo->proxy == NULL);
+ assert(bo->rq == NULL);
+ assert(bo->exec == NULL);
if (num_pages > num_pages(bo)) {
DBG(("inactive too small: %d < %d\n",