summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-29 13:15:43 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-29 13:15:43 +0000
commit971a5e64f574f09ef43bcca9e0bd02cb0e42aa03 (patch)
tree15af4d64a46e899cf902b7eeaf464501ee218588 /src/sna/kgem.c
parent7df3da10e744d7f168ea3f30b21c434f99beae17 (diff)
sna: Add assertions for set/get binding
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 0c3e0b08..14a3f952 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -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;