Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -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 __ETNAVIV_DRM_H__ |
| 20 | #define __ETNAVIV_DRM_H__ |
| 21 | #include "drm.h" |
| 22 | #ifdef __cplusplus |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 23 | #endif |
| 24 | struct drm_etnaviv_timespec { |
| 25 | __s64 tv_sec; |
| 26 | __s64 tv_nsec; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 27 | }; |
| 28 | #define ETNAVIV_PARAM_GPU_MODEL 0x01 |
| 29 | #define ETNAVIV_PARAM_GPU_REVISION 0x02 |
| 30 | #define ETNAVIV_PARAM_GPU_FEATURES_0 0x03 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 31 | #define ETNAVIV_PARAM_GPU_FEATURES_1 0x04 |
| 32 | #define ETNAVIV_PARAM_GPU_FEATURES_2 0x05 |
| 33 | #define ETNAVIV_PARAM_GPU_FEATURES_3 0x06 |
| 34 | #define ETNAVIV_PARAM_GPU_FEATURES_4 0x07 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 35 | #define ETNAVIV_PARAM_GPU_FEATURES_5 0x08 |
| 36 | #define ETNAVIV_PARAM_GPU_FEATURES_6 0x09 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 37 | #define ETNAVIV_PARAM_GPU_FEATURES_7 0x0a |
| 38 | #define ETNAVIV_PARAM_GPU_FEATURES_8 0x0b |
| 39 | #define ETNAVIV_PARAM_GPU_FEATURES_9 0x0c |
| 40 | #define ETNAVIV_PARAM_GPU_FEATURES_10 0x0d |
| 41 | #define ETNAVIV_PARAM_GPU_FEATURES_11 0x0e |
| 42 | #define ETNAVIV_PARAM_GPU_FEATURES_12 0x0f |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 43 | #define ETNAVIV_PARAM_GPU_STREAM_COUNT 0x10 |
| 44 | #define ETNAVIV_PARAM_GPU_REGISTER_MAX 0x11 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 45 | #define ETNAVIV_PARAM_GPU_THREAD_COUNT 0x12 |
| 46 | #define ETNAVIV_PARAM_GPU_VERTEX_CACHE_SIZE 0x13 |
| 47 | #define ETNAVIV_PARAM_GPU_SHADER_CORE_COUNT 0x14 |
| 48 | #define ETNAVIV_PARAM_GPU_PIXEL_PIPES 0x15 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 49 | #define ETNAVIV_PARAM_GPU_VERTEX_OUTPUT_BUFFER_SIZE 0x16 |
| 50 | #define ETNAVIV_PARAM_GPU_BUFFER_SIZE 0x17 |
| 51 | #define ETNAVIV_PARAM_GPU_INSTRUCTION_COUNT 0x18 |
| 52 | #define ETNAVIV_PARAM_GPU_NUM_CONSTANTS 0x19 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 53 | #define ETNAVIV_PARAM_GPU_NUM_VARYINGS 0x1a |
| 54 | #define ETNA_MAX_PIPES 4 |
| 55 | struct drm_etnaviv_param { |
| 56 | __u32 pipe; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 57 | __u32 param; |
| 58 | __u64 value; |
| 59 | }; |
| 60 | #define ETNA_BO_CACHE_MASK 0x000f0000 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 61 | #define ETNA_BO_CACHED 0x00010000 |
| 62 | #define ETNA_BO_WC 0x00020000 |
| 63 | #define ETNA_BO_UNCACHED 0x00040000 |
| 64 | #define ETNA_BO_FORCE_MMU 0x00100000 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 65 | struct drm_etnaviv_gem_new { |
| 66 | __u64 size; |
| 67 | __u32 flags; |
| 68 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 69 | }; |
| 70 | struct drm_etnaviv_gem_info { |
| 71 | __u32 handle; |
| 72 | __u32 pad; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 73 | __u64 offset; |
| 74 | }; |
| 75 | #define ETNA_PREP_READ 0x01 |
| 76 | #define ETNA_PREP_WRITE 0x02 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 77 | #define ETNA_PREP_NOSYNC 0x04 |
| 78 | struct drm_etnaviv_gem_cpu_prep { |
| 79 | __u32 handle; |
| 80 | __u32 op; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 81 | struct drm_etnaviv_timespec timeout; |
| 82 | }; |
| 83 | struct drm_etnaviv_gem_cpu_fini { |
| 84 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 85 | __u32 flags; |
| 86 | }; |
| 87 | struct drm_etnaviv_gem_submit_reloc { |
| 88 | __u32 submit_offset; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 89 | __u32 reloc_idx; |
| 90 | __u64 reloc_offset; |
| 91 | __u32 flags; |
| 92 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 93 | #define ETNA_SUBMIT_BO_READ 0x0001 |
| 94 | #define ETNA_SUBMIT_BO_WRITE 0x0002 |
| 95 | struct drm_etnaviv_gem_submit_bo { |
| 96 | __u32 flags; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 97 | __u32 handle; |
| 98 | __u64 presumed; |
| 99 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 100 | #define ETNA_PM_PROCESS_PRE 0x0001 |
| 101 | #define ETNA_PM_PROCESS_POST 0x0002 |
| 102 | struct drm_etnaviv_gem_submit_pmr { |
| 103 | __u32 flags; |
| 104 | __u8 domain; |
| 105 | __u8 pad; |
| 106 | __u16 signal; |
| 107 | __u32 sequence; |
| 108 | __u32 read_offset; |
| 109 | __u32 read_idx; |
| 110 | }; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 111 | #define ETNA_SUBMIT_NO_IMPLICIT 0x0001 |
| 112 | #define ETNA_SUBMIT_FENCE_FD_IN 0x0002 |
| 113 | #define ETNA_SUBMIT_FENCE_FD_OUT 0x0004 |
| 114 | #define ETNA_SUBMIT_FLAGS (ETNA_SUBMIT_NO_IMPLICIT | ETNA_SUBMIT_FENCE_FD_IN | ETNA_SUBMIT_FENCE_FD_OUT) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 115 | #define ETNA_PIPE_3D 0x00 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 116 | #define ETNA_PIPE_2D 0x01 |
| 117 | #define ETNA_PIPE_VG 0x02 |
| 118 | struct drm_etnaviv_gem_submit { |
| 119 | __u32 fence; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 120 | __u32 pipe; |
| 121 | __u32 exec_state; |
| 122 | __u32 nr_bos; |
| 123 | __u32 nr_relocs; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 124 | __u32 stream_size; |
| 125 | __u64 bos; |
| 126 | __u64 relocs; |
| 127 | __u64 stream; |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 128 | __u32 flags; |
| 129 | __s32 fence_fd; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 130 | __u64 pmrs; |
| 131 | __u32 nr_pmrs; |
| 132 | __u32 pad; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 133 | }; |
| 134 | #define ETNA_WAIT_NONBLOCK 0x01 |
| 135 | struct drm_etnaviv_wait_fence { |
| 136 | __u32 pipe; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 137 | __u32 fence; |
| 138 | __u32 flags; |
| 139 | __u32 pad; |
| 140 | struct drm_etnaviv_timespec timeout; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 141 | }; |
| 142 | #define ETNA_USERPTR_READ 0x01 |
| 143 | #define ETNA_USERPTR_WRITE 0x02 |
| 144 | struct drm_etnaviv_gem_userptr { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 145 | __u64 user_ptr; |
| 146 | __u64 user_size; |
| 147 | __u32 flags; |
| 148 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 149 | }; |
| 150 | struct drm_etnaviv_gem_wait { |
| 151 | __u32 pipe; |
| 152 | __u32 handle; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 153 | __u32 flags; |
| 154 | __u32 pad; |
| 155 | struct drm_etnaviv_timespec timeout; |
| 156 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 157 | struct drm_etnaviv_pm_domain { |
| 158 | __u32 pipe; |
| 159 | __u8 iter; |
| 160 | __u8 id; |
| 161 | __u16 nr_signals; |
| 162 | char name[64]; |
| 163 | }; |
| 164 | struct drm_etnaviv_pm_signal { |
| 165 | __u32 pipe; |
| 166 | __u8 domain; |
| 167 | __u8 pad; |
| 168 | __u16 iter; |
| 169 | __u16 id; |
| 170 | char name[64]; |
| 171 | }; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 172 | #define DRM_ETNAVIV_GET_PARAM 0x00 |
| 173 | #define DRM_ETNAVIV_GEM_NEW 0x02 |
| 174 | #define DRM_ETNAVIV_GEM_INFO 0x03 |
| 175 | #define DRM_ETNAVIV_GEM_CPU_PREP 0x04 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 176 | #define DRM_ETNAVIV_GEM_CPU_FINI 0x05 |
| 177 | #define DRM_ETNAVIV_GEM_SUBMIT 0x06 |
| 178 | #define DRM_ETNAVIV_WAIT_FENCE 0x07 |
| 179 | #define DRM_ETNAVIV_GEM_USERPTR 0x08 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 180 | #define DRM_ETNAVIV_GEM_WAIT 0x09 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 181 | #define DRM_ETNAVIV_PM_QUERY_DOM 0x0a |
| 182 | #define DRM_ETNAVIV_PM_QUERY_SIG 0x0b |
| 183 | #define DRM_ETNAVIV_NUM_IOCTLS 0x0c |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 184 | #define DRM_IOCTL_ETNAVIV_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GET_PARAM, struct drm_etnaviv_param) |
| 185 | #define DRM_IOCTL_ETNAVIV_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_NEW, struct drm_etnaviv_gem_new) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 186 | #define DRM_IOCTL_ETNAVIV_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_INFO, struct drm_etnaviv_gem_info) |
| 187 | #define DRM_IOCTL_ETNAVIV_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_PREP, struct drm_etnaviv_gem_cpu_prep) |
| 188 | #define DRM_IOCTL_ETNAVIV_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_CPU_FINI, struct drm_etnaviv_gem_cpu_fini) |
| 189 | #define DRM_IOCTL_ETNAVIV_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_SUBMIT, struct drm_etnaviv_gem_submit) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 190 | #define DRM_IOCTL_ETNAVIV_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_WAIT_FENCE, struct drm_etnaviv_wait_fence) |
| 191 | #define DRM_IOCTL_ETNAVIV_GEM_USERPTR DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_USERPTR, struct drm_etnaviv_gem_userptr) |
| 192 | #define DRM_IOCTL_ETNAVIV_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + DRM_ETNAVIV_GEM_WAIT, struct drm_etnaviv_gem_wait) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 193 | #define DRM_IOCTL_ETNAVIV_PM_QUERY_DOM DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_DOM, struct drm_etnaviv_pm_domain) |
| 194 | #define DRM_IOCTL_ETNAVIV_PM_QUERY_SIG DRM_IOWR(DRM_COMMAND_BASE + DRM_ETNAVIV_PM_QUERY_SIG, struct drm_etnaviv_pm_signal) |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 195 | #ifdef __cplusplus |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 196 | #endif |
| 197 | #endif |