.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2014-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
24 | 24 | #include <linux/seq_file.h> |
---|
25 | 25 | #include <mali_kbase.h> |
---|
26 | 26 | #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) |
---|
29 | 28 | #include <mali_kbase_sync.h> |
---|
30 | 29 | #endif |
---|
31 | 30 | #include <uapi/gpu/arm/bifrost/mali_kbase_ioctl.h> |
---|
.. | .. |
---|
38 | 37 | static void kbase_jd_debugfs_fence_info(struct kbase_jd_atom *atom, |
---|
39 | 38 | struct seq_file *sfile) |
---|
40 | 39 | { |
---|
41 | | -#if defined(CONFIG_SYNC) || defined(CONFIG_SYNC_FILE) |
---|
| 40 | +#if IS_ENABLED(CONFIG_SYNC_FILE) |
---|
42 | 41 | struct kbase_sync_fence_info info; |
---|
43 | 42 | int res; |
---|
44 | 43 | |
---|
.. | .. |
---|
58 | 57 | default: |
---|
59 | 58 | break; |
---|
60 | 59 | } |
---|
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 */ |
---|
106 | 61 | } |
---|
107 | 62 | |
---|
108 | 63 | static void kbasep_jd_debugfs_atom_deps( |
---|
.. | .. |
---|
113 | 68 | int i; |
---|
114 | 69 | |
---|
115 | 70 | 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 ? |
---|
117 | 72 | kbase_jd_atom_id(kctx, atom->dep[i].atom) : 0); |
---|
118 | 73 | |
---|
119 | 74 | switch (atom->dep[i].dep_type) { |
---|
.. | .. |
---|
160 | 115 | BASE_UK_VERSION_MINOR); |
---|
161 | 116 | |
---|
162 | 117 | /* 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"); |
---|
164 | 119 | |
---|
165 | 120 | atoms = kctx->jctx.atoms; |
---|
166 | 121 | /* General atom states */ |
---|
.. | .. |
---|
180 | 135 | * it is valid |
---|
181 | 136 | */ |
---|
182 | 137 | 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)); |
---|
185 | 140 | |
---|
186 | 141 | kbasep_jd_debugfs_atom_deps(deps, atom); |
---|
187 | 142 | |
---|
.. | .. |
---|
226 | 181 | |
---|
227 | 182 | void kbasep_jd_debugfs_ctx_init(struct kbase_context *kctx) |
---|
228 | 183 | { |
---|
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; |
---|
234 | 185 | |
---|
235 | 186 | /* Caller already ensures this, but we keep the pattern for |
---|
236 | 187 | * maintenance safety. |
---|