xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_time.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *
3  * (C) COPYRIGHT 2014-2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15 
16 
17 
18 #ifndef _KBASE_BACKEND_TIME_H_
19 #define _KBASE_BACKEND_TIME_H_
20 
21 /**
22  * kbase_backend_get_gpu_time() - Get current GPU time
23  * @kbdev:		Device pointer
24  * @cycle_counter:	Pointer to u64 to store cycle counter in
25  * @system_time:	Pointer to u64 to store system time in
26  * @ts:			Pointer to struct timespec64 to store current monotonic
27  *			time in
28  */
29 void kbase_backend_get_gpu_time(struct kbase_device *kbdev, u64 *cycle_counter,
30 				u64 *system_time, struct timespec64 *ts);
31 
32 /**
33  * kbase_wait_write_flush() -  Wait for GPU write flush
34  * @kctx:	Context pointer
35  *
36  * Wait 1000 GPU clock cycles. This delay is known to give the GPU time to flush
37  * its write buffer.
38  *
39  * If GPU resets occur then the counters are reset to zero, the delay may not be
40  * as expected.
41  *
42  * This function is only in use for BASE_HW_ISSUE_6367
43  */
44 #ifdef CONFIG_MALI_NO_MALI
kbase_wait_write_flush(struct kbase_context * kctx)45 static inline void kbase_wait_write_flush(struct kbase_context *kctx)
46 {
47 }
48 #else
49 void kbase_wait_write_flush(struct kbase_context *kctx);
50 #endif
51 
52 #endif /* _KBASE_BACKEND_TIME_H_ */
53