github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_i915.txt (about) 1 # Copyright 2020 syzkaller project authors. All rights reserved. 2 # Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 include <uapi/drm/i915_drm.h> 5 6 resource fd_i915[fd] 7 8 # Some ioctls are mapped to drm_noop, so don't list them here. 9 # https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/i915/i915_drv.c#L1774 10 11 # The unlisted ioctls are : 12 # INIT, FLUSH, FLIP, BATCHBUFFER, IRQ_EMIT, IRQ_WAIT, SETPARAM, ALLOC, FREE, INIT_HEAP, CMDBUFFER, DESTROY_HEAP, 13 # SET_VBLANK_PIPE, GET_VBLANK_PIPE, VBLANK_SWAP, HWS_ADDR, GEM_INIT, GEM_ENTERVT, GEM_LEAVEVT, GET_SPRITE_COLORKEY 14 15 openat$i915(fd const[AT_FDCWD], file ptr[in, string["/dev/i915"]], flags flags[open_flags], mode const[0]) fd_i915 16 17 ioctl$DRM_IOCTL_I915_GETPARAM(fd fd_i915, cmd const[DRM_IOCTL_I915_GETPARAM], arg ptr[inout, drm_i915_getparam]) 18 ioctl$DRM_IOCTL_I915_GEM_EXECBUFFER(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_EXECBUFFER], arg ptr[in, drm_i915_gem_execbuffer]) 19 ioctl$DRM_IOCTL_I915_GEM_EXECBUFFER2(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_EXECBUFFER2], arg ptr[in, drm_i915_gem_execbuffer2]) 20 ioctl$DRM_IOCTL_I915_GEM_EXECBUFFER2_WR(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_EXECBUFFER2_WR], arg ptr[inout, drm_i915_gem_execbuffer2]) 21 ioctl$DRM_IOCTL_I915_GEM_PIN(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_PIN], arg ptr[inout, drm_i915_gem_pin]) 22 ioctl$DRM_IOCTL_I915_GEM_UNPIN(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_UNPIN], arg ptr[in, drm_i915_gem_unpin]) 23 ioctl$DRM_IOCTL_I915_GEM_BUSY(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_BUSY], arg ptr[inout, drm_i915_gem_busy]) 24 ioctl$DRM_IOCTL_I915_GEM_SET_CACHING(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_SET_CACHING], arg ptr[in, drm_i915_gem_caching]) 25 ioctl$DRM_IOCTL_I915_GEM_GET_CACHING(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_GET_CACHING], arg ptr[inout, drm_i915_gem_caching]) 26 ioctl$DRM_IOCTL_I915_GEM_THROTTLE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_THROTTLE], arg const[0]) 27 ioctl$DRM_IOCTL_I915_GEM_CREATE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_CREATE], arg ptr[inout, drm_i915_gem_create]) 28 ioctl$DRM_IOCTL_I915_GEM_PREAD(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_PREAD], arg ptr[in, drm_i915_gem_pread]) 29 ioctl$DRM_IOCTL_I915_GEM_PWRITE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_PWRITE], arg ptr[in, drm_i915_gem_pwrite]) 30 ioctl$DRM_IOCTL_I915_GEM_MMAP(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_MMAP], arg ptr[inout, drm_i915_gem_mmap]) 31 ioctl$DRM_IOCTL_I915_GEM_MMAP_GTT(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_MMAP_GTT], arg ptr[inout, drm_i915_gem_mmap_gtt]) 32 ioctl$DRM_IOCTL_I915_GEM_MMAP_OFFSET(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_MMAP_GTT], arg ptr[inout, drm_i915_gem_mmap_offset]) 33 ioctl$DRM_IOCTL_I915_GEM_SET_DOMAIN(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_SET_DOMAIN], arg ptr[in, drm_i915_gem_set_domain]) 34 ioctl$DRM_IOCTL_I915_GEM_SW_FINISH(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_SW_FINISH], arg ptr[in, drm_i915_gem_sw_finish]) 35 ioctl$DRM_IOCTL_I915_GEM_SET_TILING(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_SET_TILING], arg ptr[inout, drm_i915_gem_set_tiling]) 36 ioctl$DRM_IOCTL_I915_GEM_GET_TILING(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_GET_TILING], arg ptr[out, drm_i915_gem_get_tiling]) 37 ioctl$DRM_IOCTL_I915_GEM_GET_APERTURE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_GET_APERTURE], arg ptr[out, drm_i915_gem_get_aperture]) 38 ioctl$DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID(fd fd_i915, cmd const[DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID], arg ptr[out, drm_i915_get_pipe_from_crtc_id]) 39 ioctl$DRM_IOCTL_I915_GEM_MADVISE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_MADVISE], arg ptr[in, drm_i915_gem_madvise]) 40 ioctl$DRM_IOCTL_I915_OVERLAY_PUT_IMAGE(fd fd_i915, cmd const[DRM_IOCTL_I915_OVERLAY_PUT_IMAGE], arg ptr[in, drm_intel_overlay_put_image]) 41 ioctl$DRM_IOCTL_I915_OVERLAY_ATTRS(fd fd_i915, cmd const[DRM_IOCTL_I915_OVERLAY_ATTRS], arg ptr[in, drm_intel_overlay_attrs]) 42 ioctl$DRM_IOCTL_I915_SET_SPRITE_COLORKEY(fd fd_i915, cmd const[DRM_IOCTL_I915_SET_SPRITE_COLORKEY], arg ptr[in, drm_intel_sprite_colorkey]) 43 ioctl$DRM_IOCTL_I915_GEM_WAIT(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_WAIT], arg ptr[inout, drm_i915_gem_wait]) 44 ioctl$DRM_IOCTL_I915_GEM_CONTEXT_CREATE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_CONTEXT_CREATE], arg ptr[in, drm_i915_gem_context_create]) 45 ioctl$DRM_IOCTL_I915_GEM_CONTEXT_DESTROY(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_CONTEXT_DESTROY], arg ptr[in, drm_i915_gem_context_destroy]) 46 ioctl$DRM_IOCTL_I915_REG_READ(fd fd_i915, cmd const[DRM_IOCTL_I915_REG_READ], arg ptr[inout, drm_i915_reg_read]) 47 ioctl$DRM_IOCTL_I915_GET_RESET_STATS(fd fd_i915, cmd const[DRM_IOCTL_I915_GET_RESET_STATS], arg ptr[inout, drm_i915_reset_stats]) 48 ioctl$DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM], arg ptr[in, drm_i915_gem_context_param]) 49 ioctl$DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_CONTEXT_SETPARAM], arg ptr[inout, drm_i915_gem_context_param]) 50 ioctl$DRM_IOCTL_I915_PERF_ADD_CONFIG(fd fd_i915, cmd const[DRM_IOCTL_I915_PERF_ADD_CONFIG], arg ptr[in, drm_i915_perf_oa_config]) 51 ioctl$DRM_IOCTL_I915_GEM_USERPTR(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_USERPTR], arg ptr[inout, drm_i915_gem_userptr]) 52 ioctl$DRM_IOCTL_I915_PERF_REMOVE_CONFIG(fd fd_i915, cmd const[DRM_IOCTL_I915_PERF_REMOVE_CONFIG], arg ptr[out, int64]) 53 ioctl$DRM_IOCTL_I915_QUERY(fd fd_i915, cmd const[DRM_IOCTL_I915_QUERY], arg ptr[inout, drm_i915_query]) 54 ioctl$DRM_IOCTL_I915_GEM_VM_CREATE(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_VM_CREATE], arg ptr[inout, drm_i915_gem_vm_control]) 55 ioctl$DRM_IOCTL_I915_GEM_VM_DESTROY(fd fd_i915, cmd const[DRM_IOCTL_I915_GEM_VM_DESTROY], arg ptr[out, drm_i915_gem_vm_control]) 56 57 # TODO: This ioctl returns an fd which itself has more operations: 58 # https://elixir.bootlin.com/linux/v5.8-rc4/source/drivers/gpu/drm/i915/i915_perf.c#L3315 59 ioctl$DRM_IOCTL_I915_PERF_OPEN(fd fd_i915, cmd const[DRM_IOCTL_I915_PERF_OPEN], arg ptr[in, drm_i915_perf_open_param]) 60 61 mmap$DRM_I915(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_i915, offset fileoff) 62 _ = __NR_mmap2 63 64 type i915_gem_ctx_id int32 65 type i915_handle int32 66 67 drm_i915_gem_busy { 68 handle i915_handle 69 busy int32 70 } 71 72 drm_i915_gem_caching { 73 handle i915_handle 74 caching int32 75 } 76 77 drm_i915_gem_context_create { 78 ctx_id i915_gem_ctx_id 79 pad const[0, int32] 80 } 81 82 drm_i915_gem_context_destroy { 83 ctx_id i915_gem_ctx_id 84 pad const[0, int32] 85 } 86 87 drm_i915_gem_context_param { 88 ctx_id i915_gem_ctx_id 89 size int32 90 param flags[i915_gem_param_flags, int64] 91 value int64 92 } 93 94 drm_i915_gem_create { 95 size int64 96 handle i915_handle 97 pad const[0, int32] 98 } 99 100 drm_i915_gem_execbuffer { 101 buffers_ptr ptr64[in, array[drm_i915_gem_exec_object]] 102 buffer_count len[buffers_ptr, int32] 103 batch_start_offset int32 104 batch_len int32 105 DR1 int32 106 DR4 int32 107 num_cliprects len[cliprects_ptr, int32] 108 cliprects_ptr ptr64[in, array[drm_clip_rect]] 109 } 110 111 drm_i915_gem_exec_object { 112 handle int32 113 relocation_count len[relocs_ptr, int32] 114 relocs_ptr ptr64[in, array[drm_i915_gem_relocation_entry]] 115 alignment int64 116 offset int64 117 } 118 119 drm_i915_gem_relocation_entry { 120 target_handle int32 121 delta int32 122 offset int64 123 presumed_offset int64 124 read_domains int32 125 write_domain int32 126 } 127 128 drm_i915_gem_execbuffer2 { 129 buffers_ptr ptr64[in, array[drm_i915_gem_exec_object2]] 130 buffer_count len[buffers_ptr, int32] 131 batch_start_offset int32 132 batch_len int32 133 DR1 int32 134 DR4 int32 135 num_cliprects len[cliprects_ptr, int32] 136 cliprects_ptr ptr64[in, array[drm_clip_rect]] 137 flags flags[i915_execbuf2_flags, int64] 138 rsvd1 int64 139 rsvd2 int64 140 } 141 142 drm_i915_gem_exec_object2 { 143 handle i915_handle 144 relocation_count len[relocs_ptr, int32] 145 relocs_ptr ptr64[in, array[drm_i915_gem_relocation_entry]] 146 alignment int64 147 offset int64 148 flags int64 149 rsvd1 int64 150 rsvd2 int64 151 } 152 153 drm_i915_gem_get_aperture { 154 aper_size int64 155 aper_available_size int64 156 } 157 158 drm_i915_gem_get_tiling { 159 handle i915_handle 160 tiling_mode int32 161 swizzle_mode int32 162 phys_swizzle_mode int32 163 } 164 165 drm_i915_gem_madvise { 166 handle i915_handle 167 madv flags[i915_madv_flags, int32] 168 retained bool32 169 } 170 171 drm_i915_gem_mmap { 172 handle i915_handle 173 pad const[0, int32] 174 offset int64 175 size int64 176 addr_ptr ptr64[out, int8] 177 flags flags[i915_mmap_flags, int64] 178 } 179 180 drm_i915_gem_mmap_gtt { 181 handle i915_handle 182 pad const[0, int32] 183 offset int64 184 } 185 186 drm_i915_gem_mmap_offset { 187 handle i915_handle 188 pad const[0, int32] 189 offset int64 190 flags flags[i915_gem_mmap_offset_flags, int64] 191 extensions int64 192 } 193 194 drm_i915_gem_pin { 195 handle i915_handle 196 pad const[0, int32] 197 alignment int64 198 offset int64 199 } 200 201 drm_i915_gem_pread { 202 handle i915_handle 203 pad const[0, int32] 204 offset int64 205 size len[data_ptr, int64] 206 data_ptr ptr64[in, array[int8]] 207 } 208 209 drm_i915_gem_pwrite { 210 handle i915_handle 211 pad const[0, int32] 212 offset int64 213 size len[data_ptr, int64] 214 data_ptr ptr64[in, array[int8]] 215 } 216 217 drm_i915_gem_set_domain { 218 handle i915_handle 219 read_domains int32 220 write_domain int32 221 } 222 223 drm_i915_gem_set_tiling { 224 handle i915_handle 225 tiling_mode int32 226 stride int32 227 swizzle_mode int32 228 } 229 230 drm_i915_gem_sw_finish { 231 handle i915_handle 232 } 233 234 drm_i915_gem_unpin { 235 handle i915_handle 236 pad const[0, int32] 237 } 238 239 drm_i915_gem_userptr { 240 user_ptr ptr64[in, array[int8]] 241 user_size len[user_ptr, int64] 242 flags flags[i915_userptr, int32] 243 handle i915_gem_ctx_id 244 } 245 246 drm_i915_gem_vm_control { 247 extensions int64 248 flags int32 249 vm_id int32 250 } 251 252 drm_i915_gem_wait { 253 bo_handle i915_handle 254 flags const[0, int32] 255 timeout_ns int64 256 } 257 258 drm_i915_get_pipe_from_crtc_id { 259 crtc_id drm_crtc_id 260 pipe int32 261 } 262 263 drm_i915_getparam { 264 param flags[i915_getparam_flags, int32] 265 value intptr 266 } 267 268 drm_i915_perf_oa_config { 269 uuid array[int8, 36] 270 n_mux_regs int32 271 n_boolean_regs int32 272 n_flex_regs int32 273 mux_regs_ptr int64 274 boolean_regs_ptr int64 275 flex_regs_ptr int64 276 } 277 278 drm_i915_perf_open_param { 279 flags flags[i915_perf_flags, int32] 280 num_properties len[properties_ptr, int32] 281 properties_ptr ptr64[in, array[int8]] 282 } 283 284 drm_i915_query { 285 num_items int32 286 flags int32 287 items_ptr ptr64[out, drm_i915_query_item] 288 } 289 290 drm_i915_query_item { 291 query_id flags[i915_query, int64] 292 length len[data_ptr, int32] 293 flags flags[i915_query_perf_flags, int32] 294 data_ptr ptr64[out, int32] 295 } 296 297 drm_i915_reg_read { 298 offset int64 299 val const[0, int64] 300 } 301 302 drm_i915_reset_stats { 303 ctx_id i915_gem_ctx_id 304 flags int32 305 reset_count const[0, int32] 306 batch_active const[0, int32] 307 batch_pending const[0, int32] 308 pad const[0, int32] 309 } 310 311 drm_intel_overlay_attrs { 312 flags flags[i915_overlay_flags, int32] 313 color_key int32 314 brightness int32 315 contrast int32 316 saturation int32 317 gamma0 int32 318 gamma1 int32 319 gamma2 int32 320 gamma3 int32 321 gamma4 int32 322 gamma5 int32 323 } 324 325 drm_intel_overlay_put_image { 326 flags flags[i915_overlay_flags, int32] 327 bo_handle int32 328 stride_Y int16 329 stride_UV int16 330 offset_Y int32 331 offset_U int32 332 offset_V int32 333 src_width int16 334 src_height int16 335 src_scan_width int16 336 src_scan_height int16 337 crtc_id drm_crtc_id 338 dst_x int16 339 dst_y int16 340 dst_width int16 341 dst_height int16 342 } 343 344 drm_intel_sprite_colorkey { 345 plane_id int32 346 min_value int32 347 channel_mask int32 348 max_value int32 349 flags flags[i915_colorkey_flags, int32] 350 } 351 352 i915_colorkey_flags = 0, I915_SET_COLORKEY_NONE, I915_SET_COLORKEY_DESTINATION, I915_SET_COLORKEY_SOURCE 353 i915_mmap_flags = 0, I915_MMAP_WC 354 i915_madv_flags = I915_MADV_WILLNEED, I915_MADV_DONTNEED, __I915_MADV_PURGED 355 i915_query = DRM_I915_QUERY_TOPOLOGY_INFO, DRM_I915_QUERY_ENGINE_INFO 356 i915_userptr = I915_USERPTR_READ_ONLY, I915_USERPTR_UNSYNCHRONIZED 357 i915_execbuf2_flags = I915_EXEC_DEFAULT, I915_EXEC_RENDER, I915_EXEC_BSD, I915_EXEC_BLT, I915_EXEC_VEBOX, I915_EXEC_CONSTANTS_REL_GENERAL, I915_EXEC_CONSTANTS_ABSOLUTE, I915_EXEC_CONSTANTS_REL_SURFACE, I915_EXEC_GEN7_SOL_RESET, I915_EXEC_SECURE, I915_EXEC_IS_PINNED, I915_EXEC_NO_RELOC, I915_EXEC_HANDLE_LUT, I915_EXEC_BSD_DEFAULT, I915_EXEC_RESOURCE_STREAMER, I915_EXEC_FENCE_IN, I915_EXEC_BATCH_FIRST, I915_EXEC_FENCE_ARRAY, I915_EXEC_FENCE_SUBMIT 358 i915_gem_param_flags = I915_CONTEXT_PARAM_BAN_PERIOD, I915_CONTEXT_PARAM_NO_ZEROMAP, I915_CONTEXT_PARAM_GTT_SIZE, I915_CONTEXT_PARAM_NO_ERROR_CAPTURE, I915_CONTEXT_PARAM_BANNABLE 359 i915_gem_mmap_offset_flags = I915_MMAP_OFFSET_GTT, I915_MMAP_OFFSET_WC, I915_MMAP_OFFSET_WB, I915_MMAP_OFFSET_UC 360 i915_getparam_flags = I915_PARAM_IRQ_ACTIVE, I915_PARAM_ALLOW_BATCHBUFFER, I915_PARAM_LAST_DISPATCH, I915_PARAM_CHIPSET_ID, I915_PARAM_HAS_GEM, I915_PARAM_NUM_FENCES_AVAIL, I915_PARAM_HAS_OVERLAY, I915_PARAM_HAS_PAGEFLIPPING, I915_PARAM_HAS_EXECBUF2, I915_PARAM_HAS_BSD, I915_PARAM_HAS_BLT, I915_PARAM_HAS_RELAXED_FENCING, I915_PARAM_HAS_COHERENT_RINGS, I915_PARAM_HAS_EXEC_CONSTANTS, I915_PARAM_HAS_RELAXED_DELTA, I915_PARAM_HAS_GEN7_SOL_RESET, I915_PARAM_HAS_LLC, I915_PARAM_HAS_ALIASING_PPGTT, I915_PARAM_HAS_WAIT_TIMEOUT, I915_PARAM_HAS_SEMAPHORES, I915_PARAM_HAS_PRIME_VMAP_FLUSH, I915_PARAM_HAS_VEBOX, I915_PARAM_HAS_SECURE_BATCHES, I915_PARAM_HAS_PINNED_BATCHES, I915_PARAM_HAS_EXEC_NO_RELOC, I915_PARAM_HAS_EXEC_HANDLE_LUT, I915_PARAM_HAS_WT, I915_PARAM_CMD_PARSER_VERSION, I915_PARAM_HAS_COHERENT_PHYS_GTT, I915_PARAM_MMAP_VERSION, I915_PARAM_HAS_BSD2, I915_PARAM_REVISION, I915_PARAM_SUBSLICE_TOTAL, I915_PARAM_EU_TOTAL, I915_PARAM_HAS_GPU_RESET, I915_PARAM_HAS_RESOURCE_STREAMER, I915_PARAM_HAS_EXEC_SOFTPIN, I915_PARAM_HAS_POOLED_EU, I915_PARAM_MIN_EU_IN_POOL, I915_PARAM_MMAP_GTT_VERSION, I915_PARAM_HAS_SCHEDULER, I915_PARAM_HUC_STATUS, I915_PARAM_HAS_EXEC_ASYNC, I915_PARAM_HAS_EXEC_FENCE, I915_PARAM_HAS_EXEC_CAPTURE, I915_PARAM_SLICE_MASK, I915_PARAM_SUBSLICE_MASK, I915_PARAM_HAS_EXEC_BATCH_FIRST, I915_PARAM_HAS_EXEC_FENCE_ARRAY 361 i915_perf_flags = I915_PERF_FLAG_FD_CLOEXEC, I915_PERF_FLAG_FD_NONBLOCK, I915_PERF_FLAG_DISABLED 362 i915_overlay_flags = I915_OVERLAY_TYPE_MASK, I915_OVERLAY_YUV_PLANAR, I915_OVERLAY_YUV_PACKED, I915_OVERLAY_RGB, I915_OVERLAY_DEPTH_MASK, I915_OVERLAY_RGB24, I915_OVERLAY_RGB16, I915_OVERLAY_RGB15, I915_OVERLAY_YUV422, I915_OVERLAY_YUV411, I915_OVERLAY_YUV420, I915_OVERLAY_YUV410, I915_OVERLAY_SWAP_MASK, I915_OVERLAY_NO_SWAP, I915_OVERLAY_UV_SWAP, I915_OVERLAY_Y_SWAP, I915_OVERLAY_Y_AND_UV_SWAP, I915_OVERLAY_FLAGS_MASK, I915_OVERLAY_ENABLE, I915_OVERLAY_UPDATE_ATTRS, I915_OVERLAY_UPDATE_GAMMA, I915_OVERLAY_DISABLE_DEST_COLORKEY 363 i915_query_perf_flags = DRM_I915_QUERY_PERF_CONFIG_LIST, DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_UUID, DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID, DRM_I915_QUERY_PERF_CONFIG_DATA_FOR_ID