Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 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 _V3D_DRM_H_ |
| 20 | #define _V3D_DRM_H_ |
| 21 | #include "drm.h" |
| 22 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 23 | extern "C" { |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 24 | #endif |
| 25 | #define DRM_V3D_SUBMIT_CL 0x00 |
| 26 | #define DRM_V3D_WAIT_BO 0x01 |
| 27 | #define DRM_V3D_CREATE_BO 0x02 |
| 28 | #define DRM_V3D_MMAP_BO 0x03 |
| 29 | #define DRM_V3D_GET_PARAM 0x04 |
| 30 | #define DRM_V3D_GET_BO_OFFSET 0x05 |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 31 | #define DRM_V3D_SUBMIT_TFU 0x06 |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 32 | #define DRM_V3D_SUBMIT_CSD 0x07 |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame^] | 33 | #define DRM_V3D_PERFMON_CREATE 0x08 |
| 34 | #define DRM_V3D_PERFMON_DESTROY 0x09 |
| 35 | #define DRM_V3D_PERFMON_GET_VALUES 0x0a |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 36 | #define DRM_IOCTL_V3D_SUBMIT_CL DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CL, struct drm_v3d_submit_cl) |
| 37 | #define DRM_IOCTL_V3D_WAIT_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_WAIT_BO, struct drm_v3d_wait_bo) |
| 38 | #define DRM_IOCTL_V3D_CREATE_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_CREATE_BO, struct drm_v3d_create_bo) |
| 39 | #define DRM_IOCTL_V3D_MMAP_BO DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_MMAP_BO, struct drm_v3d_mmap_bo) |
| 40 | #define DRM_IOCTL_V3D_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_PARAM, struct drm_v3d_get_param) |
| 41 | #define DRM_IOCTL_V3D_GET_BO_OFFSET DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_GET_BO_OFFSET, struct drm_v3d_get_bo_offset) |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 42 | #define DRM_IOCTL_V3D_SUBMIT_TFU DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_TFU, struct drm_v3d_submit_tfu) |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 43 | #define DRM_IOCTL_V3D_SUBMIT_CSD DRM_IOW(DRM_COMMAND_BASE + DRM_V3D_SUBMIT_CSD, struct drm_v3d_submit_csd) |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame^] | 44 | #define DRM_IOCTL_V3D_PERFMON_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_CREATE, struct drm_v3d_perfmon_create) |
| 45 | #define DRM_IOCTL_V3D_PERFMON_DESTROY DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_DESTROY, struct drm_v3d_perfmon_destroy) |
| 46 | #define DRM_IOCTL_V3D_PERFMON_GET_VALUES DRM_IOWR(DRM_COMMAND_BASE + DRM_V3D_PERFMON_GET_VALUES, struct drm_v3d_perfmon_get_values) |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 47 | #define DRM_V3D_SUBMIT_CL_FLUSH_CACHE 0x01 |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 48 | struct drm_v3d_submit_cl { |
| 49 | __u32 bcl_start; |
| 50 | __u32 bcl_end; |
| 51 | __u32 rcl_start; |
| 52 | __u32 rcl_end; |
| 53 | __u32 in_sync_bcl; |
| 54 | __u32 in_sync_rcl; |
| 55 | __u32 out_sync; |
| 56 | __u32 qma; |
| 57 | __u32 qms; |
| 58 | __u32 qts; |
| 59 | __u64 bo_handles; |
| 60 | __u32 bo_handle_count; |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 61 | __u32 flags; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame^] | 62 | __u32 perfmon_id; |
| 63 | __u32 pad; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 64 | }; |
| 65 | struct drm_v3d_wait_bo { |
| 66 | __u32 handle; |
| 67 | __u32 pad; |
| 68 | __u64 timeout_ns; |
| 69 | }; |
| 70 | struct drm_v3d_create_bo { |
| 71 | __u32 size; |
| 72 | __u32 flags; |
| 73 | __u32 handle; |
| 74 | __u32 offset; |
| 75 | }; |
| 76 | struct drm_v3d_mmap_bo { |
| 77 | __u32 handle; |
| 78 | __u32 flags; |
| 79 | __u64 offset; |
| 80 | }; |
| 81 | enum drm_v3d_param { |
| 82 | DRM_V3D_PARAM_V3D_UIFCFG, |
| 83 | DRM_V3D_PARAM_V3D_HUB_IDENT1, |
| 84 | DRM_V3D_PARAM_V3D_HUB_IDENT2, |
| 85 | DRM_V3D_PARAM_V3D_HUB_IDENT3, |
| 86 | DRM_V3D_PARAM_V3D_CORE0_IDENT0, |
| 87 | DRM_V3D_PARAM_V3D_CORE0_IDENT1, |
| 88 | DRM_V3D_PARAM_V3D_CORE0_IDENT2, |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 89 | DRM_V3D_PARAM_SUPPORTS_TFU, |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 90 | DRM_V3D_PARAM_SUPPORTS_CSD, |
Christopher Ferris | d32ca14 | 2020-02-04 16:16:51 -0800 | [diff] [blame] | 91 | DRM_V3D_PARAM_SUPPORTS_CACHE_FLUSH, |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame^] | 92 | DRM_V3D_PARAM_SUPPORTS_PERFMON, |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 93 | }; |
| 94 | struct drm_v3d_get_param { |
| 95 | __u32 param; |
| 96 | __u32 pad; |
| 97 | __u64 value; |
| 98 | }; |
| 99 | struct drm_v3d_get_bo_offset { |
| 100 | __u32 handle; |
| 101 | __u32 offset; |
| 102 | }; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 103 | struct drm_v3d_submit_tfu { |
| 104 | __u32 icfg; |
| 105 | __u32 iia; |
| 106 | __u32 iis; |
| 107 | __u32 ica; |
| 108 | __u32 iua; |
| 109 | __u32 ioa; |
| 110 | __u32 ios; |
| 111 | __u32 coef[4]; |
| 112 | __u32 bo_handles[4]; |
| 113 | __u32 in_sync; |
| 114 | __u32 out_sync; |
| 115 | }; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 116 | struct drm_v3d_submit_csd { |
| 117 | __u32 cfg[7]; |
| 118 | __u32 coef[4]; |
| 119 | __u64 bo_handles; |
| 120 | __u32 bo_handle_count; |
| 121 | __u32 in_sync; |
| 122 | __u32 out_sync; |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame^] | 123 | __u32 perfmon_id; |
| 124 | }; |
| 125 | enum { |
| 126 | V3D_PERFCNT_FEP_VALID_PRIMTS_NO_PIXELS, |
| 127 | V3D_PERFCNT_FEP_VALID_PRIMS, |
| 128 | V3D_PERFCNT_FEP_EZ_NFCLIP_QUADS, |
| 129 | V3D_PERFCNT_FEP_VALID_QUADS, |
| 130 | V3D_PERFCNT_TLB_QUADS_STENCIL_FAIL, |
| 131 | V3D_PERFCNT_TLB_QUADS_STENCILZ_FAIL, |
| 132 | V3D_PERFCNT_TLB_QUADS_STENCILZ_PASS, |
| 133 | V3D_PERFCNT_TLB_QUADS_ZERO_COV, |
| 134 | V3D_PERFCNT_TLB_QUADS_NONZERO_COV, |
| 135 | V3D_PERFCNT_TLB_QUADS_WRITTEN, |
| 136 | V3D_PERFCNT_PTB_PRIM_VIEWPOINT_DISCARD, |
| 137 | V3D_PERFCNT_PTB_PRIM_CLIP, |
| 138 | V3D_PERFCNT_PTB_PRIM_REV, |
| 139 | V3D_PERFCNT_QPU_IDLE_CYCLES, |
| 140 | V3D_PERFCNT_QPU_ACTIVE_CYCLES_VERTEX_COORD_USER, |
| 141 | V3D_PERFCNT_QPU_ACTIVE_CYCLES_FRAG, |
| 142 | V3D_PERFCNT_QPU_CYCLES_VALID_INSTR, |
| 143 | V3D_PERFCNT_QPU_CYCLES_TMU_STALL, |
| 144 | V3D_PERFCNT_QPU_CYCLES_SCOREBOARD_STALL, |
| 145 | V3D_PERFCNT_QPU_CYCLES_VARYINGS_STALL, |
| 146 | V3D_PERFCNT_QPU_IC_HIT, |
| 147 | V3D_PERFCNT_QPU_IC_MISS, |
| 148 | V3D_PERFCNT_QPU_UC_HIT, |
| 149 | V3D_PERFCNT_QPU_UC_MISS, |
| 150 | V3D_PERFCNT_TMU_TCACHE_ACCESS, |
| 151 | V3D_PERFCNT_TMU_TCACHE_MISS, |
| 152 | V3D_PERFCNT_VPM_VDW_STALL, |
| 153 | V3D_PERFCNT_VPM_VCD_STALL, |
| 154 | V3D_PERFCNT_BIN_ACTIVE, |
| 155 | V3D_PERFCNT_RDR_ACTIVE, |
| 156 | V3D_PERFCNT_L2T_HITS, |
| 157 | V3D_PERFCNT_L2T_MISSES, |
| 158 | V3D_PERFCNT_CYCLE_COUNT, |
| 159 | V3D_PERFCNT_QPU_CYCLES_STALLED_VERTEX_COORD_USER, |
| 160 | V3D_PERFCNT_QPU_CYCLES_STALLED_FRAGMENT, |
| 161 | V3D_PERFCNT_PTB_PRIMS_BINNED, |
| 162 | V3D_PERFCNT_AXI_WRITES_WATCH_0, |
| 163 | V3D_PERFCNT_AXI_READS_WATCH_0, |
| 164 | V3D_PERFCNT_AXI_WRITE_STALLS_WATCH_0, |
| 165 | V3D_PERFCNT_AXI_READ_STALLS_WATCH_0, |
| 166 | V3D_PERFCNT_AXI_WRITE_BYTES_WATCH_0, |
| 167 | V3D_PERFCNT_AXI_READ_BYTES_WATCH_0, |
| 168 | V3D_PERFCNT_AXI_WRITES_WATCH_1, |
| 169 | V3D_PERFCNT_AXI_READS_WATCH_1, |
| 170 | V3D_PERFCNT_AXI_WRITE_STALLS_WATCH_1, |
| 171 | V3D_PERFCNT_AXI_READ_STALLS_WATCH_1, |
| 172 | V3D_PERFCNT_AXI_WRITE_BYTES_WATCH_1, |
| 173 | V3D_PERFCNT_AXI_READ_BYTES_WATCH_1, |
| 174 | V3D_PERFCNT_TLB_PARTIAL_QUADS, |
| 175 | V3D_PERFCNT_TMU_CONFIG_ACCESSES, |
| 176 | V3D_PERFCNT_L2T_NO_ID_STALL, |
| 177 | V3D_PERFCNT_L2T_COM_QUE_STALL, |
| 178 | V3D_PERFCNT_L2T_TMU_WRITES, |
| 179 | V3D_PERFCNT_TMU_ACTIVE_CYCLES, |
| 180 | V3D_PERFCNT_TMU_STALLED_CYCLES, |
| 181 | V3D_PERFCNT_CLE_ACTIVE, |
| 182 | V3D_PERFCNT_L2T_TMU_READS, |
| 183 | V3D_PERFCNT_L2T_CLE_READS, |
| 184 | V3D_PERFCNT_L2T_VCD_READS, |
| 185 | V3D_PERFCNT_L2T_TMUCFG_READS, |
| 186 | V3D_PERFCNT_L2T_SLC0_READS, |
| 187 | V3D_PERFCNT_L2T_SLC1_READS, |
| 188 | V3D_PERFCNT_L2T_SLC2_READS, |
| 189 | V3D_PERFCNT_L2T_TMU_W_MISSES, |
| 190 | V3D_PERFCNT_L2T_TMU_R_MISSES, |
| 191 | V3D_PERFCNT_L2T_CLE_MISSES, |
| 192 | V3D_PERFCNT_L2T_VCD_MISSES, |
| 193 | V3D_PERFCNT_L2T_TMUCFG_MISSES, |
| 194 | V3D_PERFCNT_L2T_SLC0_MISSES, |
| 195 | V3D_PERFCNT_L2T_SLC1_MISSES, |
| 196 | V3D_PERFCNT_L2T_SLC2_MISSES, |
| 197 | V3D_PERFCNT_CORE_MEM_WRITES, |
| 198 | V3D_PERFCNT_L2T_MEM_WRITES, |
| 199 | V3D_PERFCNT_PTB_MEM_WRITES, |
| 200 | V3D_PERFCNT_TLB_MEM_WRITES, |
| 201 | V3D_PERFCNT_CORE_MEM_READS, |
| 202 | V3D_PERFCNT_L2T_MEM_READS, |
| 203 | V3D_PERFCNT_PTB_MEM_READS, |
| 204 | V3D_PERFCNT_PSE_MEM_READS, |
| 205 | V3D_PERFCNT_TLB_MEM_READS, |
| 206 | V3D_PERFCNT_GMP_MEM_READS, |
| 207 | V3D_PERFCNT_PTB_W_MEM_WORDS, |
| 208 | V3D_PERFCNT_TLB_W_MEM_WORDS, |
| 209 | V3D_PERFCNT_PSE_R_MEM_WORDS, |
| 210 | V3D_PERFCNT_TLB_R_MEM_WORDS, |
| 211 | V3D_PERFCNT_TMU_MRU_HITS, |
| 212 | V3D_PERFCNT_COMPUTE_ACTIVE, |
| 213 | V3D_PERFCNT_NUM, |
| 214 | }; |
| 215 | #define DRM_V3D_MAX_PERF_COUNTERS 32 |
| 216 | struct drm_v3d_perfmon_create { |
| 217 | __u32 id; |
| 218 | __u32 ncounters; |
| 219 | __u8 counters[DRM_V3D_MAX_PERF_COUNTERS]; |
| 220 | }; |
| 221 | struct drm_v3d_perfmon_destroy { |
| 222 | __u32 id; |
| 223 | }; |
| 224 | struct drm_v3d_perfmon_get_values { |
| 225 | __u32 id; |
| 226 | __u32 pad; |
| 227 | __u64 values_ptr; |
Christopher Ferris | b8a95e2 | 2019-10-02 18:29:20 -0700 | [diff] [blame] | 228 | }; |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 229 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 230 | } |
Christopher Ferris | 9ce2884 | 2018-10-25 12:11:39 -0700 | [diff] [blame] | 231 | #endif |
| 232 | #endif |