diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-27 22:06:27 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-27 22:06:27 +0000 |
commit | 0fb7c366a58ec9b9cdc0b330e53716ab04b24c96 (patch) | |
tree | 9650210b9f67af5983eefd7420dc564f32097fa7 | |
parent | d65b57cd332ca4435867afa31b6da85481635d52 (diff) |
sna: Add a few more refcnt asserts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 13c5b425..d847f3fd 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -339,6 +339,7 @@ static inline void kgem_submit(struct kgem *kgem) static inline void kgem_bo_submit(struct kgem *kgem, struct kgem_bo *bo) { + assert(bo->refcnt); if (bo->exec) _kgem_submit(kgem); } @@ -515,6 +516,8 @@ static inline bool kgem_bo_blt_pitch_is_ok(struct kgem *kgem, static inline bool kgem_bo_can_blt(struct kgem *kgem, struct kgem_bo *bo) { + assert(bo->refcnt); + if (bo->tiling == I915_TILING_Y) { DBG(("%s: can not blt to handle=%d, tiling=Y\n", __FUNCTION__, bo->handle)); @@ -538,6 +541,7 @@ bool __kgem_busy(struct kgem *kgem, int handle); static inline void kgem_bo_mark_busy(struct kgem_bo *bo, int ring) { + assert(bo->refcnt); bo->rq = (struct kgem_request *)((uintptr_t)bo->rq | ring); } @@ -584,9 +588,11 @@ static inline bool kgem_bo_is_render(struct kgem_bo *bo) static inline void kgem_bo_mark_unreusable(struct kgem_bo *bo) { + assert(bo->refcnt); while (bo->proxy) { bo->flush = true; bo = bo->proxy; + assert(bo->refcnt); } bo->flush = true; bo->reusable = false; @@ -617,6 +623,8 @@ static inline void __kgem_bo_mark_dirty(struct kgem_bo *bo) DBG(("%s: handle=%d (proxy? %d)\n", __FUNCTION__, bo->handle, bo->proxy != NULL)); + assert(bo->refcnt); + bo->exec->flags |= LOCAL_EXEC_OBJECT_WRITE; bo->needs_flush = bo->gpu_dirty = true; list_move(&bo->request, &RQ(bo->rq)->buffers); @@ -671,6 +679,8 @@ static inline bool kgem_bo_can_map__cpu(struct kgem *kgem, struct kgem_bo *bo, bool write) { + assert(bo->refcnt); + if (bo->purged || (bo->scanout && write)) return false; |