summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-03-12 23:57:04 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-03-12 23:57:04 +0000
commit202787ffa2bae5b1455137a344dabb9d85ee3aa0 (patch)
tree1a170c6a0377cf5430832d207c0e59d6ae0dff47
parent4368a74b1c904625158f0b6baf98ef2a60bb54d4 (diff)
sna: Restore asserts that we do not map a freed buffer
The complication comes with stolen bo that we treat as purged (because they have no backing storage we can access) and so require an extra caveat. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 729573a9..063a1c43 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -5431,6 +5431,7 @@ void *kgem_bo_map__async(struct kgem *kgem, struct kgem_bo *bo)
assert(bo->proxy == NULL);
assert(list_is_empty(&bo->list));
assert_tiling(kgem, bo);
+ assert(!bo->purged || !bo->reusable);
if (bo->tiling == I915_TILING_NONE && !bo->scanout && kgem->has_llc) {
DBG(("%s: converting request for GTT map into CPU map\n",
@@ -5471,6 +5472,7 @@ void *kgem_bo_map(struct kgem *kgem, struct kgem_bo *bo)
assert(list_is_empty(&bo->list));
assert(bo->exec == NULL);
assert_tiling(kgem, bo);
+ assert(!bo->purged || !bo->reusable);
if (bo->tiling == I915_TILING_NONE && !bo->scanout &&
(kgem->has_llc || bo->domain == DOMAIN_CPU)) {
@@ -5536,6 +5538,7 @@ void *kgem_bo_map__gtt(struct kgem *kgem, struct kgem_bo *bo)
assert(bo->exec == NULL);
assert(list_is_empty(&bo->list));
assert_tiling(kgem, bo);
+ assert(!bo->purged || !bo->reusable);
ptr = MAP(bo->map__gtt);
if (ptr == NULL) {