rk: temp revert rk change
[firefly-linux-kernel-4.4.55.git] / drivers / gator / mali / mali_mjollnir_profiling_gator_api.h
1 /**
2  * Copyright (C) ARM Limited 2013-2015. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  */
9
10 #ifndef __MALI_MJOLLNIR_PROFILING_GATOR_API_H__
11 #define __MALI_MJOLLNIR_PROFILING_GATOR_API_H__
12
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17
18
19 /*
20  * The number of processor cores.  Update to suit your hardware implementation.
21  */
22 #define MAX_NUM_FP_CORES            (4)
23 #define MAX_NUM_VP_CORES            (1)
24 #define MAX_NUM_L2_CACHE_CORES      (1)
25
26 enum counters {
27         /* Timeline activity */
28         ACTIVITY_VP_0 = 0,
29         ACTIVITY_FP_0,
30         ACTIVITY_FP_1,
31         ACTIVITY_FP_2,
32         ACTIVITY_FP_3,
33
34         /* L2 cache counters */
35         COUNTER_L2_0_C0,
36         COUNTER_L2_0_C1,
37
38         /* Vertex processor counters */
39         COUNTER_VP_0_C0,
40         COUNTER_VP_0_C1,
41
42         /* Fragment processor counters */
43         COUNTER_FP_0_C0,
44         COUNTER_FP_0_C1,
45         COUNTER_FP_1_C0,
46         COUNTER_FP_1_C1,
47         COUNTER_FP_2_C0,
48         COUNTER_FP_2_C1,
49         COUNTER_FP_3_C0,
50         COUNTER_FP_3_C1,
51
52         /* EGL Software Counters */
53         COUNTER_EGL_BLIT_TIME,
54
55         /* GLES Software Counters */
56         COUNTER_GLES_DRAW_ELEMENTS_CALLS,
57         COUNTER_GLES_DRAW_ELEMENTS_NUM_INDICES,
58         COUNTER_GLES_DRAW_ELEMENTS_NUM_TRANSFORMED,
59         COUNTER_GLES_DRAW_ARRAYS_CALLS,
60         COUNTER_GLES_DRAW_ARRAYS_NUM_TRANSFORMED,
61         COUNTER_GLES_DRAW_POINTS,
62         COUNTER_GLES_DRAW_LINES,
63         COUNTER_GLES_DRAW_LINE_LOOP,
64         COUNTER_GLES_DRAW_LINE_STRIP,
65         COUNTER_GLES_DRAW_TRIANGLES,
66         COUNTER_GLES_DRAW_TRIANGLE_STRIP,
67         COUNTER_GLES_DRAW_TRIANGLE_FAN,
68         COUNTER_GLES_NON_VBO_DATA_COPY_TIME,
69         COUNTER_GLES_UNIFORM_BYTES_COPIED_TO_MALI,
70         COUNTER_GLES_UPLOAD_TEXTURE_TIME,
71         COUNTER_GLES_UPLOAD_VBO_TIME,
72         COUNTER_GLES_NUM_FLUSHES,
73         COUNTER_GLES_NUM_VSHADERS_GENERATED,
74         COUNTER_GLES_NUM_FSHADERS_GENERATED,
75         COUNTER_GLES_VSHADER_GEN_TIME,
76         COUNTER_GLES_FSHADER_GEN_TIME,
77         COUNTER_GLES_INPUT_TRIANGLES,
78         COUNTER_GLES_VXCACHE_HIT,
79         COUNTER_GLES_VXCACHE_MISS,
80         COUNTER_GLES_VXCACHE_COLLISION,
81         COUNTER_GLES_CULLED_TRIANGLES,
82         COUNTER_GLES_CULLED_LINES,
83         COUNTER_GLES_BACKFACE_TRIANGLES,
84         COUNTER_GLES_GBCLIP_TRIANGLES,
85         COUNTER_GLES_GBCLIP_LINES,
86         COUNTER_GLES_TRIANGLES_DRAWN,
87         COUNTER_GLES_DRAWCALL_TIME,
88         COUNTER_GLES_TRIANGLES_COUNT,
89         COUNTER_GLES_INDEPENDENT_TRIANGLES_COUNT,
90         COUNTER_GLES_STRIP_TRIANGLES_COUNT,
91         COUNTER_GLES_FAN_TRIANGLES_COUNT,
92         COUNTER_GLES_LINES_COUNT,
93         COUNTER_GLES_INDEPENDENT_LINES_COUNT,
94         COUNTER_GLES_STRIP_LINES_COUNT,
95         COUNTER_GLES_LOOP_LINES_COUNT,
96
97         COUNTER_FILMSTRIP,
98         COUNTER_FREQUENCY,
99         COUNTER_VOLTAGE,
100
101         NUMBER_OF_EVENTS
102 };
103
104 #define FIRST_ACTIVITY_EVENT    ACTIVITY_VP_0
105 #define LAST_ACTIVITY_EVENT     ACTIVITY_FP_3
106
107 #define FIRST_HW_COUNTER        COUNTER_L2_0_C0
108 #define LAST_HW_COUNTER         COUNTER_FP_3_C1
109
110 #define FIRST_SW_COUNTER        COUNTER_EGL_BLIT_TIME
111 #define LAST_SW_COUNTER         COUNTER_GLES_LOOP_LINES_COUNT
112
113 /* Signifies that the system is able to report voltage and frequency numbers. */
114 #define DVFS_REPORTED_BY_DDK 1
115
116 /**
117  * Structure to pass performance counter data of a Mali core
118  */
119 struct _mali_profiling_core_counters {
120         u32 source0;
121         u32 value0;
122         u32 source1;
123         u32 value1;
124 };
125
126 /*
127  * For compatibility with utgard.
128  */
129 struct _mali_profiling_l2_counter_values {
130         struct _mali_profiling_core_counters cores[MAX_NUM_L2_CACHE_CORES];
131 };
132
133 struct _mali_profiling_mali_version {
134         u32 mali_product_id;
135         u32 mali_version_major;
136         u32 mali_version_minor;
137         u32 num_of_l2_cores;
138         u32 num_of_fp_cores;
139         u32 num_of_vp_cores;
140 };
141
142 extern void _mali_profiling_get_mali_version(struct _mali_profiling_mali_version *values);
143 extern u32 _mali_profiling_get_l2_counters(struct _mali_profiling_l2_counter_values *values);
144
145 /*
146  * List of possible actions allowing DDK to be controlled by Streamline.
147  * The following numbers are used by DDK to control the frame buffer dumping.
148  */
149 #define FBDUMP_CONTROL_ENABLE (1)
150 #define FBDUMP_CONTROL_RATE (2)
151 #define SW_COUNTER_ENABLE      (3)
152 #define FBDUMP_CONTROL_RESIZE_FACTOR (4)
153
154
155 #ifdef __cplusplus
156 }
157 #endif
158
159 #endif /* __MALI_MJOLLNIR_PROFILING_GATOR_API_H__ */