Skip to content

Commit

Permalink
drm/nouveau/vm: make each vma take a reference on its parent vm
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Jul 1, 2013
1 parent 51a506c commit 780194b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/gpu/drm/nouveau/core/subdev/vm/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ nouveau_vm_get(struct nouveau_vm *vm, u64 size, u32 page_shift,
}
mutex_unlock(&nv_subdev(vmm)->mutex);

vma->vm = vm;
vma->vm = NULL;
nouveau_vm_ref(vm, &vma->vm, NULL);
vma->offset = (u64)vma->node->offset << 12;
vma->access = access;
return 0;
Expand All @@ -342,6 +343,8 @@ nouveau_vm_put(struct nouveau_vma *vma)
nouveau_vm_unmap_pgt(vm, vma->node->type != vmm->spg_shift, fpde, lpde);
nouveau_mm_free(&vm->mm, &vma->node);
mutex_unlock(&nv_subdev(vmm)->mutex);

nouveau_vm_ref(NULL, &vma->vm, NULL);
}

int
Expand Down

0 comments on commit 780194b

Please sign in to comment.