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 _MSM_KGSL_H 20 #define _MSM_KGSL_H 21 #define KGSL_CONTEXT_SAVE_GMEM 1 22 #define KGSL_CONTEXT_NO_GMEM_ALLOC 2 23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 24 #define KGSL_FLAGS_NORMALMODE 0x00000000 25 #define KGSL_FLAGS_SAFEMODE 0x00000001 26 #define KGSL_FLAGS_INITIALIZED0 0x00000002 27 #define KGSL_FLAGS_INITIALIZED 0x00000004 28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 29 #define KGSL_FLAGS_STARTED 0x00000008 30 #define KGSL_FLAGS_ACTIVE 0x00000010 31 #define KGSL_FLAGS_RESERVED0 0x00000020 32 #define KGSL_FLAGS_RESERVED1 0x00000040 33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 34 #define KGSL_FLAGS_RESERVED2 0x00000080 35 enum kgsl_deviceid { 36 KGSL_DEVICE_ANY = 0x00000000, 37 KGSL_DEVICE_YAMATO = 0x00000001, 38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 39 KGSL_DEVICE_G12 = 0x00000002, 40 KGSL_DEVICE_MAX = 0x00000002 41 }; 42 struct kgsl_devinfo { 43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 44 unsigned int device_id; 45 unsigned int chip_id; 46 unsigned int mmu_enabled; 47 unsigned int gmem_gpubaseaddr; 48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 49 unsigned int gmem_hostbaseaddr; 50 unsigned int gmem_sizebytes; 51 }; 52 struct kgsl_devmemstore { 53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 54 volatile unsigned int soptimestamp; 55 unsigned int sbz; 56 volatile unsigned int eoptimestamp; 57 unsigned int sbz2; 58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 59 volatile unsigned int ts_cmp_enable; 60 unsigned int sbz3; 61 volatile unsigned int ref_wait_ts; 62 unsigned int sbz4; 63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 64 }; 65 #define KGSL_DEVICE_MEMSTORE_OFFSET(field) offsetof(struct kgsl_devmemstore, field) 66 enum kgsl_timestamp_type { 67 KGSL_TIMESTAMP_CONSUMED = 0x00000001, 68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 69 KGSL_TIMESTAMP_RETIRED = 0x00000002, 70 KGSL_TIMESTAMP_MAX = 0x00000002, 71 }; 72 enum kgsl_property_type { 73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 74 KGSL_PROP_DEVICE_INFO = 0x00000001, 75 KGSL_PROP_DEVICE_SHADOW = 0x00000002, 76 KGSL_PROP_DEVICE_POWER = 0x00000003, 77 KGSL_PROP_SHMEM = 0x00000004, 78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 79 KGSL_PROP_SHMEM_APERTURES = 0x00000005, 80 KGSL_PROP_MMU_ENABLE = 0x00000006, 81 KGSL_PROP_INTERRUPT_WAITS = 0x00000007, 82 }; 83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 84 struct kgsl_shadowprop { 85 unsigned int gpuaddr; 86 unsigned int size; 87 unsigned int flags; 88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 89 }; 90 #define KGSL_IOC_TYPE 0x09 91 struct kgsl_device_getproperty { 92 unsigned int type; 93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 94 void *value; 95 unsigned int sizebytes; 96 }; 97 #define IOCTL_KGSL_DEVICE_GETPROPERTY _IOWR(KGSL_IOC_TYPE, 0x2, struct kgsl_device_getproperty) 98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 99 struct kgsl_device_regread { 100 unsigned int offsetwords; 101 unsigned int value; 102 }; 103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 104 #define IOCTL_KGSL_DEVICE_REGREAD _IOWR(KGSL_IOC_TYPE, 0x3, struct kgsl_device_regread) 105 struct kgsl_device_waittimestamp { 106 unsigned int timestamp; 107 unsigned int timeout; 108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 109 }; 110 #define IOCTL_KGSL_DEVICE_WAITTIMESTAMP _IOW(KGSL_IOC_TYPE, 0x6, struct kgsl_device_waittimestamp) 111 struct kgsl_ringbuffer_issueibcmds { 112 unsigned int drawctxt_id; 113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 114 unsigned int ibaddr; 115 unsigned int sizedwords; 116 unsigned int timestamp; 117 unsigned int flags; 118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 119 }; 120 #define IOCTL_KGSL_RINGBUFFER_ISSUEIBCMDS _IOWR(KGSL_IOC_TYPE, 0x10, struct kgsl_ringbuffer_issueibcmds) 121 struct kgsl_cmdstream_readtimestamp { 122 unsigned int type; 123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 124 unsigned int timestamp; 125 }; 126 #define IOCTL_KGSL_CMDSTREAM_READTIMESTAMP _IOR(KGSL_IOC_TYPE, 0x11, struct kgsl_cmdstream_readtimestamp) 127 struct kgsl_cmdstream_freememontimestamp { 128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 129 unsigned int gpuaddr; 130 unsigned int type; 131 unsigned int timestamp; 132 }; 133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 134 #define IOCTL_KGSL_CMDSTREAM_FREEMEMONTIMESTAMP _IOR(KGSL_IOC_TYPE, 0x12, struct kgsl_cmdstream_freememontimestamp) 135 struct kgsl_drawctxt_create { 136 unsigned int flags; 137 unsigned int drawctxt_id; 138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 139 }; 140 #define IOCTL_KGSL_DRAWCTXT_CREATE _IOWR(KGSL_IOC_TYPE, 0x13, struct kgsl_drawctxt_create) 141 struct kgsl_drawctxt_destroy { 142 unsigned int drawctxt_id; 143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 144 }; 145 #define IOCTL_KGSL_DRAWCTXT_DESTROY _IOW(KGSL_IOC_TYPE, 0x14, struct kgsl_drawctxt_destroy) 146 struct kgsl_sharedmem_from_pmem { 147 int pmem_fd; 148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 149 unsigned int gpuaddr; 150 unsigned int len; 151 unsigned int offset; 152 }; 153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 154 #define IOCTL_KGSL_SHAREDMEM_FROM_PMEM _IOWR(KGSL_IOC_TYPE, 0x20, struct kgsl_sharedmem_from_pmem) 155 struct kgsl_sharedmem_free { 156 unsigned int gpuaddr; 157 }; 158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 159 #define IOCTL_KGSL_SHAREDMEM_FREE _IOW(KGSL_IOC_TYPE, 0x21, struct kgsl_sharedmem_free) 160 struct kgsl_gmem_desc { 161 unsigned int x; 162 unsigned int y; 163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 164 unsigned int width; 165 unsigned int height; 166 unsigned int pitch; 167 }; 168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 169 struct kgsl_buffer_desc { 170 void *hostptr; 171 unsigned int gpuaddr; 172 int size; 173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 174 unsigned int format; 175 unsigned int pitch; 176 unsigned int enabled; 177 }; 178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 179 struct kgsl_bind_gmem_shadow { 180 unsigned int drawctxt_id; 181 struct kgsl_gmem_desc gmem_desc; 182 unsigned int shadow_x; 183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 184 unsigned int shadow_y; 185 struct kgsl_buffer_desc shadow_buffer; 186 unsigned int buffer_id; 187 }; 188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 189 #define IOCTL_KGSL_DRAWCTXT_BIND_GMEM_SHADOW _IOW(KGSL_IOC_TYPE, 0x22, struct kgsl_bind_gmem_shadow) 190 struct kgsl_sharedmem_from_vmalloc { 191 unsigned int gpuaddr; 192 unsigned int hostptr; 193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 194 int force_no_low_watermark; 195 }; 196 #define IOCTL_KGSL_SHAREDMEM_FROM_VMALLOC _IOWR(KGSL_IOC_TYPE, 0x23, struct kgsl_sharedmem_from_vmalloc) 197 #define IOCTL_KGSL_SHAREDMEM_FLUSH_CACHE _IOW(KGSL_IOC_TYPE, 0x24, struct kgsl_sharedmem_free) 198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 199 struct kgsl_drawctxt_set_bin_base_offset { 200 unsigned int drawctxt_id; 201 unsigned int offset; 202 }; 203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 204 #define IOCTL_KGSL_DRAWCTXT_SET_BIN_BASE_OFFSET _IOW(KGSL_IOC_TYPE, 0x25, struct kgsl_drawctxt_set_bin_base_offset) 205 #endif 206