sna: Add assertions for set/get binding
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 29 Jan 2014 13:15:43 +0000 (13:15 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 29 Jan 2014 13:15:43 +0000 (13:15 +0000)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
src/sna/kgem.c

index 0c3e0b0..14a3f95 100644 (file)
@@ -6592,6 +6592,8 @@ uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format)
 {
        struct kgem_bo_binding *b;
 
+       assert(bo->refcnt);
+
        for (b = &bo->binding; b && b->offset; b = b->next)
                if (format == b->format)
                        return b->offset;
@@ -6603,6 +6605,8 @@ void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset)
 {
        struct kgem_bo_binding *b;
 
+       assert(bo->refcnt);
+
        for (b = &bo->binding; b; b = b->next) {
                if (b->offset)
                        continue;