2 * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
11 #ifndef _MALI_UTGARD_PROFILING_EVENTS_H_
12 #define _MALI_UTGARD_PROFILING_EVENTS_H_
15 * The event ID is a 32 bit value consisting of different fields
16 * reserved, 4 bits, for future use
17 * event type, 4 bits, cinstr_profiling_event_type_t
18 * event channel, 8 bits, the source of the event.
19 * event data, 16 bit field, data depending on event type
23 * Specifies what kind of event this is
26 MALI_PROFILING_EVENT_TYPE_SINGLE = 0 << 24,
27 MALI_PROFILING_EVENT_TYPE_START = 1 << 24,
28 MALI_PROFILING_EVENT_TYPE_STOP = 2 << 24,
29 MALI_PROFILING_EVENT_TYPE_SUSPEND = 3 << 24,
30 MALI_PROFILING_EVENT_TYPE_RESUME = 4 << 24,
31 } cinstr_profiling_event_type_t;
35 * Secifies the channel/source of the event
38 MALI_PROFILING_EVENT_CHANNEL_SOFTWARE = 0 << 16,
39 MALI_PROFILING_EVENT_CHANNEL_GP0 = 1 << 16,
40 MALI_PROFILING_EVENT_CHANNEL_PP0 = 5 << 16,
41 MALI_PROFILING_EVENT_CHANNEL_PP1 = 6 << 16,
42 MALI_PROFILING_EVENT_CHANNEL_PP2 = 7 << 16,
43 MALI_PROFILING_EVENT_CHANNEL_PP3 = 8 << 16,
44 MALI_PROFILING_EVENT_CHANNEL_PP4 = 9 << 16,
45 MALI_PROFILING_EVENT_CHANNEL_PP5 = 10 << 16,
46 MALI_PROFILING_EVENT_CHANNEL_PP6 = 11 << 16,
47 MALI_PROFILING_EVENT_CHANNEL_PP7 = 12 << 16,
48 MALI_PROFILING_EVENT_CHANNEL_GPU = 21 << 16,
49 } cinstr_profiling_event_channel_t;
52 #define MALI_PROFILING_MAKE_EVENT_CHANNEL_GP(num) (((MALI_PROFILING_EVENT_CHANNEL_GP0 >> 16) + (num)) << 16)
53 #define MALI_PROFILING_MAKE_EVENT_CHANNEL_PP(num) (((MALI_PROFILING_EVENT_CHANNEL_PP0 >> 16) + (num)) << 16)
56 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_SINGLE is used from software channel
59 MALI_PROFILING_EVENT_REASON_SINGLE_SW_NONE = 0,
60 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_NEW_FRAME = 1,
61 MALI_PROFILING_EVENT_REASON_SINGLE_SW_FLUSH = 2,
62 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_SWAP_BUFFERS = 3,
63 MALI_PROFILING_EVENT_REASON_SINGLE_SW_FB_EVENT = 4,
64 MALI_PROFILING_EVENT_REASON_SINGLE_SW_GP_ENQUEUE = 5,
65 MALI_PROFILING_EVENT_REASON_SINGLE_SW_PP_ENQUEUE = 6,
66 MALI_PROFILING_EVENT_REASON_SINGLE_SW_READBACK = 7,
67 MALI_PROFILING_EVENT_REASON_SINGLE_SW_WRITEBACK = 8,
68 MALI_PROFILING_EVENT_REASON_SINGLE_SW_ENTER_API_FUNC = 10,
69 MALI_PROFILING_EVENT_REASON_SINGLE_SW_LEAVE_API_FUNC = 11,
70 MALI_PROFILING_EVENT_REASON_SINGLE_SW_DISCARD_ATTACHMENTS = 13,
71 MALI_PROFILING_EVENT_REASON_SINGLE_SW_UMP_TRY_LOCK = 53,
72 MALI_PROFILING_EVENT_REASON_SINGLE_SW_UMP_LOCK = 54,
73 MALI_PROFILING_EVENT_REASON_SINGLE_SW_UMP_UNLOCK = 55,
74 MALI_PROFILING_EVENT_REASON_SINGLE_LOCK_CONTENDED = 56,
75 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_MALI_FENCE_DUP = 57,
76 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_SET_PP_JOB_FENCE = 58,
77 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_WAIT_SYNC = 59,
78 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_CREATE_FENCE_SYNC = 60,
79 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_CREATE_NATIVE_FENCE_SYNC = 61,
80 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_FENCE_FLUSH = 62,
81 MALI_PROFILING_EVENT_REASON_SINGLE_SW_EGL_FLUSH_SERVER_WAITS= 63,
82 } cinstr_profiling_event_reason_single_sw_t;
85 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_START/STOP is used from software channel
86 * to inform whether the core is physical or virtual
89 MALI_PROFILING_EVENT_REASON_START_STOP_HW_PHYSICAL = 0,
90 MALI_PROFILING_EVENT_REASON_START_STOP_HW_VIRTUAL = 1,
91 } cinstr_profiling_event_reason_start_stop_hw_t;
94 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_START/STOP is used from software channel
97 /*MALI_PROFILING_EVENT_REASON_START_STOP_SW_NONE = 0,*/
98 MALI_PROFILING_EVENT_REASON_START_STOP_SW_MALI = 1,
99 MALI_PROFILING_EVENT_REASON_START_STOP_SW_CALLBACK_THREAD = 2,
100 MALI_PROFILING_EVENT_REASON_START_STOP_SW_WORKER_THREAD = 3,
101 MALI_PROFILING_EVENT_REASON_START_STOP_SW_BOTTOM_HALF = 4,
102 MALI_PROFILING_EVENT_REASON_START_STOP_SW_UPPER_HALF = 5,
103 } cinstr_profiling_event_reason_start_stop_sw_t;
106 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_SUSPEND/RESUME is used from software channel
109 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_NONE = 0, /* used */
110 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_PIPELINE_FULL = 1, /* NOT used */
111 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VSYNC = 26, /* used in some build configurations */
112 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_FB_IFRAME_WAIT = 27, /* USED */
113 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_FB_IFRAME_SYNC = 28, /* USED */
114 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VG_WAIT_FILTER_CLEANUP = 29, /* used */
115 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_VG_WAIT_TEXTURE = 30, /* used */
116 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_GLES_WAIT_MIPLEVEL = 31, /* used */
117 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_GLES_WAIT_READPIXELS = 32, /* used */
118 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_EGL_WAIT_SWAP_IMMEDIATE = 33, /* NOT used */
119 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_ICS_QUEUE_BUFFER = 34, /* USED */
120 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_ICS_DEQUEUE_BUFFER = 35, /* USED */
121 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_UMP_LOCK = 36, /* Not currently used */
122 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_X11_GLOBAL_LOCK = 37, /* Not currently used */
123 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_X11_SWAP = 38, /* Not currently used */
124 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_MALI_EGL_IMAGE_SYNC_WAIT = 39, /* USED */
125 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_GP_JOB_HANDLING = 40, /* USED */
126 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_PP_JOB_HANDLING = 41, /* USED */
127 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_EGL_MALI_FENCE_MERGE = 42, /* USED */
128 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_EGL_MALI_FENCE_DUP = 43,
129 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_EGL_FLUSH_SERVER_WAITS = 44,
130 MALI_PROFILING_EVENT_REASON_SUSPEND_RESUME_SW_EGL_WAIT_SYNC = 45, /* USED */
131 } cinstr_profiling_event_reason_suspend_resume_sw_t;
134 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_SINGLE is used from a HW channel (GPx+PPx)
137 MALI_PROFILING_EVENT_REASON_SINGLE_HW_NONE = 0,
138 MALI_PROFILING_EVENT_REASON_SINGLE_HW_INTERRUPT = 1,
139 MALI_PROFILING_EVENT_REASON_SINGLE_HW_FLUSH = 2,
140 } cinstr_profiling_event_reason_single_hw_t;
143 * These events are applicable when the type MALI_PROFILING_EVENT_TYPE_SINGLE is used from the GPU channel
146 MALI_PROFILING_EVENT_REASON_SINGLE_GPU_NONE = 0,
147 MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE = 1,
148 MALI_PROFILING_EVENT_REASON_SINGLE_GPU_L20_COUNTERS = 2,
149 MALI_PROFILING_EVENT_REASON_SINGLE_GPU_L21_COUNTERS = 3,
150 MALI_PROFILING_EVENT_REASON_SINGLE_GPU_L22_COUNTERS = 4,
151 } cinstr_profiling_event_reason_single_gpu_t;
154 * These values are applicable for the 3rd data parameter when
155 * the type MALI_PROFILING_EVENT_TYPE_START is used from the software channel
156 * with the MALI_PROFILING_EVENT_REASON_START_STOP_BOTTOM_HALF reason.
159 MALI_PROFILING_EVENT_DATA_CORE_GP0 = 1,
160 MALI_PROFILING_EVENT_DATA_CORE_PP0 = 5,
161 MALI_PROFILING_EVENT_DATA_CORE_PP1 = 6,
162 MALI_PROFILING_EVENT_DATA_CORE_PP2 = 7,
163 MALI_PROFILING_EVENT_DATA_CORE_PP3 = 8,
164 MALI_PROFILING_EVENT_DATA_CORE_PP4 = 9,
165 MALI_PROFILING_EVENT_DATA_CORE_PP5 = 10,
166 MALI_PROFILING_EVENT_DATA_CORE_PP6 = 11,
167 MALI_PROFILING_EVENT_DATA_CORE_PP7 = 12,
168 } cinstr_profiling_event_data_core_t;
170 #define MALI_PROFILING_MAKE_EVENT_DATA_CORE_GP(num) (MALI_PROFILING_EVENT_DATA_CORE_GP0 + (num))
171 #define MALI_PROFILING_MAKE_EVENT_DATA_CORE_PP(num) (MALI_PROFILING_EVENT_DATA_CORE_PP0 + (num))
174 #endif /*_MALI_UTGARD_PROFILING_EVENTS_H_*/