aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/3085-drm-amdgpu-add-HDP-asic-callbacks-for-SI.patch
blob: 611a7bed2b0fc2f552be73ef7708ff8b9753afa4 (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
From 5f23952b33e1837f18080a33077a1400e72ae100 Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Wed, 6 Sep 2017 18:05:43 -0400
Subject: [PATCH 3085/4131] drm/amdgpu: add HDP asic callbacks for SI
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Needed to flush and invalidate the HDP block using the CPU.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Samuel Li <Samuel.Li@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/si.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index 3598151..44ead2d 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -1296,6 +1296,18 @@ static void si_set_pcie_lanes(struct amdgpu_device *adev, int lanes)
 	WREG32_PCIE_PORT(PCIE_LC_LINK_WIDTH_CNTL, link_width_cntl);
 }
 
+static void si_flush_hdp(struct amdgpu_device *adev)
+{
+	WREG32(mmHDP_MEM_COHERENCY_FLUSH_CNTL, 1);
+	RREG32(mmHDP_MEM_COHERENCY_FLUSH_CNTL);
+}
+
+static void si_invalidate_hdp(struct amdgpu_device *adev)
+{
+	WREG32(mmHDP_DEBUG0, 1);
+	RREG32(mmHDP_DEBUG0);
+}
+
 static const struct amdgpu_asic_funcs si_asic_funcs =
 {
 	.read_disabled_bios = &si_read_disabled_bios,
@@ -1309,6 +1321,8 @@ static const struct amdgpu_asic_funcs si_asic_funcs =
 	.get_pcie_lanes = &si_get_pcie_lanes,
 	.set_pcie_lanes = &si_set_pcie_lanes,
 	.get_config_memsize = &si_get_config_memsize,
+	.flush_hdp = &si_flush_hdp,
+	.invalidate_hdp = &si_invalidate_hdp,
 };
 
 static uint32_t si_get_rev_id(struct amdgpu_device *adev)
-- 
2.7.4