drm/nouveau: remove explicit unmaps
authorBen Skeggs <bskeggs@redhat.com>
Tue, 31 Oct 2017 17:56:19 +0000 (03:56 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Thu, 2 Nov 2017 03:32:31 +0000 (13:32 +1000)
If the VMA is being deleted, we don't need to explicity unmap first
anymore.  The MMU code will automatically merge the operations into
a single page tree walk.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/nouveau/nouveau_mem.c
drivers/gpu/drm/nouveau/nouveau_vmm.c

index d89f3e700bafa5f0ac5004992961bda61a93b01b..f4545773756a342d28f73d22cb140f204106dcf0 100644 (file)
@@ -1414,7 +1414,6 @@ nouveau_ttm_io_mem_free(struct ttm_bo_device *bdev, struct ttm_mem_reg *reg)
        if (!mem->bar_vma.node)
                return;
 
-       nvkm_vm_unmap(&mem->bar_vma);
        nvkm_vm_put(&mem->bar_vma);
 }
 
index 70fbe5e72b55c7c4d3e43b7077cf7c216598622f..17c6efb0ebec223fe36683adbbea4dbcb66427c7 100644 (file)
@@ -36,14 +36,8 @@ nouveau_mem_map(struct nouveau_mem *mem,
 void
 nouveau_mem_fini(struct nouveau_mem *mem)
 {
-       if (mem->vma[1].node) {
-               nvkm_vm_unmap(&mem->vma[1]);
-               nvkm_vm_put(&mem->vma[1]);
-       }
-       if (mem->vma[0].node) {
-               nvkm_vm_unmap(&mem->vma[0]);
-               nvkm_vm_put(&mem->vma[0]);
-       }
+       nvkm_vm_put(&mem->vma[1]);
+       nvkm_vm_put(&mem->vma[0]);
 }
 
 int
index 855d549e17cf9e3d0af0dbb8a3d6090e81dc8a49..6dc14f92b988274678a6c4e6b0fdb9d096f01452 100644 (file)
@@ -61,10 +61,8 @@ nouveau_vma_del(struct nouveau_vma **pvma)
 {
        struct nouveau_vma *vma = *pvma;
        if (vma && --vma->refs <= 0) {
-               if (likely(vma->addr != ~0ULL)) {
-                       nouveau_vma_unmap(vma);
+               if (likely(vma->addr != ~0ULL))
                        nvkm_vm_put(&vma->_vma);
-               }
                list_del(&vma->head);
                *pvma = NULL;
                kfree(*pvma);