diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-14 19:56:42 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-14 19:56:42 +0000 |
commit | 96ead26c4dddab637875c74a9afca6fd6662352b (patch) | |
tree | bec8646d65e8e8f30b790440509c9526df75ab5b | |
parent | 6a4ac18e37521d54dc36b215cbd27c56d20b2922 (diff) |
sna: Add a couple of asserts for inactive_partial reference counting
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 1 | ||||
-rw-r--r-- | src/sna/kgem.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 72751f33..761218fa 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1257,6 +1257,7 @@ static void kgem_retire_partials(struct kgem *kgem) kgem_bo_destroy(kgem, cached); } + assert(bo->base.refcnt > 0); if (bo->base.refcnt != 1) continue; diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 52e5e9c0..7e5ffacf 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -270,6 +270,7 @@ static inline void kgem_bo_flush(struct kgem *kgem, struct kgem_bo *bo) static inline struct kgem_bo *kgem_bo_reference(struct kgem_bo *bo) { + assert(bo->refcnt); bo->refcnt++; return bo; } |