1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_MSM_KGSL_H
20 #define _UAPI_MSM_KGSL_H
21 #define KGSL_VERSION_MAJOR 3
22 #define KGSL_VERSION_MINOR 14
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define KGSL_CONTEXT_SAVE_GMEM 0x00000001
25 #define KGSL_CONTEXT_NO_GMEM_ALLOC 0x00000002
26 #define KGSL_CONTEXT_SUBMIT_IB_LIST 0x00000004
27 #define KGSL_CONTEXT_CTX_SWITCH 0x00000008
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define KGSL_CONTEXT_PREAMBLE 0x00000010
30 #define KGSL_CONTEXT_TRASH_STATE 0x00000020
31 #define KGSL_CONTEXT_PER_CONTEXT_TS 0x00000040
32 #define KGSL_CONTEXT_USER_GENERATED_TS 0x00000080
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define KGSL_CONTEXT_END_OF_FRAME 0x00000100
35 #define KGSL_CONTEXT_NO_FAULT_TOLERANCE 0x00000200
36 #define KGSL_CONTEXT_SYNC 0x00000400
37 #define KGSL_CONTEXT_PWR_CONSTRAINT 0x00000800
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #define KGSL_CONTEXT_PRIORITY_MASK 0x0000F000
40 #define KGSL_CONTEXT_PRIORITY_SHIFT 12
41 #define KGSL_CONTEXT_PRIORITY_UNDEF 0
42 #define KGSL_CONTEXT_IFH_NOP 0x00010000
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #define KGSL_CONTEXT_SECURE 0x00020000
45 #define KGSL_CONTEXT_TYPE_MASK 0x01F00000
46 #define KGSL_CONTEXT_TYPE_SHIFT 20
47 #define KGSL_CONTEXT_TYPE_ANY 0
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define KGSL_CONTEXT_TYPE_GL 1
50 #define KGSL_CONTEXT_TYPE_CL 2
51 #define KGSL_CONTEXT_TYPE_C2D 3
52 #define KGSL_CONTEXT_TYPE_RS 4
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 #define KGSL_CONTEXT_TYPE_UNKNOWN 0x1E
55 #define KGSL_CONTEXT_INVALID 0xffffffff
56 #define KGSL_CMDBATCH_MEMLIST 0x00000001
57 #define KGSL_CMDBATCH_MARKER 0x00000002
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 #define KGSL_CMDBATCH_SUBMIT_IB_LIST KGSL_CONTEXT_SUBMIT_IB_LIST
60 #define KGSL_CMDBATCH_CTX_SWITCH KGSL_CONTEXT_CTX_SWITCH
61 #define KGSL_CMDBATCH_PROFILING 0x00000010
62 #define KGSL_CMDBATCH_END_OF_FRAME KGSL_CONTEXT_END_OF_FRAME
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 #define KGSL_CMDBATCH_SYNC KGSL_CONTEXT_SYNC
65 #define KGSL_CMDBATCH_PWR_CONSTRAINT KGSL_CONTEXT_PWR_CONSTRAINT
66 #define KGSL_MEMFLAGS_GPUREADONLY 0x01000000
67 #define KGSL_MEMFLAGS_USE_CPU_MAP 0x10000000
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 #define KGSL_MEMFLAGS_SECURE 0x00000008
70 #define KGSL_CACHEMODE_MASK 0x0C000000
71 #define KGSL_CACHEMODE_SHIFT 26
72 #define KGSL_CACHEMODE_WRITECOMBINE 0
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define KGSL_CACHEMODE_UNCACHED 1
75 #define KGSL_CACHEMODE_WRITETHROUGH 2
76 #define KGSL_CACHEMODE_WRITEBACK 3
77 #define KGSL_MEMTYPE_MASK 0x0000FF00
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define KGSL_MEMTYPE_SHIFT 8
80 #define KGSL_MEMTYPE_OBJECTANY 0
81 #define KGSL_MEMTYPE_FRAMEBUFFER 1
82 #define KGSL_MEMTYPE_RENDERBUFFER 2
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define KGSL_MEMTYPE_ARRAYBUFFER 3
85 #define KGSL_MEMTYPE_ELEMENTARRAYBUFFER 4
86 #define KGSL_MEMTYPE_VERTEXARRAYBUFFER 5
87 #define KGSL_MEMTYPE_TEXTURE 6
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define KGSL_MEMTYPE_SURFACE 7
90 #define KGSL_MEMTYPE_EGL_SURFACE 8
91 #define KGSL_MEMTYPE_GL 9
92 #define KGSL_MEMTYPE_CL 10
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define KGSL_MEMTYPE_CL_BUFFER_MAP 11
95 #define KGSL_MEMTYPE_CL_BUFFER_NOMAP 12
96 #define KGSL_MEMTYPE_CL_IMAGE_MAP 13
97 #define KGSL_MEMTYPE_CL_IMAGE_NOMAP 14
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define KGSL_MEMTYPE_CL_KERNEL_STACK 15
100 #define KGSL_MEMTYPE_COMMAND 16
101 #define KGSL_MEMTYPE_2D 17
102 #define KGSL_MEMTYPE_EGL_IMAGE 18
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 #define KGSL_MEMTYPE_EGL_SHADOW 19
105 #define KGSL_MEMTYPE_MULTISAMPLE 20
106 #define KGSL_MEMTYPE_KERNEL 255
107 #define KGSL_MEMALIGN_MASK 0x00FF0000
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 #define KGSL_MEMALIGN_SHIFT 16
110 enum kgsl_user_mem_type {
111  KGSL_USER_MEM_TYPE_PMEM = 0x00000000,
112  KGSL_USER_MEM_TYPE_ASHMEM = 0x00000001,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114  KGSL_USER_MEM_TYPE_ADDR = 0x00000002,
115  KGSL_USER_MEM_TYPE_ION = 0x00000003,
116  KGSL_USER_MEM_TYPE_MAX = 0x00000007,
117 };
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 #define KGSL_MEMFLAGS_USERMEM_MASK 0x000000e0
120 #define KGSL_MEMFLAGS_USERMEM_SHIFT 5
121 #define KGSL_USERMEM_FLAG(x) (((x) + 1) << KGSL_MEMFLAGS_USERMEM_SHIFT)
122 #define KGSL_MEMFLAGS_NOT_USERMEM 0
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 #define KGSL_MEMFLAGS_USERMEM_PMEM KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_PMEM)
125 #define KGSL_MEMFLAGS_USERMEM_ASHMEM   KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ASHMEM)
126 #define KGSL_MEMFLAGS_USERMEM_ADDR KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ADDR)
127 #define KGSL_MEMFLAGS_USERMEM_ION KGSL_USERMEM_FLAG(KGSL_USER_MEM_TYPE_ION)
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define KGSL_FLAGS_NORMALMODE 0x00000000
130 #define KGSL_FLAGS_SAFEMODE 0x00000001
131 #define KGSL_FLAGS_INITIALIZED0 0x00000002
132 #define KGSL_FLAGS_INITIALIZED 0x00000004
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 #define KGSL_FLAGS_STARTED 0x00000008
135 #define KGSL_FLAGS_ACTIVE 0x00000010
136 #define KGSL_FLAGS_RESERVED0 0x00000020
137 #define KGSL_FLAGS_RESERVED1 0x00000040
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define KGSL_FLAGS_RESERVED2 0x00000080
140 #define KGSL_FLAGS_SOFT_RESET 0x00000100
141 #define KGSL_FLAGS_PER_CONTEXT_TIMESTAMPS 0x00000200
142 #define KGSL_CLK_SRC 0x00000001
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define KGSL_CLK_CORE 0x00000002
145 #define KGSL_CLK_IFACE 0x00000004
146 #define KGSL_CLK_MEM 0x00000008
147 #define KGSL_CLK_MEM_IFACE 0x00000010
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define KGSL_CLK_AXI 0x00000020
150 #define KGSL_SYNCOBJ_SERVER_TIMEOUT 2000
151 enum kgsl_ctx_reset_stat {
152  KGSL_CTX_STAT_NO_ERROR = 0x00000000,
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  KGSL_CTX_STAT_GUILTY_CONTEXT_RESET_EXT = 0x00000001,
155  KGSL_CTX_STAT_INNOCENT_CONTEXT_RESET_EXT = 0x00000002,
156  KGSL_CTX_STAT_UNKNOWN_CONTEXT_RESET_EXT = 0x00000003
157 };
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 #define KGSL_CONVERT_TO_MBPS(val)   (val*1000*1000U)
160 enum kgsl_deviceid {
161  KGSL_DEVICE_3D0 = 0x00000000,
162  KGSL_DEVICE_2D0 = 0x00000001,
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164  KGSL_DEVICE_2D1 = 0x00000002,
165  KGSL_DEVICE_MAX = 0x00000003
166 };
167 struct kgsl_devinfo {
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169  unsigned int device_id;
170  unsigned int chip_id;
171  unsigned int mmu_enabled;
172  unsigned long gmem_gpubaseaddr;
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  unsigned int gpu_id;
175  size_t gmem_sizebytes;
176 };
177 struct kgsl_devmemstore {
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  volatile unsigned int soptimestamp;
180  unsigned int sbz;
181  volatile unsigned int eoptimestamp;
182  unsigned int sbz2;
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  volatile unsigned int ts_cmp_enable;
185  unsigned int sbz3;
186  volatile unsigned int ref_wait_ts;
187  unsigned int sbz4;
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189  unsigned int current_context;
190  unsigned int sbz5;
191 };
192 #define KGSL_MEMSTORE_OFFSET(ctxt_id, field)   ((ctxt_id)*sizeof(struct kgsl_devmemstore) +   offsetof(struct kgsl_devmemstore, field))
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 enum kgsl_timestamp_type {
195  KGSL_TIMESTAMP_CONSUMED = 0x00000001,
196  KGSL_TIMESTAMP_RETIRED = 0x00000002,
197  KGSL_TIMESTAMP_QUEUED = 0x00000003,
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 };
200 enum kgsl_property_type {
201  KGSL_PROP_DEVICE_INFO = 0x00000001,
202  KGSL_PROP_DEVICE_SHADOW = 0x00000002,
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204  KGSL_PROP_DEVICE_POWER = 0x00000003,
205  KGSL_PROP_SHMEM = 0x00000004,
206  KGSL_PROP_SHMEM_APERTURES = 0x00000005,
207  KGSL_PROP_MMU_ENABLE = 0x00000006,
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  KGSL_PROP_INTERRUPT_WAITS = 0x00000007,
210  KGSL_PROP_VERSION = 0x00000008,
211  KGSL_PROP_GPU_RESET_STAT = 0x00000009,
212  KGSL_PROP_PWRCTRL = 0x0000000E,
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  KGSL_PROP_PWR_CONSTRAINT = 0x00000012,
215 };
216 struct kgsl_shadowprop {
217  unsigned long gpuaddr;
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219  size_t size;
220  unsigned int flags;
221 };
222 struct kgsl_version {
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  unsigned int drv_major;
225  unsigned int drv_minor;
226  unsigned int dev_major;
227  unsigned int dev_minor;
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 };
230 #define KGSL_PERFCOUNTER_GROUP_CP 0x0
231 #define KGSL_PERFCOUNTER_GROUP_RBBM 0x1
232 #define KGSL_PERFCOUNTER_GROUP_PC 0x2
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 #define KGSL_PERFCOUNTER_GROUP_VFD 0x3
235 #define KGSL_PERFCOUNTER_GROUP_HLSQ 0x4
236 #define KGSL_PERFCOUNTER_GROUP_VPC 0x5
237 #define KGSL_PERFCOUNTER_GROUP_TSE 0x6
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 #define KGSL_PERFCOUNTER_GROUP_RAS 0x7
240 #define KGSL_PERFCOUNTER_GROUP_UCHE 0x8
241 #define KGSL_PERFCOUNTER_GROUP_TP 0x9
242 #define KGSL_PERFCOUNTER_GROUP_SP 0xA
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #define KGSL_PERFCOUNTER_GROUP_RB 0xB
245 #define KGSL_PERFCOUNTER_GROUP_PWR 0xC
246 #define KGSL_PERFCOUNTER_GROUP_VBIF 0xD
247 #define KGSL_PERFCOUNTER_GROUP_VBIF_PWR 0xE
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 #define KGSL_PERFCOUNTER_GROUP_MH 0xF
250 #define KGSL_PERFCOUNTER_GROUP_PA_SU 0x10
251 #define KGSL_PERFCOUNTER_GROUP_SQ 0x11
252 #define KGSL_PERFCOUNTER_GROUP_SX 0x12
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254 #define KGSL_PERFCOUNTER_GROUP_TCF 0x13
255 #define KGSL_PERFCOUNTER_GROUP_TCM 0x14
256 #define KGSL_PERFCOUNTER_GROUP_TCR 0x15
257 #define KGSL_PERFCOUNTER_GROUP_L2 0x16
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 #define KGSL_PERFCOUNTER_GROUP_VSC 0x17
260 #define KGSL_PERFCOUNTER_GROUP_CCU 0x18
261 #define KGSL_PERFCOUNTER_GROUP_MAX 0x19
262 #define KGSL_PERFCOUNTER_NOT_USED 0xFFFFFFFF
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 #define KGSL_PERFCOUNTER_BROKEN 0xFFFFFFFE
265 struct kgsl_ibdesc {
266  unsigned long gpuaddr;
267  unsigned long __pad;
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269  size_t sizedwords;
270  unsigned int ctrl;
271 };
272 struct kgsl_cmdbatch_profiling_buffer {
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274  uint64_t wall_clock_s;
275  uint64_t wall_clock_ns;
276  uint64_t gpu_ticks_queued;
277  uint64_t gpu_ticks_submitted;
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279  uint64_t gpu_ticks_retired;
280 };
281 #define KGSL_IOC_TYPE 0x09
282 struct kgsl_device_getproperty {
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284  unsigned int type;
285  void __user *value;
286  size_t sizebytes;
287 };
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 #define IOCTL_KGSL_DEVICE_GETPROPERTY   _IOWR(KGSL_IOC_TYPE, 0x2, struct kgsl_device_getproperty)
290 struct kgsl_device_waittimestamp {
291  unsigned int timestamp;
292  unsigned int timeout;
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 };
295 #define IOCTL_KGSL_DEVICE_WAITTIMESTAMP   _IOW(KGSL_IOC_TYPE, 0x6, struct kgsl_device_waittimestamp)
296 struct kgsl_device_waittimestamp_ctxtid {
297  unsigned int context_id;
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299  unsigned int timestamp;
300  unsigned int timeout;
301 };
302 #define IOCTL_KGSL_DEVICE_WAITTIMESTAMP_CTXTID   _IOW(KGSL_IOC_TYPE, 0x7, struct kgsl_device_waittimestamp_ctxtid)
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 struct kgsl_ringbuffer_issueibcmds {
305  unsigned int drawctxt_id;
306  unsigned long ibdesc_addr;
307  unsigned int numibs;
308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309  unsigned int timestamp;
310  unsigned int flags;
311 };
312 #define IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS   _IOWR(KGSL_IOC_TYPE, 0x10, struct kgsl_ringbuffer_issueibcmds)
313 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314 struct kgsl_cmdstream_readtimestamp {
315  unsigned int type;
316  unsigned int timestamp;
317 };
318 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319 #define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP_OLD   _IOR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp)
320 #define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP   _IOWR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp)
321 struct kgsl_cmdstream_freememontimestamp {
322  unsigned long gpuaddr;
323 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324  unsigned int type;
325  unsigned int timestamp;
326 };
327 #define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP   _IOW(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp)
328 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329 #define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_OLD   _IOR(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp)
330 struct kgsl_drawctxt_create {
331  unsigned int flags;
332  unsigned int drawctxt_id;
333 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334 };
335 #define IOCTL_KGSL_DRAWCTXT_CREATE   _IOWR(KGSL_IOC_TYPE, 0x13, struct kgsl_drawctxt_create)
336 struct kgsl_drawctxt_destroy {
337  unsigned int drawctxt_id;
338 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339 };
340 #define IOCTL_KGSL_DRAWCTXT_DESTROY   _IOW(KGSL_IOC_TYPE, 0x14, struct kgsl_drawctxt_destroy)
341 struct kgsl_map_user_mem {
342  int fd;
343 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344  unsigned long gpuaddr;
345  size_t len;
346  size_t offset;
347  unsigned long hostptr;
348 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349  enum kgsl_user_mem_type memtype;
350  unsigned int flags;
351 };
352 #define IOCTL_KGSL_MAP_USER_MEM   _IOWR(KGSL_IOC_TYPE, 0x15, struct kgsl_map_user_mem)
353 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
354 struct kgsl_cmdstream_readtimestamp_ctxtid {
355  unsigned int context_id;
356  unsigned int type;
357  unsigned int timestamp;
358 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359 };
360 #define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP_CTXTID   _IOWR(KGSL_IOC_TYPE, 0x16, struct kgsl_cmdstream_readtimestamp_ctxtid)
361 struct kgsl_cmdstream_freememontimestamp_ctxtid {
362  unsigned int context_id;
363 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364  unsigned long gpuaddr;
365  unsigned int type;
366  unsigned int timestamp;
367 };
368 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369 #define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP_CTXTID   _IOW(KGSL_IOC_TYPE, 0x17,   struct kgsl_cmdstream_freememontimestamp_ctxtid)
370 struct kgsl_sharedmem_from_pmem {
371  int pmem_fd;
372  unsigned long gpuaddr;
373 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
374  unsigned int len;
375  unsigned int offset;
376 };
377 #define IOCTL_KGSL_SHAREDMEM_FROM_PMEM   _IOWR(KGSL_IOC_TYPE, 0x20, struct kgsl_sharedmem_from_pmem)
378 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
379 struct kgsl_sharedmem_free {
380  unsigned long gpuaddr;
381 };
382 #define IOCTL_KGSL_SHAREDMEM_FREE   _IOW(KGSL_IOC_TYPE, 0x21, struct kgsl_sharedmem_free)
383 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
384 struct kgsl_cff_user_event {
385  unsigned char cff_opcode;
386  unsigned int op1;
387  unsigned int op2;
388 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
389  unsigned int op3;
390  unsigned int op4;
391  unsigned int op5;
392  unsigned int __pad[2];
393 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
394 };
395 #define IOCTL_KGSL_CFF_USER_EVENT   _IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_cff_user_event)
396 struct kgsl_gmem_desc {
397  unsigned int x;
398 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
399  unsigned int y;
400  unsigned int width;
401  unsigned int height;
402  unsigned int pitch;
403 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
404 };
405 struct kgsl_buffer_desc {
406  void *hostptr;
407  unsigned long gpuaddr;
408 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
409  int size;
410  unsigned int format;
411  unsigned int pitch;
412  unsigned int enabled;
413 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
414 };
415 struct kgsl_bind_gmem_shadow {
416  unsigned int drawctxt_id;
417  struct kgsl_gmem_desc gmem_desc;
418 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
419  unsigned int shadow_x;
420  unsigned int shadow_y;
421  struct kgsl_buffer_desc shadow_buffer;
422  unsigned int buffer_id;
423 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
424 };
425 #define IOCTL_KGSL_DRAWCTXT_BIND_GMEM_SHADOW   _IOW(KGSL_IOC_TYPE, 0x22, struct kgsl_bind_gmem_shadow)
426 struct kgsl_sharedmem_from_vmalloc {
427  unsigned long gpuaddr;
428 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
429  unsigned int hostptr;
430  unsigned int flags;
431 };
432 #define IOCTL_KGSL_SHAREDMEM_FROM_VMALLOC   _IOWR(KGSL_IOC_TYPE, 0x23, struct kgsl_sharedmem_from_vmalloc)
433 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
434 #define IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE   _IOW(KGSL_IOC_TYPE, 0x24, struct kgsl_sharedmem_free)
435 struct kgsl_drawctxt_set_bin_base_offset {
436  unsigned int drawctxt_id;
437  unsigned int offset;
438 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
439 };
440 #define IOCTL_KGSL_DRAWCTXT_SET_BIN_BASE_OFFSET   _IOW(KGSL_IOC_TYPE, 0x25, struct kgsl_drawctxt_set_bin_base_offset)
441 enum kgsl_cmdwindow_type {
442  KGSL_CMDWINDOW_MIN = 0x00000000,
443 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
444  KGSL_CMDWINDOW_2D = 0x00000000,
445  KGSL_CMDWINDOW_3D = 0x00000001,
446  KGSL_CMDWINDOW_MMU = 0x00000002,
447  KGSL_CMDWINDOW_ARBITER = 0x000000FF,
448 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
449  KGSL_CMDWINDOW_MAX = 0x000000FF,
450 };
451 struct kgsl_cmdwindow_write {
452  enum kgsl_cmdwindow_type target;
453 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
454  unsigned int addr;
455  unsigned int data;
456 };
457 #define IOCTL_KGSL_CMDWINDOW_WRITE   _IOW(KGSL_IOC_TYPE, 0x2e, struct kgsl_cmdwindow_write)
458 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
459 struct kgsl_gpumem_alloc {
460  unsigned long gpuaddr;
461  size_t size;
462  unsigned int flags;
463 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
464 };
465 #define IOCTL_KGSL_GPUMEM_ALLOC   _IOWR(KGSL_IOC_TYPE, 0x2f, struct kgsl_gpumem_alloc)
466 struct kgsl_cff_syncmem {
467  unsigned long gpuaddr;
468 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
469  size_t len;
470  unsigned int __pad[2];
471 };
472 #define IOCTL_KGSL_CFF_SYNCMEM   _IOW(KGSL_IOC_TYPE, 0x30, struct kgsl_cff_syncmem)
473 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
474 struct kgsl_timestamp_event {
475  int type;
476  unsigned int timestamp;
477  unsigned int context_id;
478 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
479  void __user *priv;
480  size_t len;
481 };
482 #define IOCTL_KGSL_TIMESTAMP_EVENT_OLD   _IOW(KGSL_IOC_TYPE, 0x31, struct kgsl_timestamp_event)
483 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
484 #define KGSL_TIMESTAMP_EVENT_GENLOCK 1
485 struct kgsl_timestamp_event_genlock {
486  int handle;
487 };
488 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
489 #define KGSL_TIMESTAMP_EVENT_FENCE 2
490 struct kgsl_timestamp_event_fence {
491  int fence_fd;
492 };
493 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
494 #define IOCTL_KGSL_SETPROPERTY   _IOW(KGSL_IOC_TYPE, 0x32, struct kgsl_device_getproperty)
495 #define IOCTL_KGSL_TIMESTAMP_EVENT   _IOWR(KGSL_IOC_TYPE, 0x33, struct kgsl_timestamp_event)
496 struct kgsl_gpumem_alloc_id {
497  unsigned int id;
498 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
499  unsigned int flags;
500  size_t size;
501  size_t mmapsize;
502  unsigned long gpuaddr;
503 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
504  unsigned long __pad[2];
505 };
506 #define IOCTL_KGSL_GPUMEM_ALLOC_ID   _IOWR(KGSL_IOC_TYPE, 0x34, struct kgsl_gpumem_alloc_id)
507 struct kgsl_gpumem_free_id {
508 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
509  unsigned int id;
510  unsigned int __pad;
511 };
512 #define IOCTL_KGSL_GPUMEM_FREE_ID   _IOWR(KGSL_IOC_TYPE, 0x35, struct kgsl_gpumem_free_id)
513 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
514 struct kgsl_gpumem_get_info {
515  unsigned long gpuaddr;
516  unsigned int id;
517  unsigned int flags;
518 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
519  size_t size;
520  size_t mmapsize;
521  unsigned long useraddr;
522  unsigned long __pad[4];
523 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
524 };
525 #define IOCTL_KGSL_GPUMEM_GET_INFO  _IOWR(KGSL_IOC_TYPE, 0x36, struct kgsl_gpumem_get_info)
526 struct kgsl_gpumem_sync_cache {
527  unsigned long gpuaddr;
528 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
529  unsigned int id;
530  unsigned int op;
531  size_t offset;
532  size_t length;
533 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
534 };
535 #define KGSL_GPUMEM_CACHE_CLEAN (1 << 0)
536 #define KGSL_GPUMEM_CACHE_TO_GPU KGSL_GPUMEM_CACHE_CLEAN
537 #define KGSL_GPUMEM_CACHE_INV (1 << 1)
538 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
539 #define KGSL_GPUMEM_CACHE_FROM_GPU KGSL_GPUMEM_CACHE_INV
540 #define KGSL_GPUMEM_CACHE_FLUSH   (KGSL_GPUMEM_CACHE_CLEAN | KGSL_GPUMEM_CACHE_INV)
541 #define KGSL_GPUMEM_CACHE_RANGE (1 << 31U)
542 #define IOCTL_KGSL_GPUMEM_SYNC_CACHE   _IOW(KGSL_IOC_TYPE, 0x37, struct kgsl_gpumem_sync_cache)
543 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
544 struct kgsl_perfcounter_get {
545  unsigned int groupid;
546  unsigned int countable;
547  unsigned int offset;
548 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
549  unsigned int offset_hi;
550  unsigned int __pad;
551 };
552 #define IOCTL_KGSL_PERFCOUNTER_GET   _IOWR(KGSL_IOC_TYPE, 0x38, struct kgsl_perfcounter_get)
553 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
554 struct kgsl_perfcounter_put {
555  unsigned int groupid;
556  unsigned int countable;
557  unsigned int __pad[2];
558 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
559 };
560 #define IOCTL_KGSL_PERFCOUNTER_PUT   _IOW(KGSL_IOC_TYPE, 0x39, struct kgsl_perfcounter_put)
561 struct kgsl_perfcounter_query {
562  unsigned int groupid;
563 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
564  unsigned int __user *countables;
565  unsigned int count;
566  unsigned int max_counters;
567  unsigned int __pad[2];
568 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
569 };
570 #define IOCTL_KGSL_PERFCOUNTER_QUERY   _IOWR(KGSL_IOC_TYPE, 0x3A, struct kgsl_perfcounter_query)
571 struct kgsl_perfcounter_read_group {
572  unsigned int groupid;
573 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
574  unsigned int countable;
575  unsigned long long value;
576 };
577 struct kgsl_perfcounter_read {
578 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
579  struct kgsl_perfcounter_read_group __user *reads;
580  unsigned int count;
581  unsigned int __pad[2];
582 };
583 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
584 #define IOCTL_KGSL_PERFCOUNTER_READ   _IOWR(KGSL_IOC_TYPE, 0x3B, struct kgsl_perfcounter_read)
585 struct kgsl_gpumem_sync_cache_bulk {
586  unsigned int __user *id_list;
587  unsigned int count;
588 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
589  unsigned int op;
590  unsigned int __pad[2];
591 };
592 #define IOCTL_KGSL_GPUMEM_SYNC_CACHE_BULK   _IOWR(KGSL_IOC_TYPE, 0x3C, struct kgsl_gpumem_sync_cache_bulk)
593 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
594 struct kgsl_cmd_syncpoint_timestamp {
595  unsigned int context_id;
596  unsigned int timestamp;
597 };
598 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
599 #define KGSL_CMD_SYNCPOINT_TYPE_TIMESTAMP 0
600 struct kgsl_cmd_syncpoint_fence {
601  int fd;
602 };
603 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
604 #define KGSL_CMD_SYNCPOINT_TYPE_FENCE 1
605 struct kgsl_cmd_syncpoint {
606  int type;
607  void __user *priv;
608 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
609  size_t size;
610 };
611 #define KGSL_IBDESC_MEMLIST 0x1
612 #define KGSL_IBDESC_PROFILING_BUFFER 0x2
613 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
614 struct kgsl_submit_commands {
615  unsigned int context_id;
616  unsigned int flags;
617  struct kgsl_ibdesc __user *cmdlist;
618 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
619  unsigned int numcmds;
620  struct kgsl_cmd_syncpoint __user *synclist;
621  unsigned int numsyncs;
622  unsigned int timestamp;
623 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
624  unsigned int __pad[4];
625 };
626 #define IOCTL_KGSL_SUBMIT_COMMANDS   _IOWR(KGSL_IOC_TYPE, 0x3D, struct kgsl_submit_commands)
627 struct kgsl_device_constraint {
628 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
629  unsigned int type;
630  unsigned int context_id;
631  void __user *data;
632  size_t size;
633 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
634 };
635 #define KGSL_CONSTRAINT_NONE 0
636 #define KGSL_CONSTRAINT_PWRLEVEL 1
637 #define KGSL_CONSTRAINT_PWR_MIN 0
638 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
639 #define KGSL_CONSTRAINT_PWR_MAX 1
640 struct kgsl_device_constraint_pwrlevel {
641  unsigned int level;
642 };
643 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
644 struct kgsl_syncsource_create {
645  unsigned int id;
646  unsigned int __pad[3];
647 };
648 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
649 #define IOCTL_KGSL_SYNCSOURCE_CREATE   _IOWR(KGSL_IOC_TYPE, 0x40, struct kgsl_syncsource_create)
650 struct kgsl_syncsource_destroy {
651  unsigned int id;
652  unsigned int __pad[3];
653 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
654 };
655 #define IOCTL_KGSL_SYNCSOURCE_DESTROY   _IOWR(KGSL_IOC_TYPE, 0x41, struct kgsl_syncsource_destroy)
656 struct kgsl_syncsource_create_fence {
657  unsigned int id;
658 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
659  int fence_fd;
660  unsigned int __pad[4];
661 };
662 #define IOCTL_KGSL_SYNCSOURCE_CREATE_FENCE   _IOWR(KGSL_IOC_TYPE, 0x42, struct kgsl_syncsource_create_fence)
663 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
664 struct kgsl_syncsource_signal_fence {
665  unsigned int id;
666  int fence_fd;
667  unsigned int __pad[4];
668 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
669 };
670 #define IOCTL_KGSL_SYNCSOURCE_SIGNAL_FENCE   _IOWR(KGSL_IOC_TYPE, 0x43, struct kgsl_syncsource_signal_fence)
671 #endif
672