aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/1665-drm-amd-amdkfd-kcl-for-supporting-Rhel7.2.patch
blob: 92e8bfc59315205d38415ef71c60f7806fdc7734 (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
From df4800bfb5b6317ee6a17f61e773b1d2ff19132b Mon Sep 17 00:00:00 2001
From: Evan Quan <evan.quan@amd.com>
Date: Thu, 27 Apr 2017 11:32:21 +0800
Subject: [PATCH 1665/4131] drm/amd/amdkfd: kcl for supporting Rhel7.2

Change-Id: Ibec9699346b02357c9c684492f1ab346dff07b05
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c         | 6 ++++--
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c | 4 ++--
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c  | 4 ++--
 drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c  | 4 ++--
 drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c  | 2 +-
 5 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 68fa045..f394f05 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -853,7 +853,8 @@ static int kfd_ioctl_get_clock_counters(struct file *filep,
 {
 	struct kfd_ioctl_get_clock_counters_args *args = data;
 	struct kfd_dev *dev;
-#if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR == 6)
+#if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR == 6) \
+	|| (defined OS_NAME_RHEL_7_2)
 	struct timespec time;
 #else
 	struct timespec64 time;
@@ -869,7 +870,8 @@ static int kfd_ioctl_get_clock_counters(struct file *filep,
 		args->gpu_clock_counter = 0;
 
 	/* No access to rdtsc. Using raw monotonic time */
-#if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR == 6)
+#if (defined OS_NAME_RHEL) && (OS_VERSION_MAJOR == 6) \
+	|| (defined OS_NAME_RHEL_7_2)
 	getrawmonotonic(&time);
 	args->cpu_clock_counter = (uint64_t)timespec_to_ns(&time);
 
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c
index 27e62c3..a9e3681 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_cik.c
@@ -494,7 +494,7 @@ static int update_mqd_hiq(struct mqd_manager *mm, void *mqd,
 
 static int debugfs_show_mqd(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct cik_mqd), false);
 #endif
@@ -503,7 +503,7 @@ static int debugfs_show_mqd(struct seq_file *m, void *data)
 
 static int debugfs_show_mqd_sdma(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct cik_sdma_rlc_registers), false);
 #endif
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
index 191b98b..2f12e80 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c
@@ -436,7 +436,7 @@ static bool is_occupied_sdma(struct mqd_manager *mm, void *mqd,
 
 static int debugfs_show_mqd(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct v9_mqd), false);
 #endif
@@ -445,7 +445,7 @@ static int debugfs_show_mqd(struct seq_file *m, void *data)
 
 static int debugfs_show_mqd_sdma(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct v9_sdma_mqd), false);
 #endif
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
index 1957383..fb30623 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_vi.c
@@ -458,7 +458,7 @@ static bool is_occupied_sdma(struct mqd_manager *mm, void *mqd,
 
 static int debugfs_show_mqd(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct vi_mqd), false);
 #endif
@@ -467,7 +467,7 @@ static int debugfs_show_mqd(struct seq_file *m, void *data)
 
 static int debugfs_show_mqd_sdma(struct seq_file *m, void *data)
 {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "    ", DUMP_PREFIX_OFFSET, 32, 4,
 		     data, sizeof(struct vi_sdma_mqd), false);
 #endif
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
index 93ecb84..671b381 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c
@@ -403,7 +403,7 @@ int pm_debugfs_runlist(struct seq_file *m, void *data)
 		return 0;
 	}
 
-#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0)
+#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 0, 0) && !defined(OS_NAME_RHEL_7_2)
 	seq_hex_dump(m, "  ", DUMP_PREFIX_OFFSET, 32, 4,
 		     pm->ib_buffer_obj->cpu_ptr, pm->ib_size_bytes, false);
 #endif
-- 
2.7.4