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__ 21 #include "drm.h" 22 #include "sde_drm.h" 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 #define MSM_PIPE_NONE 0x00 27 #define MSM_PIPE_2D0 0x01 28 #define MSM_PIPE_2D1 0x02 29 #define MSM_PIPE_3D0 0x10 30 #define MSM_PIPE_ID_MASK 0xffff 31 #define MSM_PIPE_ID(x) ((x) & MSM_PIPE_ID_MASK) 32 #define MSM_PIPE_FLAGS(x) ((x) & ~MSM_PIPE_ID_MASK) 33 struct drm_msm_timespec { 34 __s64 tv_sec; 35 __s64 tv_nsec; 36 }; 37 #define DRM_EDID_CLRMETRY_xvYCC_601 (1 << 0) 38 #define DRM_EDID_CLRMETRY_xvYCC_709 (1 << 1) 39 #define DRM_EDID_CLRMETRY_sYCC_601 (1 << 2) 40 #define DRM_EDID_CLRMETRY_ADOBE_YCC_601 (1 << 3) 41 #define DRM_EDID_CLRMETRY_ADOBE_RGB (1 << 4) 42 #define DRM_EDID_CLRMETRY_BT2020_CYCC (1 << 5) 43 #define DRM_EDID_CLRMETRY_BT2020_YCC (1 << 6) 44 #define DRM_EDID_CLRMETRY_BT2020_RGB (1 << 7) 45 #define DRM_EDID_CLRMETRY_DCI_P3 (1 << 15) 46 #define HDR_PRIMARIES_COUNT 3 47 #define HDR_EOTF_SDR_LUM_RANGE 0x0 48 #define HDR_EOTF_HDR_LUM_RANGE 0x1 49 #define HDR_EOTF_SMTPE_ST2084 0x2 50 #define HDR_EOTF_HLG 0x3 51 #define DRM_MSM_EXT_HDR_METADATA 52 #define DRM_MSM_EXT_HDR_PLUS_METADATA 53 struct drm_msm_ext_hdr_metadata { 54 __u32 hdr_state; 55 __u32 eotf; 56 __u32 hdr_supported; 57 __u32 display_primaries_x[HDR_PRIMARIES_COUNT]; 58 __u32 display_primaries_y[HDR_PRIMARIES_COUNT]; 59 __u32 white_point_x; 60 __u32 white_point_y; 61 __u32 max_luminance; 62 __u32 min_luminance; 63 __u32 max_content_light_level; 64 __u32 max_average_light_level; 65 __u64 hdr_plus_payload; 66 __u32 hdr_plus_payload_size; 67 }; 68 #define DRM_MSM_EXT_HDR_PROPERTIES 69 #define DRM_MSM_EXT_HDR_PLUS_PROPERTIES 70 struct drm_msm_ext_hdr_properties { 71 __u8 hdr_metadata_type_one; 72 __u32 hdr_supported; 73 __u32 hdr_eotf; 74 __u32 hdr_max_luminance; 75 __u32 hdr_avg_luminance; 76 __u32 hdr_min_luminance; 77 __u32 hdr_plus_supported; 78 }; 79 #define MSM_PARAM_GPU_ID 0x01 80 #define MSM_PARAM_GMEM_SIZE 0x02 81 #define MSM_PARAM_CHIP_ID 0x03 82 #define MSM_PARAM_MAX_FREQ 0x04 83 #define MSM_PARAM_TIMESTAMP 0x05 84 #define MSM_PARAM_GMEM_BASE 0x06 85 #define MSM_PARAM_NR_RINGS 0x07 86 struct drm_msm_param { 87 __u32 pipe; 88 __u32 param; 89 __u64 value; 90 }; 91 #define MSM_BO_SCANOUT 0x00000001 92 #define MSM_BO_GPU_READONLY 0x00000002 93 #define MSM_BO_CACHE_MASK 0x000f0000 94 #define MSM_BO_CACHED 0x00010000 95 #define MSM_BO_WC 0x00020000 96 #define MSM_BO_UNCACHED 0x00040000 97 #define MSM_BO_FLAGS (MSM_BO_SCANOUT | MSM_BO_GPU_READONLY | MSM_BO_CACHED | MSM_BO_WC | MSM_BO_UNCACHED) 98 struct drm_msm_gem_new { 99 __u64 size; 100 __u32 flags; 101 __u32 handle; 102 }; 103 #define MSM_INFO_IOVA 0x01 104 #define MSM_INFO_FLAGS (MSM_INFO_IOVA) 105 struct drm_msm_gem_info { 106 __u32 handle; 107 __u32 flags; 108 __u64 offset; 109 }; 110 #define MSM_PREP_READ 0x01 111 #define MSM_PREP_WRITE 0x02 112 #define MSM_PREP_NOSYNC 0x04 113 #define MSM_PREP_FLAGS (MSM_PREP_READ | MSM_PREP_WRITE | MSM_PREP_NOSYNC) 114 struct drm_msm_gem_cpu_prep { 115 __u32 handle; 116 __u32 op; 117 struct drm_msm_timespec timeout; 118 }; 119 struct drm_msm_gem_cpu_fini { 120 __u32 handle; 121 }; 122 struct drm_msm_gem_submit_reloc { 123 __u32 submit_offset; 124 __u32 or; 125 __s32 shift; 126 __u32 reloc_idx; 127 __u64 reloc_offset; 128 }; 129 #define MSM_SUBMIT_CMD_BUF 0x0001 130 #define MSM_SUBMIT_CMD_IB_TARGET_BUF 0x0002 131 #define MSM_SUBMIT_CMD_CTX_RESTORE_BUF 0x0003 132 struct drm_msm_gem_submit_cmd { 133 __u32 type; 134 __u32 submit_idx; 135 __u32 submit_offset; 136 __u32 size; 137 __u32 pad; 138 __u32 nr_relocs; 139 __u64 relocs; 140 }; 141 #define MSM_SUBMIT_BO_READ 0x0001 142 #define MSM_SUBMIT_BO_WRITE 0x0002 143 #define MSM_SUBMIT_BO_FLAGS (MSM_SUBMIT_BO_READ | MSM_SUBMIT_BO_WRITE) 144 struct drm_msm_gem_submit_bo { 145 __u32 flags; 146 __u32 handle; 147 __u64 presumed; 148 }; 149 #define MSM_SUBMIT_NO_IMPLICIT 0x80000000 150 #define MSM_SUBMIT_FENCE_FD_IN 0x40000000 151 #define MSM_SUBMIT_FENCE_FD_OUT 0x20000000 152 #define MSM_SUBMIT_SUDO 0x10000000 153 #define MSM_SUBMIT_FLAGS (MSM_SUBMIT_NO_IMPLICIT | MSM_SUBMIT_FENCE_FD_IN | MSM_SUBMIT_FENCE_FD_OUT | MSM_SUBMIT_SUDO | 0) 154 struct drm_msm_gem_submit { 155 __u32 flags; 156 __u32 fence; 157 __u32 nr_bos; 158 __u32 nr_cmds; 159 __u64 bos; 160 __u64 cmds; 161 __s32 fence_fd; 162 __u32 queueid; 163 }; 164 struct drm_msm_wait_fence { 165 __u32 fence; 166 __u32 pad; 167 struct drm_msm_timespec timeout; 168 __u32 queueid; 169 }; 170 #define MSM_MADV_WILLNEED 0 171 #define MSM_MADV_DONTNEED 1 172 #define __MSM_MADV_PURGED 2 173 struct drm_msm_gem_madvise { 174 __u32 handle; 175 __u32 madv; 176 __u32 retained; 177 }; 178 #define DISPLAY_PRIMARIES_WX 0 179 #define DISPLAY_PRIMARIES_WY 1 180 #define DISPLAY_PRIMARIES_RX 2 181 #define DISPLAY_PRIMARIES_RY 3 182 #define DISPLAY_PRIMARIES_GX 4 183 #define DISPLAY_PRIMARIES_GY 5 184 #define DISPLAY_PRIMARIES_BX 6 185 #define DISPLAY_PRIMARIES_BY 7 186 #define DISPLAY_PRIMARIES_MAX 8 187 struct drm_panel_hdr_properties { 188 __u32 hdr_enabled; 189 __u32 display_primaries[DISPLAY_PRIMARIES_MAX]; 190 __u32 peak_brightness; 191 __u32 blackness_level; 192 }; 193 struct drm_msm_event_req { 194 __u32 object_id; 195 __u32 object_type; 196 __u32 event; 197 __u64 client_context; 198 __u32 index; 199 }; 200 struct drm_msm_event_resp { 201 struct drm_event base; 202 struct drm_msm_event_req info; 203 __u8 data[]; 204 }; 205 #define MSM_SUBMITQUEUE_FLAGS (0) 206 struct drm_msm_submitqueue { 207 __u32 flags; 208 __u32 prio; 209 __u32 id; 210 }; 211 struct drm_msm_power_ctrl { 212 __u32 enable; 213 __u32 flags; 214 }; 215 #define DRM_MSM_GET_PARAM 0x00 216 #define DRM_MSM_GEM_NEW 0x02 217 #define DRM_MSM_GEM_INFO 0x03 218 #define DRM_MSM_GEM_CPU_PREP 0x04 219 #define DRM_MSM_GEM_CPU_FINI 0x05 220 #define DRM_MSM_GEM_SUBMIT 0x06 221 #define DRM_MSM_WAIT_FENCE 0x07 222 #define DRM_MSM_GEM_MADVISE 0x08 223 #define DRM_MSM_SUBMITQUEUE_NEW 0x0A 224 #define DRM_MSM_SUBMITQUEUE_CLOSE 0x0B 225 #define DRM_SDE_WB_CONFIG 0x40 226 #define DRM_MSM_REGISTER_EVENT 0x41 227 #define DRM_MSM_DEREGISTER_EVENT 0x42 228 #define DRM_MSM_RMFB2 0x43 229 #define DRM_MSM_POWER_CTRL 0x44 230 #define DRM_EVENT_HISTOGRAM 0x80000000 231 #define DRM_EVENT_AD_BACKLIGHT 0x80000001 232 #define DRM_EVENT_CRTC_POWER 0x80000002 233 #define DRM_EVENT_SYS_BACKLIGHT 0x80000003 234 #define DRM_EVENT_SDE_POWER 0x80000004 235 #define DRM_EVENT_IDLE_NOTIFY 0x80000005 236 #define DRM_EVENT_PANEL_DEAD 0x80000006 237 #define DRM_EVENT_SDE_HW_RECOVERY 0X80000007 238 #define DRM_EVENT_LTM_HIST 0X80000008 239 #define DRM_EVENT_LTM_WB_PB 0X80000009 240 #define DRM_EVENT_LTM_OFF 0X8000000A 241 #define DRM_IOCTL_MSM_GET_PARAM DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GET_PARAM, struct drm_msm_param) 242 #define DRM_IOCTL_MSM_GEM_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_NEW, struct drm_msm_gem_new) 243 #define DRM_IOCTL_MSM_GEM_INFO DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_INFO, struct drm_msm_gem_info) 244 #define DRM_IOCTL_MSM_GEM_CPU_PREP DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_PREP, struct drm_msm_gem_cpu_prep) 245 #define DRM_IOCTL_MSM_GEM_CPU_FINI DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_GEM_CPU_FINI, struct drm_msm_gem_cpu_fini) 246 #define DRM_IOCTL_MSM_GEM_SUBMIT DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_SUBMIT, struct drm_msm_gem_submit) 247 #define DRM_IOCTL_MSM_WAIT_FENCE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_WAIT_FENCE, struct drm_msm_wait_fence) 248 #define DRM_IOCTL_MSM_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_GEM_MADVISE, struct drm_msm_gem_madvise) 249 #define DRM_IOCTL_SDE_WB_CONFIG DRM_IOW((DRM_COMMAND_BASE + DRM_SDE_WB_CONFIG), struct sde_drm_wb_cfg) 250 #define DRM_IOCTL_MSM_REGISTER_EVENT DRM_IOW((DRM_COMMAND_BASE + DRM_MSM_REGISTER_EVENT), struct drm_msm_event_req) 251 #define DRM_IOCTL_MSM_DEREGISTER_EVENT DRM_IOW((DRM_COMMAND_BASE + DRM_MSM_DEREGISTER_EVENT), struct drm_msm_event_req) 252 #define DRM_IOCTL_MSM_RMFB2 DRM_IOW((DRM_COMMAND_BASE + DRM_MSM_RMFB2), unsigned int) 253 #define DRM_IOCTL_MSM_SUBMITQUEUE_NEW DRM_IOWR(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_NEW, struct drm_msm_submitqueue) 254 #define DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE DRM_IOW(DRM_COMMAND_BASE + DRM_MSM_SUBMITQUEUE_CLOSE, __u32) 255 #define DRM_IOCTL_MSM_POWER_CTRL DRM_IOW((DRM_COMMAND_BASE + DRM_MSM_POWER_CTRL), struct drm_msm_power_ctrl) 256 #ifdef __cplusplus 257 } 258 #endif 259 #endif 260