MALI: midgard: RK: add separate src dir of Midgard driver for RK Linux device
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard_for_linux / backend / gpu / mali_kbase_instr_defs.h
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  * 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         /* kbasep_reset_timeout_worker() has started (but not compelted) a
43          * reset. This generally indicates the current action should be aborted,
44          * and kbasep_reset_timeout_worker() will handle the cleanup */
45         KBASE_INSTR_STATE_RESETTING,
46         /* An error has occured during DUMPING (page fault). */
47         KBASE_INSTR_STATE_FAULT
48 };
49
50 /* Structure used for instrumentation and HW counters dumping */
51 struct kbase_instr_backend {
52         wait_queue_head_t wait;
53         int triggered;
54
55         enum kbase_instr_state state;
56         wait_queue_head_t cache_clean_wait;
57         struct workqueue_struct *cache_clean_wq;
58         struct work_struct  cache_clean_work;
59 };
60
61 #endif /* _KBASE_INSTR_DEFS_H_ */
62