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