sna: Free the additional bindings on proxies

This commit is contained in:
Chris Wilson 2011-12-23 10:40:58 +00:00
parent 84d97bdba0
commit 013eda17e9
1 changed files with 12 additions and 8 deletions

View File

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