sna: Add assertions for set/get binding

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-01-29 13:15:43 +00:00
parent 7df3da10e7
commit 971a5e64f5
1 changed files with 4 additions and 0 deletions

View 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;