diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-23 10:40:58 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-23 10:41:22 +0000 |
commit | 013eda17e91ff421cd1ef70470e3575f1183fcbd (patch) | |
tree | d8f51ff1c6534ba0c8f22110add485a5e7caa358 | |
parent | 84d97bdba02b909369b54de21425ffc9f6ad581a (diff) |
sna: Free the additional bindings on proxies
-rw-r--r-- | src/sna/kgem.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 53f100ca..b74777ce 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -697,20 +697,25 @@ static void kgem_fixup_self_relocs(struct kgem *kgem, struct kgem_bo *bo) } } -static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo) +static void kgem_bo_binding_free(struct kgem *kgem, struct kgem_bo *bo) { struct kgem_bo_binding *b; - DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); - assert(bo->refcnt == 0); - assert(bo->exec == NULL); - b = bo->binding.next; while (b) { struct kgem_bo_binding *next = b->next; free (b); b = next; } +} + +static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo) +{ + DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); + assert(bo->refcnt == 0); + assert(bo->exec == NULL); + + kgem_bo_binding_free(kgem, bo); if (bo->map) { DBG(("%s: releasing %s vma for handle=%d, count=%d\n", @@ -1991,10 +1996,9 @@ skip_active_search: void _kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo) { if (bo->proxy) { - kgem_bo_unref(kgem, bo->proxy); - - assert(bo->binding.next == NULL); assert(bo->map == NULL); + kgem_bo_unref(kgem, bo->proxy); + kgem_bo_binding_free(kgem, bo); _list_del(&bo->request); free(bo); return; |