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