aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/3312-drm-amd-Add-gpu-reset-interfaces-between-amdgpu-and-.patch
blob: 50ec22ece7a68620d8bbbab145e4565e34a54cd3 (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
From e544e75870ab7fa30541a1eb54a7c0dbcf66ef1b Mon Sep 17 00:00:00 2001
From: Shaoyun Liu <Shaoyun.Liu@amd.com>
Date: Fri, 26 Jan 2018 12:12:47 -0500
Subject: [PATCH 3312/4131] drm/amd: Add gpu reset interfaces between amdgpu
 and amdkfd

Change-Id: Iea06a637aed3c19515ba7aaf117e0ae2a8b6ac66
Signed-off-by: Shaoyun Liu <Shaoyun.Liu@amd.com>
---
 drivers/gpu/drm/amd/include/kgd_kfd_interface.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
index 1da5b4f..4dcc7d0 100644
--- a/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_kfd_interface.h
@@ -248,6 +248,8 @@ struct tile_config {
  *
  * @get_vram_usage: Returns current VRAM usage
  *
+ * @gpu_recover: let kgd reset gpu after kfd detect CPC hang
+ *
  * This structure contains function pointers to services that the kgd driver
  * provides to amdkfd driver.
  *
@@ -406,6 +408,8 @@ struct kfd2kgd_calls {
 			uint64_t dest_offset, uint64_t size,
 			struct dma_fence **f, uint64_t *actual_size);
 	uint64_t (*get_vram_usage)(struct kgd_dev *kgd);
+
+	void (*gpu_recover)(struct kgd_dev *kgd);
 };
 
 /**
@@ -431,6 +435,10 @@ struct kfd2kgd_calls {
  * @schedule_evict_and_restore_process: Schedules work queue that will prepare
  * for safe eviction of KFD BOs that belong to the specified process.
  *
+ * @pre_reset: Notifies amdkfd that amdgpu about to reset the gpu
+ *
+ * @post_reset: Notify amdkfd that amgpu successfuly reseted the gpu
+ *
  * This structure contains function callback pointers so the kgd driver
  * will notify to the amdkfd about certain status changes.
  *
@@ -449,6 +457,8 @@ struct kgd2kfd_calls {
 	int (*resume_mm)(struct kfd_dev *kfd, struct mm_struct *mm);
 	int (*schedule_evict_and_restore_process)(struct mm_struct *mm,
 			struct dma_fence *fence);
+	int  (*pre_reset)(struct kfd_dev *kfd);
+	int  (*post_reset)(struct kfd_dev *kfd);
 };
 
 int kgd2kfd_init(unsigned interface_version,
-- 
2.7.4