drm/amdgpu: fix CPU based VM updates
authorChristian König <christian.koenig@amd.com>
Tue, 16 Jan 2018 14:35:10 +0000 (15:35 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 16 Jan 2018 20:35:27 +0000 (15:35 -0500)
That got accidentially removed.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index 9e266307ce633725fb0f87ff34828b86e04b5edc..6fc16eecf2dce5fc448afaa1681fbb086259ea35 100644 (file)
@@ -970,12 +970,16 @@ static void amdgpu_vm_handle_huge_pages(struct amdgpu_pte_update_params *p,
        amdgpu_gart_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);
 }