[PATCH 1/2] drm/amdgpu: fix CPU based VM updates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That got accidentially removed.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index d75637f02ef4..155e6f915964 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -969,12 +969,16 @@ static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
 	entry->huge = true;
 	amdgpu_gmc_get_vm_pde(p->adev, AMDGPU_VM_PDB0, &dst, &flags);
 
-	if (parent->base.bo->shadow) {
-		pd_addr = amdgpu_bo_gpu_offset(parent->base.bo->shadow);
-		pde = pd_addr + (entry - parent->entries) * 8;
-		p->func(p, pde, dst, 1, 0, flags);
+	if (p->func == amdgpu_vm_cpu_set_ptes) {
+		pd_addr = (unsigned long)amdgpu_bo_kptr(parent->base.bo);
+	} else {
+		if (parent->base.bo->shadow) {
+			pd_addr = amdgpu_bo_gpu_offset(parent->base.bo->shadow);
+			pde = pd_addr + (entry - parent->entries) * 8;
+			p->func(p, pde, dst, 1, 0, flags);
+		}
+		pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 	}
-	pd_addr = amdgpu_bo_gpu_offset(parent->base.bo);
 	pde = pd_addr + (entry - parent->entries) * 8;
 	p->func(p, pde, dst, 1, 0, flags);
 }
-- 
2.14.1



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux