aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2170-drm-amdgpu-gfx10-add-special-unmap_queues-packet-for.patch
blob: 10f204e7162305ff99bccb64854fb5b2ff6ac194 (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
59
60
61
62
63
From 24b156d5d6c234d9525bdb529144e5d10c357306 Mon Sep 17 00:00:00 2001
From: Jack Xiao <Jack.Xiao@amd.com>
Date: Tue, 8 Jan 2019 13:33:46 +0800
Subject: [PATCH 2170/2940] drm/amdgpu/gfx10: add special unmap_queues packet
 for preemption

CP introduced a special unmap_queues packet for gfx preemtion.

Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c |  3 ++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 11 ++++++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
index c793b6914957..0b595b63520b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
@@ -445,7 +445,8 @@ int amdgpu_gfx_disable_kcq(struct amdgpu_device *adev)
 		return -ENOMEM;
 
 	for (i = 0; i < adev->gfx.num_compute_rings; i++)
-		kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i], true);
+		kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.compute_ring[i],
+					   RESET_QUEUES, 0, 0);
 
 	return amdgpu_ring_test_ring(kiq_ring);
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
index 42730adbefcf..f96407ba9770 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
@@ -55,6 +55,13 @@ struct amdgpu_mec {
 	DECLARE_BITMAP(queue_bitmap, AMDGPU_MAX_COMPUTE_QUEUES);
 };
 
+enum amdgpu_unmap_queues_action {
+	PREEMPT_QUEUES = 0,
+	RESET_QUEUES,
+	DISABLE_PROCESS_QUEUES,
+	PREEMPT_QUEUES_NO_UNMAP,
+};
+
 struct kiq_pm4_funcs {
 	/* Support ASIC-specific kiq pm4 packets*/
 	void (*kiq_set_resources)(struct amdgpu_ring *kiq_ring,
@@ -62,7 +69,9 @@ struct kiq_pm4_funcs {
 	void (*kiq_map_queues)(struct amdgpu_ring *kiq_ring,
 					struct amdgpu_ring *ring);
 	void (*kiq_unmap_queues)(struct amdgpu_ring *kiq_ring,
-				 struct amdgpu_ring *ring, bool reset);
+				 struct amdgpu_ring *ring,
+				 enum amdgpu_unmap_queues_action action,
+				 u64 gpu_addr, u64 seq);
 	void (*kiq_query_status)(struct amdgpu_ring *kiq_ring,
 					struct amdgpu_ring *ring,
 					u64 addr,
-- 
2.17.1