Blob Blame History Raw
From: Ben Skeggs <bskeggs@redhat.com>
Date: Wed, 1 Nov 2017 03:56:19 +1000
Subject: drm/nouveau: remove explicit unmaps
Git-commit: 3a314f747ba5b4cca22a36603768c176d1761afd
Patch-mainline: v4.15-rc1
References: FATE#326289 FATE#326079 FATE#326049 FATE#322398 FATE#326166

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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/gpu/drm/nouveau/nouveau_bo.c  |    1 -
 drivers/gpu/drm/nouveau/nouveau_mem.c |   10 ++--------
 drivers/gpu/drm/nouveau/nouveau_vmm.c |    4 +---
 3 files changed, 3 insertions(+), 12 deletions(-)

--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1414,7 +1414,6 @@ nouveau_ttm_io_mem_free(struct ttm_bo_de
 	if (!mem->bar_vma.node)
 		return;
 
-	nvkm_vm_unmap(&mem->bar_vma);
 	nvkm_vm_put(&mem->bar_vma);
 }
 
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -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
--- a/drivers/gpu/drm/nouveau/nouveau_vmm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_vmm.c
@@ -61,10 +61,8 @@ nouveau_vma_del(struct nouveau_vma **pvm
 {
 	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);