xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/midgard/backend/gpu/mali_kbase_instr_defs.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *
3  * (C) COPYRIGHT 2014, 2016 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  * Backend-specific instrumentation definitions
20  */
21 
22 #ifndef _KBASE_INSTR_DEFS_H_
23 #define _KBASE_INSTR_DEFS_H_
24 
25 /*
26  * Instrumentation State Machine States
27  */
28 enum kbase_instr_state {
29 	/* State where instrumentation is not active */
30 	KBASE_INSTR_STATE_DISABLED = 0,
31 	/* State machine is active and ready for a command. */
32 	KBASE_INSTR_STATE_IDLE,
33 	/* Hardware is currently dumping a frame. */
34 	KBASE_INSTR_STATE_DUMPING,
35 	/* We've requested a clean to occur on a workqueue */
36 	KBASE_INSTR_STATE_REQUEST_CLEAN,
37 	/* Hardware is currently cleaning and invalidating caches. */
38 	KBASE_INSTR_STATE_CLEANING,
39 	/* Cache clean completed, and either a) a dump is complete, or
40 	 * b) instrumentation can now be setup. */
41 	KBASE_INSTR_STATE_CLEANED,
42 	/* An error has occured during DUMPING (page fault). */
43 	KBASE_INSTR_STATE_FAULT
44 };
45 
46 /* Structure used for instrumentation and HW counters dumping */
47 struct kbase_instr_backend {
48 	wait_queue_head_t wait;
49 	int triggered;
50 
51 	enum kbase_instr_state state;
52 	wait_queue_head_t cache_clean_wait;
53 	struct workqueue_struct *cache_clean_wq;
54 	struct work_struct  cache_clean_work;
55 };
56 
57 #endif /* _KBASE_INSTR_DEFS_H_ */
58 
59