aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1215-drm-amdkfd-Use-volatile-MTYPE-in-default-alternate-a.patch
blob: 2a242f50996fc11d402f5a9efaa4b90922415aa8 (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
54
55
56
57
58
From 065b7272ee5cb46cf6ec116dce424d072a99b9f4 Mon Sep 17 00:00:00 2001
From: Jay Cornwall <Jay.Cornwall@amd.com>
Date: Tue, 17 Jan 2017 12:08:50 -0600
Subject: [PATCH 1215/4131] drm/amdkfd: Use volatile MTYPE in default/alternate
 apertures

MTYPE_NC_NV (0) marks scalar/vector L1 cache lines as non-volatile.
Cache lines loaded through these apertures are intended to be
invalidated before (and sometimes during) a dispatch. The non-volatile
qualifier prevents these cache lines from being distinguished from
those loaded through the private aperture.

Use MTYPE_NC (1) instead on both Gfx7 and Gfx8. This allows the
compiler to use the BUFFER_WBINVL1_VOL instruction and is a precursor
to automatic per-dispatch scalar/vector L1 volatile invalidation.

Change-Id: Ic366945bfa50034935adf42009ea70cb1fce99c3
Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/cik_regs.h                    | 3 ++-
 drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/cik_regs.h b/drivers/gpu/drm/amd/amdkfd/cik_regs.h
index 607fc5c..8c707dc 100644
--- a/drivers/gpu/drm/amd/amdkfd/cik_regs.h
+++ b/drivers/gpu/drm/amd/amdkfd/cik_regs.h
@@ -55,7 +55,8 @@
 #define	APE1_MTYPE(x)					((x) << 7)
 
 /* valid for both DEFAULT_MTYPE and APE1_MTYPE */
-#define	MTYPE_CACHED					0
+#define	MTYPE_CACHED_NV					0
+#define	MTYPE_CACHED					1
 #define	MTYPE_NONCACHED					3
 
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
index abd71c6..2629143 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
@@ -142,11 +142,11 @@ static bool set_cache_memory_policy_vi_tonga(struct device_queue_manager *dqm,
 
 	default_mtype = (default_policy == cache_policy_coherent) ?
 			MTYPE_UC :
-			MTYPE_NC_NV;
+			MTYPE_NC;
 
 	ape1_mtype = (alternate_policy == cache_policy_coherent) ?
 			MTYPE_UC :
-			MTYPE_NC_NV;
+			MTYPE_NC;
 
 	qpd->sh_mem_config =
 			SH_MEM_ALIGNMENT_MODE_UNALIGNED <<
-- 
2.7.4