2 * Copyright (C) 2011-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.
12 * @file mali_osk_specific.h
13 * Defines per-OS Kernel level specifics, such as unusual workarounds for
17 #ifndef __MALI_OSK_SPECIFIC_H__
18 #define __MALI_OSK_SPECIFIC_H__
20 #include <asm/uaccess.h>
22 #include "mali_sync.h"
24 #define MALI_STATIC_INLINE static inline
25 #define MALI_NON_STATIC_INLINE inline
29 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
30 typedef struct sync_timeline mali_sync_tl;
31 typedef struct sync_pt mali_sync_pt;
33 MALI_STATIC_INLINE mali_sync_pt *_mali_osk_sync_pt_create(mali_sync_tl *parent)
35 return (mali_sync_pt*)mali_sync_pt_alloc(parent);
38 MALI_STATIC_INLINE void _mali_osk_sync_pt_signal(mali_sync_pt *pt)
40 mali_sync_signal_pt(pt, 0);
43 #endif /* CONFIG_SYNC */
45 MALI_STATIC_INLINE u32 _mali_osk_copy_from_user(void *to, void *from, u32 n)
47 return (u32)copy_from_user(to, from, (unsigned long)n);
50 /** The list of events supported by the Mali DDK. */
53 /* Vertex processor activity */
56 /* Fragment processor activity */
62 /* L2 cache counters */
66 /* Vertex processor counters */
70 /* Fragment processor counters */
81 * If more hardware counters are added, the _mali_osk_hw_counter_table
82 * below should also be updated.
85 /* EGL software counters */
86 COUNTER_EGL_BLIT_TIME,
88 /* GLES software counters */
89 COUNTER_GLES_DRAW_ELEMENTS_CALLS,
90 COUNTER_GLES_DRAW_ELEMENTS_NUM_INDICES,
91 COUNTER_GLES_DRAW_ELEMENTS_NUM_TRANSFORMED,
92 COUNTER_GLES_DRAW_ARRAYS_CALLS,
93 COUNTER_GLES_DRAW_ARRAYS_NUM_TRANSFORMED,
94 COUNTER_GLES_DRAW_POINTS,
95 COUNTER_GLES_DRAW_LINES,
96 COUNTER_GLES_DRAW_LINE_LOOP,
97 COUNTER_GLES_DRAW_LINE_STRIP,
98 COUNTER_GLES_DRAW_TRIANGLES,
99 COUNTER_GLES_DRAW_TRIANGLE_STRIP,
100 COUNTER_GLES_DRAW_TRIANGLE_FAN,
101 COUNTER_GLES_NON_VBO_DATA_COPY_TIME,
102 COUNTER_GLES_UNIFORM_BYTES_COPIED_TO_MALI,
103 COUNTER_GLES_UPLOAD_TEXTURE_TIME,
104 COUNTER_GLES_UPLOAD_VBO_TIME,
105 COUNTER_GLES_NUM_FLUSHES,
106 COUNTER_GLES_NUM_VSHADERS_GENERATED,
107 COUNTER_GLES_NUM_FSHADERS_GENERATED,
108 COUNTER_GLES_VSHADER_GEN_TIME,
109 COUNTER_GLES_FSHADER_GEN_TIME,
110 COUNTER_GLES_INPUT_TRIANGLES,
111 COUNTER_GLES_VXCACHE_HIT,
112 COUNTER_GLES_VXCACHE_MISS,
113 COUNTER_GLES_VXCACHE_COLLISION,
114 COUNTER_GLES_CULLED_TRIANGLES,
115 COUNTER_GLES_CULLED_LINES,
116 COUNTER_GLES_BACKFACE_TRIANGLES,
117 COUNTER_GLES_GBCLIP_TRIANGLES,
118 COUNTER_GLES_GBCLIP_LINES,
119 COUNTER_GLES_TRIANGLES_DRAWN,
120 COUNTER_GLES_DRAWCALL_TIME,
121 COUNTER_GLES_TRIANGLES_COUNT,
122 COUNTER_GLES_INDEPENDENT_TRIANGLES_COUNT,
123 COUNTER_GLES_STRIP_TRIANGLES_COUNT,
124 COUNTER_GLES_FAN_TRIANGLES_COUNT,
125 COUNTER_GLES_LINES_COUNT,
126 COUNTER_GLES_INDEPENDENT_LINES_COUNT,
127 COUNTER_GLES_STRIP_LINES_COUNT,
128 COUNTER_GLES_LOOP_LINES_COUNT,
130 /* Framebuffer capture pseudo-counter */
134 } _mali_osk_counter_id;
136 #define FIRST_ACTIVITY_EVENT ACTIVITY_VP
137 #define LAST_ACTIVITY_EVENT ACTIVITY_FP3
139 #define FIRST_HW_COUNTER COUNTER_L2_C0
140 #define LAST_HW_COUNTER COUNTER_FP3_C1
142 #define FIRST_SW_COUNTER COUNTER_EGL_BLIT_TIME
143 #define LAST_SW_COUNTER COUNTER_GLES_LOOP_LINES_COUNT
145 #define FIRST_SPECIAL_COUNTER COUNTER_FILMSTRIP
146 #define LAST_SPECIAL_COUNTER COUNTER_FILMSTRIP
148 #endif /* __MALI_OSK_SPECIFIC_H__ */