summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2017-10-31 20:56:19 +0300
committerBen Skeggs <bskeggs@redhat.com>2017-11-02 06:32:27 +0300
commitd30af7ce2c96e57b503da1d70454818331f0a6d5 (patch)
tree348c34ff605a635601515d83aab8b6ddd54c1d62 /drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
parentaf3b8d53869c175fce424b6bfd1f49c1b53baef1 (diff)
downloadlinux-d30af7ce2c96e57b503da1d70454818331f0a6d5.tar.xz
drm/nouveau/mmu: handle instance block setup
We previously required each VMM user to allocate their own page directory and fill in the instance block themselves. It makes more sense to handle this in a common location. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
index 25b60aff40e4..161aa9ec73bc 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/channv50.c
@@ -206,7 +206,8 @@ void *
nv50_fifo_chan_dtor(struct nvkm_fifo_chan *base)
{
struct nv50_fifo_chan *chan = nv50_fifo_chan(base);
- nvkm_vm_ref(NULL, &chan->vm, chan->pgd);
+ if (chan->base.inst)
+ nvkm_vm_ref(NULL, &chan->vm, chan->base.inst->memory);
nvkm_ramht_del(&chan->ramht);
nvkm_gpuobj_del(&chan->pgd);
nvkm_gpuobj_del(&chan->eng);
@@ -266,5 +267,5 @@ nv50_fifo_chan_ctor(struct nv50_fifo *fifo, u64 vm, u64 push,
if (ret)
return ret;
- return nvkm_vm_ref(chan->base.vm, &chan->vm, chan->pgd);
+ return nvkm_vm_ref(chan->base.vm, &chan->vm, chan->base.inst->memory);
}