.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2018-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2018-2023 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 |
---|
.. | .. |
---|
26 | 26 | #include "mali_kbase_csf_scheduler.h" |
---|
27 | 27 | #include "mali_kbase_csf_firmware.h" |
---|
28 | 28 | #include "mali_kbase_csf_protected_memory.h" |
---|
| 29 | +#include "mali_kbase_hwaccess_time.h" |
---|
29 | 30 | |
---|
30 | 31 | /* Indicate invalid CS h/w interface |
---|
31 | 32 | */ |
---|
.. | .. |
---|
39 | 40 | */ |
---|
40 | 41 | #define KBASEP_USER_DB_NR_INVALID ((s8)-1) |
---|
41 | 42 | |
---|
42 | | -#define FIRMWARE_PING_INTERVAL_MS (4000) /* 4 seconds */ |
---|
| 43 | +/* Number of pages used for GPU command queue's User input & output data */ |
---|
| 44 | +#define KBASEP_NUM_CS_USER_IO_PAGES (2) |
---|
43 | 45 | |
---|
44 | | -#define FIRMWARE_IDLE_HYSTERESIS_TIME_MS (10) /* Default 10 milliseconds */ |
---|
45 | | - |
---|
46 | | -/** |
---|
47 | | - * enum kbase_csf_event_callback_action - return type for CSF event callbacks. |
---|
48 | | - * |
---|
49 | | - * @KBASE_CSF_EVENT_CALLBACK_FIRST: Never set explicitly. |
---|
50 | | - * It doesn't correspond to any action or type of event callback. |
---|
51 | | - * |
---|
52 | | - * @KBASE_CSF_EVENT_CALLBACK_KEEP: The callback will remain registered. |
---|
53 | | - * |
---|
54 | | - * @KBASE_CSF_EVENT_CALLBACK_REMOVE: The callback will be removed |
---|
55 | | - * immediately upon return. |
---|
56 | | - * |
---|
57 | | - * @KBASE_CSF_EVENT_CALLBACK_LAST: Never set explicitly. |
---|
58 | | - * It doesn't correspond to any action or type of event callback. |
---|
| 46 | +/* Indicates an invalid value for the scan out sequence number, used to |
---|
| 47 | + * signify there is no group that has protected mode execution pending. |
---|
59 | 48 | */ |
---|
60 | | -enum kbase_csf_event_callback_action { |
---|
61 | | - KBASE_CSF_EVENT_CALLBACK_FIRST = 0, |
---|
62 | | - KBASE_CSF_EVENT_CALLBACK_KEEP, |
---|
63 | | - KBASE_CSF_EVENT_CALLBACK_REMOVE, |
---|
64 | | - KBASE_CSF_EVENT_CALLBACK_LAST, |
---|
65 | | -}; |
---|
| 49 | +#define KBASEP_TICK_PROTM_PEND_SCAN_SEQ_NR_INVALID (U32_MAX) |
---|
66 | 50 | |
---|
67 | | -/** |
---|
68 | | - * kbase_csf_event_callback_action - type for callback functions to be |
---|
69 | | - * called upon CSF events. |
---|
70 | | - * |
---|
71 | | - * This is the type of callback functions that can be registered |
---|
72 | | - * for CSF events. These function calls shall be triggered by any call |
---|
73 | | - * to kbase_csf_event_signal. |
---|
74 | | - * |
---|
75 | | - * @param: Generic parameter to pass to the callback function. |
---|
76 | | - * |
---|
77 | | - * Return: KBASE_CSF_EVENT_CALLBACK_KEEP if the callback should remain |
---|
78 | | - * registered, or KBASE_CSF_EVENT_CALLBACK_REMOVE if it should be removed. |
---|
79 | | - */ |
---|
80 | | -typedef enum kbase_csf_event_callback_action kbase_csf_event_callback(void *param); |
---|
| 51 | +#define FIRMWARE_IDLE_HYSTERESIS_TIME_USEC (10000) /* Default 10 milliseconds */ |
---|
81 | 52 | |
---|
82 | | -/** |
---|
83 | | - * kbase_csf_event_wait_add - Add a CSF event callback |
---|
84 | | - * |
---|
85 | | - * This function adds an event callback to the list of CSF event callbacks |
---|
86 | | - * belonging to a given Kbase context, to be triggered when a CSF event is |
---|
87 | | - * signalled by kbase_csf_event_signal. |
---|
88 | | - * |
---|
89 | | - * @kctx: The Kbase context the @callback should be registered to. |
---|
90 | | - * @callback: The callback function to register. |
---|
91 | | - * @param: Custom parameter to be passed to the @callback function. |
---|
92 | | - * |
---|
93 | | - * Return: 0 on success, or negative on failure. |
---|
94 | | - */ |
---|
95 | | -int kbase_csf_event_wait_add(struct kbase_context *kctx, |
---|
96 | | - kbase_csf_event_callback *callback, void *param); |
---|
97 | | - |
---|
98 | | -/** |
---|
99 | | - * kbase_csf_event_wait_remove - Remove a CSF event callback |
---|
100 | | - * |
---|
101 | | - * This function removes an event callback from the list of CSF event callbacks |
---|
102 | | - * belonging to a given Kbase context. |
---|
103 | | - * |
---|
104 | | - * @kctx: The kbase context the @callback should be removed from. |
---|
105 | | - * @callback: The callback function to remove. |
---|
106 | | - * @param: Custom parameter that would have been passed to the @p callback |
---|
107 | | - * function. |
---|
108 | | - */ |
---|
109 | | -void kbase_csf_event_wait_remove(struct kbase_context *kctx, |
---|
110 | | - kbase_csf_event_callback *callback, void *param); |
---|
111 | | - |
---|
112 | | -/** |
---|
113 | | - * kbase_csf_event_wait_remove_all - Removes all CSF event callbacks |
---|
114 | | - * |
---|
115 | | - * This function empties the list of CSF event callbacks belonging to a given |
---|
116 | | - * Kbase context. |
---|
117 | | - * |
---|
118 | | - * @kctx: The kbase context for which CSF event callbacks have to be removed. |
---|
119 | | - */ |
---|
120 | | -void kbase_csf_event_wait_remove_all(struct kbase_context *kctx); |
---|
121 | | - |
---|
122 | | -/** |
---|
123 | | - * kbase_csf_read_error - Read CS fatal error |
---|
124 | | - * |
---|
125 | | - * This function takes the CS fatal error from context's ordered |
---|
126 | | - * error_list, copies its contents to @event_data. |
---|
127 | | - * |
---|
128 | | - * @kctx: The kbase context to read fatal error from |
---|
129 | | - * @event_data: Caller-provided buffer to copy the fatal error to |
---|
130 | | - * |
---|
131 | | - * Return: true if fatal error is read successfully. |
---|
132 | | - */ |
---|
133 | | -bool kbase_csf_read_error(struct kbase_context *kctx, |
---|
134 | | - struct base_csf_notification *event_data); |
---|
135 | | - |
---|
136 | | -/** |
---|
137 | | - * kbase_csf_error_pending - Check whether fatal error is pending |
---|
138 | | - * |
---|
139 | | - * @kctx: The kbase context to check fatal error upon. |
---|
140 | | - * |
---|
141 | | - * Return: true if fatal error is pending. |
---|
142 | | - */ |
---|
143 | | -bool kbase_csf_error_pending(struct kbase_context *kctx); |
---|
144 | | - |
---|
145 | | -/** |
---|
146 | | - * kbase_csf_event_signal - Signal a CSF event |
---|
147 | | - * |
---|
148 | | - * This function triggers all the CSF event callbacks that are registered to |
---|
149 | | - * a given Kbase context, and also signals the event handling thread of |
---|
150 | | - * userspace driver waiting for the CSF event. |
---|
151 | | - * |
---|
152 | | - * @kctx: The kbase context whose CSF event callbacks shall be triggered. |
---|
153 | | - * @notify_gpu: Flag to indicate if CSF firmware should be notified of the |
---|
154 | | - * signaling of event that happened on the Driver side, either |
---|
155 | | - * the signal came from userspace or from kcpu queues. |
---|
156 | | - */ |
---|
157 | | -void kbase_csf_event_signal(struct kbase_context *kctx, bool notify_gpu); |
---|
158 | | - |
---|
159 | | -static inline void kbase_csf_event_signal_notify_gpu(struct kbase_context *kctx) |
---|
160 | | -{ |
---|
161 | | - kbase_csf_event_signal(kctx, true); |
---|
162 | | -} |
---|
163 | | - |
---|
164 | | -static inline void kbase_csf_event_signal_cpu_only(struct kbase_context *kctx) |
---|
165 | | -{ |
---|
166 | | - kbase_csf_event_signal(kctx, false); |
---|
167 | | -} |
---|
| 53 | +/* Idle hysteresis time can be scaled down when GPU sleep feature is used */ |
---|
| 54 | +#define FIRMWARE_IDLE_HYSTERESIS_GPU_SLEEP_SCALER (5) |
---|
168 | 55 | |
---|
169 | 56 | /** |
---|
170 | 57 | * kbase_csf_ctx_init - Initialize the CSF interface for a GPU address space. |
---|
.. | .. |
---|
179 | 66 | * kbase_csf_ctx_handle_fault - Terminate queue groups & notify fault upon |
---|
180 | 67 | * GPU bus fault, MMU page fault or similar. |
---|
181 | 68 | * |
---|
182 | | - * This function terminates all GPU command queue groups in the context and |
---|
183 | | - * notifies the event notification thread of the fault. |
---|
184 | | - * |
---|
185 | 69 | * @kctx: Pointer to faulty kbase context. |
---|
186 | 70 | * @fault: Pointer to the fault. |
---|
| 71 | + * |
---|
| 72 | + * This function terminates all GPU command queue groups in the context and |
---|
| 73 | + * notifies the event notification thread of the fault. |
---|
187 | 74 | */ |
---|
188 | 75 | void kbase_csf_ctx_handle_fault(struct kbase_context *kctx, |
---|
189 | 76 | struct kbase_fault *fault); |
---|
.. | .. |
---|
191 | 78 | /** |
---|
192 | 79 | * kbase_csf_ctx_term - Terminate the CSF interface for a GPU address space. |
---|
193 | 80 | * |
---|
| 81 | + * @kctx: Pointer to the kbase context which is being terminated. |
---|
| 82 | + * |
---|
194 | 83 | * This function terminates any remaining CSGs and CSs which weren't destroyed |
---|
195 | 84 | * before context termination. |
---|
196 | | - * |
---|
197 | | - * @kctx: Pointer to the kbase context which is being terminated. |
---|
198 | 85 | */ |
---|
199 | 86 | void kbase_csf_ctx_term(struct kbase_context *kctx); |
---|
200 | 87 | |
---|
.. | .. |
---|
240 | 127 | struct kbase_ioctl_cs_queue_terminate *term); |
---|
241 | 128 | |
---|
242 | 129 | /** |
---|
| 130 | + * kbase_csf_free_command_stream_user_pages() - Free the resources allocated |
---|
| 131 | + * for a queue at the time of bind. |
---|
| 132 | + * |
---|
| 133 | + * @kctx: Address of the kbase context within which the queue was created. |
---|
| 134 | + * @queue: Pointer to the queue to be unlinked. |
---|
| 135 | + * |
---|
| 136 | + * This function will free the pair of physical pages allocated for a GPU |
---|
| 137 | + * command queue, and also release the hardware doorbell page, that were mapped |
---|
| 138 | + * into the process address space to enable direct submission of commands to |
---|
| 139 | + * the hardware. Also releases the reference taken on the queue when the mapping |
---|
| 140 | + * was created. |
---|
| 141 | + * |
---|
| 142 | + * If an explicit or implicit unbind was missed by the userspace then the |
---|
| 143 | + * mapping will persist. On process exit kernel itself will remove the mapping. |
---|
| 144 | + */ |
---|
| 145 | +void kbase_csf_free_command_stream_user_pages(struct kbase_context *kctx, |
---|
| 146 | + struct kbase_queue *queue); |
---|
| 147 | + |
---|
| 148 | +/** |
---|
243 | 149 | * kbase_csf_alloc_command_stream_user_pages - Allocate resources for a |
---|
244 | 150 | * GPU command queue. |
---|
245 | | - * |
---|
246 | | - * This function allocates a pair of User mode input/output pages for a |
---|
247 | | - * GPU command queue and maps them in the shared interface segment of MCU |
---|
248 | | - * firmware address space. Also reserves a hardware doorbell page for the queue. |
---|
249 | 151 | * |
---|
250 | 152 | * @kctx: Pointer to the kbase context within which the resources |
---|
251 | 153 | * for the queue are being allocated. |
---|
252 | 154 | * @queue: Pointer to the queue for which to allocate resources. |
---|
| 155 | + * |
---|
| 156 | + * This function allocates a pair of User mode input/output pages for a |
---|
| 157 | + * GPU command queue and maps them in the shared interface segment of MCU |
---|
| 158 | + * firmware address space. Also reserves a hardware doorbell page for the queue. |
---|
253 | 159 | * |
---|
254 | 160 | * Return: 0 on success, or negative on failure. |
---|
255 | 161 | */ |
---|
.. | .. |
---|
275 | 181 | * are any. |
---|
276 | 182 | * |
---|
277 | 183 | * @queue: Pointer to queue to be unbound. |
---|
| 184 | + * @process_exit: Flag to indicate if process exit is happening. |
---|
278 | 185 | */ |
---|
279 | | -void kbase_csf_queue_unbind(struct kbase_queue *queue); |
---|
| 186 | +void kbase_csf_queue_unbind(struct kbase_queue *queue, bool process_exit); |
---|
280 | 187 | |
---|
281 | 188 | /** |
---|
282 | 189 | * kbase_csf_queue_unbind_stopped - Unbind a GPU command queue in the case |
---|
.. | .. |
---|
291 | 198 | /** |
---|
292 | 199 | * kbase_csf_queue_kick - Schedule a GPU command queue on the firmware |
---|
293 | 200 | * |
---|
294 | | - * @kctx: The kbase context. |
---|
295 | | - * @kick: Pointer to the struct which specifies the queue |
---|
296 | | - * that needs to be scheduled. |
---|
| 201 | + * @kctx: The kbase context. |
---|
| 202 | + * @kick: Pointer to the struct which specifies the queue |
---|
| 203 | + * that needs to be scheduled. |
---|
297 | 204 | * |
---|
298 | 205 | * Return: 0 on success, or negative on failure. |
---|
299 | 206 | */ |
---|
.. | .. |
---|
301 | 208 | struct kbase_ioctl_cs_queue_kick *kick); |
---|
302 | 209 | |
---|
303 | 210 | /** |
---|
| 211 | + * kbase_csf_queue_group_handle_is_valid - Find the queue group corresponding |
---|
| 212 | + * to the indicated handle. |
---|
| 213 | + * |
---|
| 214 | + * @kctx: The kbase context under which the queue group exists. |
---|
| 215 | + * @group_handle: Handle for the group which uniquely identifies it within |
---|
| 216 | + * the context with which it was created. |
---|
| 217 | + * |
---|
| 218 | + * This function is used to find the queue group when passed a handle. |
---|
| 219 | + * |
---|
| 220 | + * Return: Pointer to a queue group on success, NULL on failure |
---|
| 221 | + */ |
---|
| 222 | +struct kbase_queue_group *kbase_csf_find_queue_group(struct kbase_context *kctx, u8 group_handle); |
---|
| 223 | + |
---|
| 224 | +/** |
---|
304 | 225 | * kbase_csf_queue_group_handle_is_valid - Find if the given queue group handle |
---|
305 | 226 | * is valid. |
---|
306 | | - * |
---|
307 | | - * This function is used to determine if the queue group handle is valid. |
---|
308 | 227 | * |
---|
309 | 228 | * @kctx: The kbase context under which the queue group exists. |
---|
310 | 229 | * @group_handle: Handle for the group which uniquely identifies it within |
---|
311 | 230 | * the context with which it was created. |
---|
| 231 | + * |
---|
| 232 | + * This function is used to determine if the queue group handle is valid. |
---|
312 | 233 | * |
---|
313 | 234 | * Return: 0 on success, or negative on failure. |
---|
314 | 235 | */ |
---|
.. | .. |
---|
353 | 274 | */ |
---|
354 | 275 | void kbase_csf_term_descheduled_queue_group(struct kbase_queue_group *group); |
---|
355 | 276 | |
---|
| 277 | +#if IS_ENABLED(CONFIG_MALI_VECTOR_DUMP) || MALI_UNIT_TEST |
---|
356 | 278 | /** |
---|
357 | 279 | * kbase_csf_queue_group_suspend - Suspend a GPU command queue group |
---|
358 | | - * |
---|
359 | | - * This function is used to suspend a queue group and copy the suspend buffer. |
---|
360 | 280 | * |
---|
361 | 281 | * @kctx: The kbase context for which the queue group is to be |
---|
362 | 282 | * suspended. |
---|
.. | .. |
---|
365 | 285 | * @group_handle: Handle for the group which uniquely identifies it within |
---|
366 | 286 | * the context within which it was created. |
---|
367 | 287 | * |
---|
| 288 | + * This function is used to suspend a queue group and copy the suspend buffer. |
---|
| 289 | + * |
---|
368 | 290 | * Return: 0 on success or negative value if failed to suspend |
---|
369 | 291 | * queue group and copy suspend buffer contents. |
---|
370 | 292 | */ |
---|
371 | 293 | int kbase_csf_queue_group_suspend(struct kbase_context *kctx, |
---|
372 | 294 | struct kbase_suspend_copy_buffer *sus_buf, u8 group_handle); |
---|
| 295 | +#endif |
---|
373 | 296 | |
---|
374 | 297 | /** |
---|
375 | 298 | * kbase_csf_add_group_fatal_error - Report a fatal group error to userspace |
---|
.. | .. |
---|
394 | 317 | * the update of userspace mapping of HW |
---|
395 | 318 | * doorbell page. |
---|
396 | 319 | * |
---|
| 320 | + * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
| 321 | + * |
---|
397 | 322 | * The function creates a file and allocates a dummy page to facilitate the |
---|
398 | 323 | * update of userspace mapping to point to the dummy page instead of the real |
---|
399 | 324 | * HW doorbell page after the suspend of queue group. |
---|
400 | | - * |
---|
401 | | - * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
402 | 325 | * |
---|
403 | 326 | * Return: 0 on success, or negative on failure. |
---|
404 | 327 | */ |
---|
.. | .. |
---|
417 | 340 | * instead of the User register page after |
---|
418 | 341 | * the GPU power down. |
---|
419 | 342 | * |
---|
| 343 | + * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
| 344 | + * |
---|
420 | 345 | * The function allocates a dummy page which is used to replace the User |
---|
421 | 346 | * register page in the userspace mapping after the power down of GPU. |
---|
422 | 347 | * On the power up of GPU, the mapping is updated to point to the real |
---|
423 | 348 | * User register page. The mapping is used to allow access to LATEST_FLUSH |
---|
424 | 349 | * register from userspace. |
---|
425 | | - * |
---|
426 | | - * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
427 | 350 | * |
---|
428 | 351 | * Return: 0 on success, or negative on failure. |
---|
429 | 352 | */ |
---|
.. | .. |
---|
431 | 354 | |
---|
432 | 355 | /** |
---|
433 | 356 | * kbase_csf_free_dummy_user_reg_page - Free the dummy page that was used |
---|
434 | | - * used to replace the User register page |
---|
| 357 | + * to replace the User register page |
---|
435 | 358 | * |
---|
436 | 359 | * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
437 | 360 | */ |
---|
.. | .. |
---|
440 | 363 | /** |
---|
441 | 364 | * kbase_csf_ring_csg_doorbell - ring the doorbell for a CSG interface. |
---|
442 | 365 | * |
---|
443 | | - * The function kicks a notification on the CSG interface to firmware. |
---|
444 | | - * |
---|
445 | 366 | * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
446 | 367 | * @slot: Index of CSG interface for ringing the door-bell. |
---|
| 368 | + * |
---|
| 369 | + * The function kicks a notification on the CSG interface to firmware. |
---|
447 | 370 | */ |
---|
448 | 371 | void kbase_csf_ring_csg_doorbell(struct kbase_device *kbdev, int slot); |
---|
449 | 372 | |
---|
.. | .. |
---|
451 | 374 | * kbase_csf_ring_csg_slots_doorbell - ring the doorbell for a set of CSG |
---|
452 | 375 | * interfaces. |
---|
453 | 376 | * |
---|
454 | | - * The function kicks a notification on a set of CSG interfaces to firmware. |
---|
455 | | - * |
---|
456 | 377 | * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
457 | 378 | * @slot_bitmap: bitmap for the given slots, slot-0 on bit-0, etc. |
---|
| 379 | + * |
---|
| 380 | + * The function kicks a notification on a set of CSG interfaces to firmware. |
---|
458 | 381 | */ |
---|
459 | 382 | void kbase_csf_ring_csg_slots_doorbell(struct kbase_device *kbdev, |
---|
460 | 383 | u32 slot_bitmap); |
---|
.. | .. |
---|
462 | 385 | /** |
---|
463 | 386 | * kbase_csf_ring_cs_kernel_doorbell - ring the kernel doorbell for a CSI |
---|
464 | 387 | * assigned to a GPU queue |
---|
465 | | - * |
---|
466 | | - * The function sends a doorbell interrupt notification to the firmware for |
---|
467 | | - * a CSI assigned to a GPU queue. |
---|
468 | 388 | * |
---|
469 | 389 | * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
470 | 390 | * @csi_index: ID of the CSI assigned to the GPU queue. |
---|
.. | .. |
---|
476 | 396 | * The flag is supposed be false only when the input page |
---|
477 | 397 | * for bound GPU queues is programmed at the time of |
---|
478 | 398 | * starting/resuming the group on a CSG slot. |
---|
| 399 | + * |
---|
| 400 | + * The function sends a doorbell interrupt notification to the firmware for |
---|
| 401 | + * a CSI assigned to a GPU queue. |
---|
479 | 402 | */ |
---|
480 | 403 | void kbase_csf_ring_cs_kernel_doorbell(struct kbase_device *kbdev, |
---|
481 | 404 | int csi_index, int csg_nr, |
---|
.. | .. |
---|
485 | 408 | * kbase_csf_ring_cs_user_doorbell - ring the user doorbell allocated for a |
---|
486 | 409 | * queue. |
---|
487 | 410 | * |
---|
488 | | - * The function kicks a notification to the firmware on the doorbell assigned |
---|
489 | | - * to the queue. |
---|
490 | | - * |
---|
491 | 411 | * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
492 | 412 | * @queue: Pointer to the queue for ringing the door-bell. |
---|
| 413 | + * |
---|
| 414 | + * The function kicks a notification to the firmware on the doorbell assigned |
---|
| 415 | + * to the queue. |
---|
493 | 416 | */ |
---|
494 | 417 | void kbase_csf_ring_cs_user_doorbell(struct kbase_device *kbdev, |
---|
495 | 418 | struct kbase_queue *queue); |
---|
.. | .. |
---|
560 | 483 | return kbasep_csf_queue_group_priority_to_relative[priority]; |
---|
561 | 484 | } |
---|
562 | 485 | |
---|
| 486 | +/** |
---|
| 487 | + * kbase_csf_ktrace_gpu_cycle_cnt - Wrapper to retreive the GPU cycle counter |
---|
| 488 | + * value for Ktrace purpose. |
---|
| 489 | + * |
---|
| 490 | + * @kbdev: Instance of a GPU platform device that implements a CSF interface. |
---|
| 491 | + * |
---|
| 492 | + * This function is just a wrapper to retreive the GPU cycle counter value, to |
---|
| 493 | + * avoid any overhead on Release builds where Ktrace is disabled by default. |
---|
| 494 | + * |
---|
| 495 | + * Return: Snapshot of the GPU cycle count register. |
---|
| 496 | + */ |
---|
| 497 | +static inline u64 kbase_csf_ktrace_gpu_cycle_cnt(struct kbase_device *kbdev) |
---|
| 498 | +{ |
---|
| 499 | +#if KBASE_KTRACE_ENABLE |
---|
| 500 | + return kbase_backend_get_cycle_cnt(kbdev); |
---|
| 501 | +#else |
---|
| 502 | + return 0; |
---|
| 503 | +#endif |
---|
| 504 | +} |
---|
563 | 505 | |
---|
564 | 506 | #endif /* _KBASE_CSF_H_ */ |
---|