drm/amdgpu: handle leaf PDEs as PTEs on Vega
authorChristian König <christian.koenig@amd.com>
Thu, 28 Mar 2019 12:51:23 +0000 (13:51 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Apr 2019 15:00:30 +0000 (10:00 -0500)
This way we get retry faults for missing PDs.

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 eb8a5064eadf22cb35a6df4ed25516568e5d5152..fc7236af6a41a49a0fcc334185b3c80941f89033 100644 (file)
@@ -787,15 +787,22 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
        }
 
        if (entries) {
-               uint64_t value = 0;
-
-               /* Workaround for fault priority problem on GMC9 */
-               if (level == AMDGPU_VM_PTB &&
-                   adev->asic_type >= CHIP_VEGA10)
-                       value = AMDGPU_PTE_EXECUTABLE;
+               uint64_t value = 0, flags = 0;
+
+               if (adev->asic_type >= CHIP_VEGA10) {
+                       if (level != AMDGPU_VM_PTB) {
+                               /* Handle leaf PDEs as PTEs */
+                               flags |= AMDGPU_PDE_PTE;
+                               amdgpu_gmc_get_vm_pde(adev, level,
+                                                     &value, &flags);
+                       } else {
+                               /* Workaround for fault priority problem on GMC9 */
+                               flags = AMDGPU_PTE_EXECUTABLE;
+                       }
+               }
 
                r = vm->update_funcs->update(&params, bo, addr, 0, entries,
-                                            0, value);
+                                            value, flags);
                if (r)
                        return r;
        }