aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/1716-drm-amdgpu-handle-leaf-PDEs-as-PTEs-on-Vega.patch
blob: 9ae4404520436ceee841eaf47d2c990c37538f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 177fe475324cfde517f5ceb883da7b879fbe817b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
Date: Thu, 28 Mar 2019 13:51:23 +0100
Subject: [PATCH 1716/2940] drm/amdgpu: handle leaf PDEs as PTEs on Vega
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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: Chaudhary Amit Kumar <Chaudharyamit.Kumar@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 20 ++++++++++++++------
 1 file changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index c50ecc5175c3..a68d17cbf714 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -762,14 +762,22 @@ static int amdgpu_vm_clear_bo(struct amdgpu_device *adev,
 	}
 	
         if (entries) {
-                uint64_t value = 0;
+                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;
+                        }
+                }
 
-                /* Workaround for fault priority problem on GMC9 */
-                if (level == AMDGPU_VM_PTB &&
-                    adev->asic_type >= CHIP_VEGA10)
-                        value = AMDGPU_PTE_EXECUTABLE;
                 r = vm->update_funcs->update(&params, bo, addr, 0, entries,
-                                            0, value);
+						value, flags);
                 if (r)
                        return r;
         }
-- 
2.17.1