github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/sys/linux/dev_camx.txt (about)

     1  # Copyright 2023 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  # The source file of camx ioctl can be found in ChromeOS source tree:
     5  # https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-5.15/drivers/media/platform/camx/
     6  
     7  # Not upstream, generated on:
     8  # https://chromium.googlesource.com/chromiumos/third_party/kernel cdff88937190
     9  # with -includedirs drivers/media/platform/camx/include/uapi
    10  meta noextract
    11  
    12  include <media/cam_req_mgr.h>
    13  include <uapi/linux/fcntl.h>
    14  
    15  resource fd_camx[fd]
    16  resource session_handle[int32]
    17  resource link_handle[int32]
    18  resource alloc_fd[fd]
    19  
    20  openat$camx(fd const[AT_FDCWD], file ptr[in, string["/dev/v4l/by-path/platform-soc@0:qcom_cam-req-mgr-video-index0"]], flags const[O_RDWR], mode const[0]) fd_camx
    21  
    22  # no code handles commented out op_code
    23  
    24  # ioctl$CAM_REQ_MGR_CREATE_DEV_NODES(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_CREATE_DEV_NODES])
    25  ioctl$CAM_REQ_MGR_CREATE_SESSION(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_CREATE_SESSION])
    26  ioctl$CAM_REQ_MGR_DESTROY_SESSION(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_DESTROY_SESSION])
    27  ioctl$CAM_REQ_MGR_LINK(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK])
    28  ioctl$CAM_REQ_MGR_UNLINK(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_UNLINK])
    29  ioctl$CAM_REQ_MGR_SCHED_REQ(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_SCHED_REQ])
    30  ioctl$CAM_REQ_MGR_FLUSH_REQ(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_FLUSH_REQ])
    31  ioctl$CAM_REQ_MGR_SYNC_MODE(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_SYNC_MODE])
    32  ioctl$CAM_REQ_MGR_ALLOC_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_ALLOC_BUF])
    33  ioctl$CAM_REQ_MGR_MAP_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_MAP_BUF])
    34  ioctl$CAM_REQ_MGR_RELEASE_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_RELEASE_BUF])
    35  # ioctl$CAM_REQ_MGR_CACHE_OPS(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_CACHE_OPS])
    36  ioctl$CAM_REQ_MGR_LINK_CONTROL(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK_CONTROL])
    37  ioctl$CAM_REQ_MGR_LINK_V2(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK_V2])
    38  ioctl$CAM_REQ_MGR_REQUEST_DUMP(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_REQUEST_DUMP])
    39  
    40  type cam_control[OPCODE, HANDLE] {
    41  	op_code		const[OPCODE, int32]
    42  	size		bytesize[handle, int32]
    43  	handle_type	const[CAM_HANDLE_USER_POINTER, int32]
    44  	reserved	const[0, int32]
    45  	handle		ptr[in, HANDLE]
    46  }
    47  
    48  type cam_control$CAM_REQ_MGR_CREATE_SESSION cam_control[CAM_REQ_MGR_CREATE_SESSION, cam_req_mgr_session_info__for_create]
    49  type cam_control$CAM_REQ_MGR_DESTROY_SESSION cam_control[CAM_REQ_MGR_DESTROY_SESSION, cam_req_mgr_session_info__for_destroy]
    50  type cam_control$CAM_REQ_MGR_LINK cam_control[CAM_REQ_MGR_LINK, cam_req_mgr_ver_info]
    51  type cam_control$CAM_REQ_MGR_UNLINK cam_control[CAM_REQ_MGR_UNLINK, cam_req_mgr_unlink_info]
    52  type cam_control$CAM_REQ_MGR_SCHED_REQ cam_control[CAM_REQ_MGR_SCHED_REQ, cam_req_mgr_sched_request]
    53  type cam_control$CAM_REQ_MGR_FLUSH_REQ cam_control[CAM_REQ_MGR_FLUSH_REQ, cam_req_mgr_flush_info]
    54  type cam_control$CAM_REQ_MGR_SYNC_MODE cam_control[CAM_REQ_MGR_SYNC_MODE, cam_req_mgr_sync_mode]
    55  type cam_control$CAM_REQ_MGR_ALLOC_BUF cam_control[CAM_REQ_MGR_ALLOC_BUF, cam_mem_mgr_alloc_cmd]
    56  type cam_control$CAM_REQ_MGR_MAP_BUF cam_control[CAM_REQ_MGR_MAP_BUF, cam_mem_mgr_map_cmd]
    57  type cam_control$CAM_REQ_MGR_RELEASE_BUF cam_control[CAM_REQ_MGR_RELEASE_BUF, cam_mem_mgr_release_cmd]
    58  type cam_control$CAM_REQ_MGR_LINK_CONTROL cam_control[CAM_REQ_MGR_LINK_CONTROL, cam_req_mgr_link_control]
    59  type cam_control$CAM_REQ_MGR_LINK_V2 cam_control[CAM_REQ_MGR_LINK_V2, cam_req_mgr_ver_info]
    60  type cam_control$CAM_REQ_MGR_REQUEST_DUMP cam_control[CAM_REQ_MGR_REQUEST_DUMP, cam_dump_req_cmd]
    61  
    62  # originally cam_req_mgr_session_info
    63  cam_req_mgr_session_info__for_create {
    64  	session_hdl	session_handle	(out)
    65  	reserved	const[0, int32]
    66  }
    67  
    68  # originally cam_req_mgr_session_info
    69  cam_req_mgr_session_info__for_destroy {
    70  	session_hdl	session_handle
    71  	reserved	const[0, int32]
    72  }
    73  
    74  cam_req_mgr_ver_info {
    75  	version	int32	(out)
    76  	u	cam_req_mgr_ver_info_union
    77  }
    78  
    79  cam_req_mgr_ver_info_union {
    80  	link_info_v1	cam_req_mgr_link_info
    81  	link_info_v2	cam_req_mgr_link_info_v2
    82  }
    83  
    84  cam_req_mgr_link_info {
    85  	session_hdl	session_handle
    86  	num_devices	len[dev_hdls, int32]
    87  	dev_hdls	array[int32, CAM_REQ_MGR_MAX_HANDLES]
    88  	link_hdl	link_handle	(out)
    89  }
    90  
    91  cam_req_mgr_link_info_v2 {
    92  	session_hdl	session_handle
    93  	num_devices	len[dev_hdls, int32]
    94  	dev_hdls	array[int32, CAM_REQ_MGR_MAX_HANDLES_V2]
    95  	link_hdl	link_handle	(out)
    96  }
    97  
    98  cam_req_mgr_unlink_info {
    99  	session_hdl	session_handle
   100  	link_hdl	link_handle
   101  }
   102  
   103  cam_req_mgr_sched_request {
   104  	session_hdl	session_handle
   105  	link_hdl	link_handle
   106  	bubble_enable	int32
   107  	sync_mode	flags[sync_mode_flags, int32]
   108  	req_id		int64
   109  }
   110  
   111  cam_req_mgr_flush_info {
   112  	session_hdl	session_handle
   113  	link_hdl	link_handle
   114  	flush_type	flags[flush_type_flags, int32]
   115  	reserved	const[0, int32]
   116  	req_id		int64
   117  }
   118  
   119  cam_req_mgr_sync_mode {
   120  	session_hdl	session_handle
   121  	sync_mode	flags[sync_mode_flags, int32]
   122  	num_links	len[link_hdls, int32]
   123  	link_hdls	array[link_handle, MAX_LINKS_PER_SESSION]
   124  	master_link_hdl	link_handle
   125  	reserved	const[0, int32]
   126  }
   127  
   128  cam_mem_mgr_alloc_cmd {
   129  	len		int64
   130  	align		int64
   131  	mmu_hdls	array[int32, CAM_MEM_MMU_MAX_HANDLE]
   132  	num_hdl		len[mmu_hdls, int32]
   133  	flags		flags[mem_flags, int32]
   134  	out		cam_mem_alloc_out_params	(out)
   135  }
   136  
   137  cam_mem_alloc_out_params {
   138  	buf_handle	int32
   139  	fd		alloc_fd
   140  	vaddr		int64
   141  }
   142  
   143  cam_mem_mgr_map_cmd {
   144  	mmu_hdls	array[int32, CAM_MEM_MMU_MAX_HANDLE]
   145  	num_hdl		len[mmu_hdls, int32]
   146  	flags		flags[mem_flags, int32]
   147  	fd		alloc_fd
   148  	reserved	const[0, int32]
   149  	out		cam_mem_map_out_params	(out)
   150  }
   151  
   152  cam_mem_map_out_params {
   153  	buf_handle	int32
   154  	reserved	const[0, int32]
   155  	vaddr		int64
   156  }
   157  
   158  cam_mem_mgr_release_cmd {
   159  	buf_handle	int32
   160  	reserved	const[0, int32]
   161  }
   162  
   163  cam_req_mgr_link_control {
   164  	ops		flags[link_control_operation_flags, int32]
   165  	session_hdl	session_handle
   166  	num_links	len[link_hdls, int32]
   167  	reserved	const[0, int32]
   168  	link_hdls	array[link_handle, MAX_LINKS_PER_SESSION]
   169  }
   170  
   171  cam_dump_req_cmd {
   172  	issue_req_id	int64
   173  	session_handle	session_handle
   174  	link_hdl	int32
   175  	dev_handle	int32
   176  	error_type	int32
   177  	buf_handle	int32
   178  	offset		int32	(out)
   179  	reserved	const[0, int32]
   180  }
   181  
   182  flush_type_flags = CAM_REQ_MGR_FLUSH_TYPE_ALL, CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ, CAM_REQ_MGR_FLUSH_TYPE_MAX
   183  sync_mode_flags = CAM_REQ_MGR_SYNC_MODE_NO_SYNC, CAM_REQ_MGR_SYNC_MODE_SYNC
   184  link_control_operation_flags = CAM_REQ_MGR_LINK_ACTIVATE, CAM_REQ_MGR_LINK_DEACTIVATE
   185  mem_flags = CAM_MEM_FLAG_HW_READ_WRITE, CAM_MEM_FLAG_HW_READ_ONLY, CAM_MEM_FLAG_HW_WRITE_ONLY, CAM_MEM_FLAG_KMD_ACCESS, CAM_MEM_FLAG_UMD_ACCESS, CAM_MEM_FLAG_PROTECTED_MODE, CAM_MEM_FLAG_CMD_BUF_TYPE, CAM_MEM_FLAG_PIXEL_BUF_TYPE, CAM_MEM_FLAG_STATS_BUF_TYPE, CAM_MEM_FLAG_PACKET_BUF_TYPE, CAM_MEM_FLAG_CACHE, CAM_MEM_FLAG_HW_SHARED_ACCESS, CAM_MEM_FLAG_CDSP_OUTPUT