xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/midgard/mali_kbase_hwaccess_time.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *
3  * (C) COPYRIGHT 2014 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 
19 /**
20  *
21  */
22 
23 #ifndef _KBASE_BACKEND_TIME_H_
24 #define _KBASE_BACKEND_TIME_H_
25 
26 /**
27  * kbase_backend_get_gpu_time() - Get current GPU time
28  * @kbdev:		Device pointer
29  * @cycle_counter:	Pointer to u64 to store cycle counter in
30  * @system_time:	Pointer to u64 to store system time in
31  * @ts:			Pointer to struct timespec64 to store current monotonic
32  *			time in
33  */
34 void kbase_backend_get_gpu_time(struct kbase_device *kbdev, u64 *cycle_counter,
35 				u64 *system_time, struct timespec64 *ts);
36 
37 /**
38  * kbase_wait_write_flush() -  Wait for GPU write flush
39  * @kctx:	Context pointer
40  *
41  * Wait 1000 GPU clock cycles. This delay is known to give the GPU time to flush
42  * its write buffer.
43  *
44  * If GPU resets occur then the counters are reset to zero, the delay may not be
45  * as expected.
46  *
47  * This function is only in use for BASE_HW_ISSUE_6367
48  */
49 #ifndef CONFIG_MALI_NO_MALI
50 void kbase_wait_write_flush(struct kbase_context *kctx);
51 #endif
52 
53 #endif /* _KBASE_BACKEND_TIME_H_ */
54