hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/drivers/gpu/arm/bifrost/mali_kbase_jd_debugfs.c
....@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 /*
33 *
4
- * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2014-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -24,8 +24,7 @@
2424 #include <linux/seq_file.h>
2525 #include <mali_kbase.h>
2626 #include <mali_kbase_jd_debugfs.h>
27
-#include <mali_kbase_dma_fence.h>
28
-#if defined(CONFIG_SYNC) || defined(CONFIG_SYNC_FILE)
27
+#if IS_ENABLED(CONFIG_SYNC_FILE)
2928 #include <mali_kbase_sync.h>
3029 #endif
3130 #include <uapi/gpu/arm/bifrost/mali_kbase_ioctl.h>
....@@ -38,7 +37,7 @@
3837 static void kbase_jd_debugfs_fence_info(struct kbase_jd_atom *atom,
3938 struct seq_file *sfile)
4039 {
41
-#if defined(CONFIG_SYNC) || defined(CONFIG_SYNC_FILE)
40
+#if IS_ENABLED(CONFIG_SYNC_FILE)
4241 struct kbase_sync_fence_info info;
4342 int res;
4443
....@@ -58,51 +57,7 @@
5857 default:
5958 break;
6059 }
61
-#endif /* CONFIG_SYNC || CONFIG_SYNC_FILE */
62
-
63
-#ifdef CONFIG_MALI_BIFROST_DMA_FENCE
64
- if (atom->core_req & BASE_JD_REQ_EXTERNAL_RESOURCES) {
65
- struct kbase_fence_cb *cb;
66
-
67
- if (atom->dma_fence.fence) {
68
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
69
- struct fence *fence = atom->dma_fence.fence;
70
-#else
71
- struct dma_fence *fence = atom->dma_fence.fence;
72
-#endif
73
-
74
- seq_printf(sfile,
75
-#if (KERNEL_VERSION(4, 8, 0) > LINUX_VERSION_CODE)
76
- "Sd(%u#%u: %s) ",
77
-#else
78
- "Sd(%llu#%u: %s) ",
79
-#endif
80
- fence->context, fence->seqno,
81
- dma_fence_is_signaled(fence) ? "signaled" :
82
- "active");
83
- }
84
-
85
- list_for_each_entry(cb, &atom->dma_fence.callbacks,
86
- node) {
87
-#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
88
- struct fence *fence = cb->fence;
89
-#else
90
- struct dma_fence *fence = cb->fence;
91
-#endif
92
-
93
- seq_printf(sfile,
94
-#if (KERNEL_VERSION(4, 8, 0) > LINUX_VERSION_CODE)
95
- "Wd(%u#%u: %s) ",
96
-#else
97
- "Wd(%llu#%u: %s) ",
98
-#endif
99
- fence->context, fence->seqno,
100
- dma_fence_is_signaled(fence) ? "signaled" :
101
- "active");
102
- }
103
- }
104
-#endif /* CONFIG_MALI_BIFROST_DMA_FENCE */
105
-
60
+#endif /* CONFIG_SYNC_FILE */
10661 }
10762
10863 static void kbasep_jd_debugfs_atom_deps(
....@@ -113,7 +68,7 @@
11368 int i;
11469
11570 for (i = 0; i < 2; i++) {
116
- deps[i].id = (unsigned)(atom->dep[i].atom ?
71
+ deps[i].id = (unsigned int)(atom->dep[i].atom ?
11772 kbase_jd_atom_id(kctx, atom->dep[i].atom) : 0);
11873
11974 switch (atom->dep[i].dep_type) {
....@@ -160,7 +115,7 @@
160115 BASE_UK_VERSION_MINOR);
161116
162117 /* Print table heading */
163
- seq_puts(sfile, " ID, Core req, St, CR, Predeps, Start time, Additional info...\n");
118
+ seq_puts(sfile, " ID, Core req, St, Predeps, Start time, Additional info...\n");
164119
165120 atoms = kctx->jctx.atoms;
166121 /* General atom states */
....@@ -180,8 +135,8 @@
180135 * it is valid
181136 */
182137 if (ktime_to_ns(atom->start_timestamp))
183
- start_timestamp = ktime_to_ns(
184
- ktime_sub(ktime_get(), atom->start_timestamp));
138
+ start_timestamp =
139
+ ktime_to_ns(ktime_sub(ktime_get_raw(), atom->start_timestamp));
185140
186141 kbasep_jd_debugfs_atom_deps(deps, atom);
187142
....@@ -226,11 +181,7 @@
226181
227182 void kbasep_jd_debugfs_ctx_init(struct kbase_context *kctx)
228183 {
229
-#if (KERNEL_VERSION(4, 7, 0) <= LINUX_VERSION_CODE)
230
- const mode_t mode = S_IRUGO;
231
-#else
232
- const mode_t mode = S_IRUSR;
233
-#endif
184
+ const mode_t mode = 0444;
234185
235186 /* Caller already ensures this, but we keep the pattern for
236187 * maintenance safety.