diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2013-05-07 00:36:33 +0200 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2013-07-01 05:45:09 +0200 |
commit | 780194b1b9f5fdbaa06dd71e60b31ceaaedafbe4 (patch) | |
tree | 62430d6a1628c934454baae00a79ede867b1992d /drivers/gpu/drm/nouveau | |
parent | drm/nouveau/core: remove nouveau_mm.mutex, no more users (diff) | |
download | linux-780194b1b9f5fdbaa06dd71e60b31ceaaedafbe4.tar.xz linux-780194b1b9f5fdbaa06dd71e60b31ceaaedafbe4.zip |
drm/nouveau/vm: make each vma take a reference on its parent vm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/vm/base.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c index 6fc389163532..34d3fbfbd631 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/vm/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/vm/base.c @@ -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; @@ -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 |