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>
This commit is contained in:
Chris Wilson 2014-03-12 23:57:04 +00:00
parent 4368a74b1c
commit 202787ffa2
1 changed files with 3 additions and 0 deletions

View File

@ -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) {