From 202787ffa2bae5b1455137a344dabb9d85ee3aa0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 12 Mar 2014 23:57:04 +0000 Subject: [PATCH] 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 --- src/sna/kgem.c | 3 +++ 1 file changed, 3 insertions(+) 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) {