Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -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 __MSM_DRM_H__ |
| 20 | #define __MSM_DRM_H__ |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 21 | #include "drm.h" |
| 22 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 23 | extern "C" { |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 24 | #endif |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 25 | #define MSM_PIPE_NONE 0x00 |
| 26 | #define MSM_PIPE_2D0 0x01 |
| 27 | #define MSM_PIPE_2D1 0x02 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 28 | #define MSM_PIPE_3D0 0x10 |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 29 | #define MSM_PIPE_ID_MASK 0xffff |
| 30 | #define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK) |
| 31 | #define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 32 | struct drm_msm_timespec { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 33 | __s64 tv_sec; |
| 34 | __s64 tv_nsec; |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 35 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 36 | #define MSM_PARAM_GPU_ID 0x01 |
| 37 | #define MSM_PARAM_GMEM_SIZE 0x02 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 38 | #define MSM_PARAM_CHIP_ID 0x03 |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 39 | #define MSM_PARAM_MAX_FREQ 0x04 |
| 40 | #define MSM_PARAM_TIMESTAMP 0x05 |
Christopher Ferris | 525ce91 | 2017-07-26 13:12:53 -0700 | [diff] [blame] | 41 | #define MSM_PARAM_GMEM_BASE 0x06 |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 42 | #define MSM_PARAM_PRIORITIES 0x07 |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 43 | #define MSM_PARAM_PP_PGTABLE 0x08 |
| 44 | #define MSM_PARAM_FAULTS 0x09 |
Christopher Ferris | fcc3b4f | 2021-07-01 01:30:21 +0000 | [diff] [blame] | 45 | #define MSM_PARAM_SUSPENDS 0x0a |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame^] | 46 | #define MSM_PARAM_SYSPROF 0x0b |
Christopher Ferris | 2abfa9e | 2021-11-01 16:26:06 -0700 | [diff] [blame] | 47 | #define MSM_PARAM_NR_RINGS MSM_PARAM_PRIORITIES |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 48 | struct drm_msm_param { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 49 | __u32 pipe; |
| 50 | __u32 param; |
| 51 | __u64 value; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 52 | }; |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 53 | #define MSM_BO_SCANOUT 0x00000001 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 54 | #define MSM_BO_GPU_READONLY 0x00000002 |
| 55 | #define MSM_BO_CACHE_MASK 0x000f0000 |
| 56 | #define MSM_BO_CACHED 0x00010000 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 57 | #define MSM_BO_WC 0x00020000 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 58 | #define MSM_BO_UNCACHED 0x00040000 |
Christopher Ferris | 3a39c0b | 2021-09-02 00:03:38 +0000 | [diff] [blame] | 59 | #define MSM_BO_CACHED_COHERENT 0x080000 |
| 60 | #define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHE_MASK) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 61 | struct drm_msm_gem_new { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 62 | __u64 size; |
| 63 | __u32 flags; |
| 64 | __u32 handle; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 65 | }; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 66 | #define MSM_INFO_GET_OFFSET 0x00 |
| 67 | #define MSM_INFO_GET_IOVA 0x01 |
| 68 | #define MSM_INFO_SET_NAME 0x02 |
| 69 | #define MSM_INFO_GET_NAME 0x03 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 70 | struct drm_msm_gem_info { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 71 | __u32 handle; |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 72 | __u32 info; |
| 73 | __u64 value; |
| 74 | __u32 len; |
| 75 | __u32 pad; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 76 | }; |
| 77 | #define MSM_PREP_READ 0x01 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 78 | #define MSM_PREP_WRITE 0x02 |
| 79 | #define MSM_PREP_NOSYNC 0x04 |
Christopher Ferris | ba8d4f4 | 2014-09-03 19:56:49 -0700 | [diff] [blame] | 80 | #define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 81 | struct drm_msm_gem_cpu_prep { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 82 | __u32 handle; |
| 83 | __u32 op; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 84 | struct drm_msm_timespec timeout; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 85 | }; |
| 86 | struct drm_msm_gem_cpu_fini { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 87 | __u32 handle; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 88 | }; |
| 89 | struct drm_msm_gem_submit_reloc { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 90 | __u32 submit_offset; |
| 91 | __u32 or; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 92 | __s32 shift; |
| 93 | __u32 reloc_idx; |
| 94 | __u64 reloc_offset; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 95 | }; |
| 96 | #define MSM_SUBMIT_CMD_BUF 0x0001 |
| 97 | #define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002 |
| 98 | #define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 99 | struct drm_msm_gem_submit_cmd { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 100 | __u32 type; |
| 101 | __u32 submit_idx; |
| 102 | __u32 submit_offset; |
| 103 | __u32 size; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 104 | __u32 pad; |
| 105 | __u32 nr_relocs; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 106 | __u64 relocs; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 107 | }; |
| 108 | #define MSM_SUBMIT_BO_READ 0x0001 |
| 109 | #define MSM_SUBMIT_BO_WRITE 0x0002 |
Christopher Ferris | d842e43 | 2019-03-07 10:21:59 -0800 | [diff] [blame] | 110 | #define MSM_SUBMIT_BO_DUMP 0x0004 |
| 111 | #define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE | MSM_SUBMIT_BO_DUMP) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 112 | struct drm_msm_gem_submit_bo { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 113 | __u32 flags; |
| 114 | __u32 handle; |
| 115 | __u64 presumed; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 116 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 117 | #define MSM_SUBMIT_NO_IMPLICIT 0x80000000 |
| 118 | #define MSM_SUBMIT_FENCE_FD_IN 0x40000000 |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 119 | #define MSM_SUBMIT_FENCE_FD_OUT 0x20000000 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 120 | #define MSM_SUBMIT_SUDO 0x10000000 |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 121 | #define MSM_SUBMIT_SYNCOBJ_IN 0x08000000 |
| 122 | #define MSM_SUBMIT_SYNCOBJ_OUT 0x04000000 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame^] | 123 | #define MSM_SUBMIT_FENCE_SN_IN 0x02000000 |
| 124 | #define MSM_SUBMIT_FLAGS (MSM_SUBMIT_NO_IMPLICIT | MSM_SUBMIT_FENCE_FD_IN | MSM_SUBMIT_FENCE_FD_OUT | MSM_SUBMIT_SUDO | MSM_SUBMIT_SYNCOBJ_IN | MSM_SUBMIT_SYNCOBJ_OUT | MSM_SUBMIT_FENCE_SN_IN | 0) |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 125 | #define MSM_SUBMIT_SYNCOBJ_RESET 0x00000001 |
| 126 | #define MSM_SUBMIT_SYNCOBJ_FLAGS (MSM_SUBMIT_SYNCOBJ_RESET | 0) |
| 127 | struct drm_msm_gem_submit_syncobj { |
| 128 | __u32 handle; |
| 129 | __u32 flags; |
| 130 | __u64 point; |
| 131 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 132 | struct drm_msm_gem_submit { |
| 133 | __u32 flags; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 134 | __u32 fence; |
| 135 | __u32 nr_bos; |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 136 | __u32 nr_cmds; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 137 | __u64 bos; |
| 138 | __u64 cmds; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 139 | __s32 fence_fd; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 140 | __u32 queueid; |
Christopher Ferris | 8177cdf | 2020-08-03 11:53:55 -0700 | [diff] [blame] | 141 | __u64 in_syncobjs; |
| 142 | __u64 out_syncobjs; |
| 143 | __u32 nr_in_syncobjs; |
| 144 | __u32 nr_out_syncobjs; |
| 145 | __u32 syncobj_stride; |
| 146 | __u32 pad; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 147 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 148 | struct drm_msm_wait_fence { |
Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 149 | __u32 fence; |
| 150 | __u32 pad; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 151 | struct drm_msm_timespec timeout; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 152 | __u32 queueid; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 153 | }; |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 154 | #define MSM_MADV_WILLNEED 0 |
| 155 | #define MSM_MADV_DONTNEED 1 |
| 156 | #define __MSM_MADV_PURGED 2 |
| 157 | struct drm_msm_gem_madvise { |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 158 | __u32 handle; |
| 159 | __u32 madv; |
| 160 | __u32 retained; |
| 161 | }; |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 162 | #define MSM_SUBMITQUEUE_FLAGS (0) |
| 163 | struct drm_msm_submitqueue { |
| 164 | __u32 flags; |
| 165 | __u32 prio; |
| 166 | __u32 id; |
| 167 | }; |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 168 | #define MSM_SUBMITQUEUE_PARAM_FAULTS 0 |
| 169 | struct drm_msm_submitqueue_query { |
| 170 | __u64 data; |
| 171 | __u32 id; |
| 172 | __u32 param; |
| 173 | __u32 len; |
| 174 | __u32 pad; |
| 175 | }; |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 176 | #define DRM_MSM_GET_PARAM 0x00 |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame^] | 177 | #define DRM_MSM_SET_PARAM 0x01 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 178 | #define DRM_MSM_GEM_NEW 0x02 |
| 179 | #define DRM_MSM_GEM_INFO 0x03 |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 180 | #define DRM_MSM_GEM_CPU_PREP 0x04 |
| 181 | #define DRM_MSM_GEM_CPU_FINI 0x05 |
| 182 | #define DRM_MSM_GEM_SUBMIT 0x06 |
| 183 | #define DRM_MSM_WAIT_FENCE 0x07 |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 184 | #define DRM_MSM_GEM_MADVISE 0x08 |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 185 | #define DRM_MSM_SUBMITQUEUE_NEW 0x0A |
| 186 | #define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 187 | #define DRM_MSM_SUBMITQUEUE_QUERY 0x0C |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 188 | #define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param) |
Christopher Ferris | 10a76e6 | 2022-06-08 13:31:52 -0700 | [diff] [blame^] | 189 | #define DRM_IOCTL_MSM_SET_PARAM DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SET_PARAM, struct drm_msm_param) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 190 | #define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new) |
| 191 | #define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 192 | #define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 193 | #define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini) |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 194 | #define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 195 | #define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 196 | #define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise) |
Christopher Ferris | 934ec94 | 2018-01-31 15:29:16 -0800 | [diff] [blame] | 197 | #define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue) |
| 198 | #define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32) |
Christopher Ferris | aeddbcf | 2019-07-08 12:45:46 -0700 | [diff] [blame] | 199 | #define DRM_IOCTL_MSM_SUBMITQUEUE_QUERY DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_QUERY, struct drm_msm_submitqueue_query) |
Christopher Ferris | 49f525c | 2016-12-12 14:55:36 -0800 | [diff] [blame] | 200 | #ifdef __cplusplus |
Christopher Ferris | 48fe0ae | 2019-01-10 15:59:33 -0800 | [diff] [blame] | 201 | } |
Christopher Ferris | 38062f9 | 2014-07-09 15:33:25 -0700 | [diff] [blame] | 202 | #endif |
Christopher Ferris | 106b3a8 | 2016-08-24 12:15:38 -0700 | [diff] [blame] | 203 | #endif |