aboutsummaryrefslogtreecommitdiffstats
path: root/sys/linux/dev_camx.txt
blob: bac92fd753391e201a4c274606eed428763d6aec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# Copyright 2023 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

# The source file of camx ioctl can be found in ChromeOS source tree:
# https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-5.15/drivers/media/platform/camx/

# Not upstream, generated on:
# https://chromium.googlesource.com/chromiumos/third_party/kernel cdff88937190
# with -includedirs drivers/media/platform/camx/include/uapi
meta noextract

include <media/cam_req_mgr.h>
include <uapi/linux/fcntl.h>

resource fd_camx[fd]
resource session_handle[int32]
resource link_handle[int32]
resource alloc_fd[fd]

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

# no code handles commented out op_code

# 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])
ioctl$CAM_REQ_MGR_CREATE_SESSION(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_CREATE_SESSION])
ioctl$CAM_REQ_MGR_DESTROY_SESSION(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_DESTROY_SESSION])
ioctl$CAM_REQ_MGR_LINK(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK])
ioctl$CAM_REQ_MGR_UNLINK(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_UNLINK])
ioctl$CAM_REQ_MGR_SCHED_REQ(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_SCHED_REQ])
ioctl$CAM_REQ_MGR_FLUSH_REQ(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_FLUSH_REQ])
ioctl$CAM_REQ_MGR_SYNC_MODE(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_SYNC_MODE])
ioctl$CAM_REQ_MGR_ALLOC_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_ALLOC_BUF])
ioctl$CAM_REQ_MGR_MAP_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_MAP_BUF])
ioctl$CAM_REQ_MGR_RELEASE_BUF(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_RELEASE_BUF])
# ioctl$CAM_REQ_MGR_CACHE_OPS(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_CACHE_OPS])
ioctl$CAM_REQ_MGR_LINK_CONTROL(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK_CONTROL])
ioctl$CAM_REQ_MGR_LINK_V2(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_LINK_V2])
ioctl$CAM_REQ_MGR_REQUEST_DUMP(fd fd_camx, cmd const[VIDIOC_CAM_CONTROL], arg ptr[inout, cam_control$CAM_REQ_MGR_REQUEST_DUMP])

type cam_control[OPCODE, HANDLE] {
	op_code		const[OPCODE, int32]
	size		bytesize[handle, int32]
	handle_type	const[CAM_HANDLE_USER_POINTER, int32]
	reserved	const[0, int32]
	handle		ptr[in, HANDLE]
}

type cam_control$CAM_REQ_MGR_CREATE_SESSION cam_control[CAM_REQ_MGR_CREATE_SESSION, cam_req_mgr_session_info__for_create]
type cam_control$CAM_REQ_MGR_DESTROY_SESSION cam_control[CAM_REQ_MGR_DESTROY_SESSION, cam_req_mgr_session_info__for_destroy]
type cam_control$CAM_REQ_MGR_LINK cam_control[CAM_REQ_MGR_LINK, cam_req_mgr_ver_info]
type cam_control$CAM_REQ_MGR_UNLINK cam_control[CAM_REQ_MGR_UNLINK, cam_req_mgr_unlink_info]
type cam_control$CAM_REQ_MGR_SCHED_REQ cam_control[CAM_REQ_MGR_SCHED_REQ, cam_req_mgr_sched_request]
type cam_control$CAM_REQ_MGR_FLUSH_REQ cam_control[CAM_REQ_MGR_FLUSH_REQ, cam_req_mgr_flush_info]
type cam_control$CAM_REQ_MGR_SYNC_MODE cam_control[CAM_REQ_MGR_SYNC_MODE, cam_req_mgr_sync_mode]
type cam_control$CAM_REQ_MGR_ALLOC_BUF cam_control[CAM_REQ_MGR_ALLOC_BUF, cam_mem_mgr_alloc_cmd]
type cam_control$CAM_REQ_MGR_MAP_BUF cam_control[CAM_REQ_MGR_MAP_BUF, cam_mem_mgr_map_cmd]
type cam_control$CAM_REQ_MGR_RELEASE_BUF cam_control[CAM_REQ_MGR_RELEASE_BUF, cam_mem_mgr_release_cmd]
type cam_control$CAM_REQ_MGR_LINK_CONTROL cam_control[CAM_REQ_MGR_LINK_CONTROL, cam_req_mgr_link_control]
type cam_control$CAM_REQ_MGR_LINK_V2 cam_control[CAM_REQ_MGR_LINK_V2, cam_req_mgr_ver_info]
type cam_control$CAM_REQ_MGR_REQUEST_DUMP cam_control[CAM_REQ_MGR_REQUEST_DUMP, cam_dump_req_cmd]

# originally cam_req_mgr_session_info
cam_req_mgr_session_info__for_create {
	session_hdl	session_handle	(out)
	reserved	const[0, int32]
}

# originally cam_req_mgr_session_info
cam_req_mgr_session_info__for_destroy {
	session_hdl	session_handle
	reserved	const[0, int32]
}

cam_req_mgr_ver_info {
	version	int32	(out)
	u	cam_req_mgr_ver_info_union
}

cam_req_mgr_ver_info_union {
	link_info_v1	cam_req_mgr_link_info
	link_info_v2	cam_req_mgr_link_info_v2
}

cam_req_mgr_link_info {
	session_hdl	session_handle
	num_devices	len[dev_hdls, int32]
	dev_hdls	array[int32, CAM_REQ_MGR_MAX_HANDLES]
	link_hdl	link_handle	(out)
}

cam_req_mgr_link_info_v2 {
	session_hdl	session_handle
	num_devices	len[dev_hdls, int32]
	dev_hdls	array[int32, CAM_REQ_MGR_MAX_HANDLES_V2]
	link_hdl	link_handle	(out)
}

cam_req_mgr_unlink_info {
	session_hdl	session_handle
	link_hdl	link_handle
}

cam_req_mgr_sched_request {
	session_hdl	session_handle
	link_hdl	link_handle
	bubble_enable	int32
	sync_mode	flags[sync_mode_flags, int32]
	req_id		int64
}

cam_req_mgr_flush_info {
	session_hdl	session_handle
	link_hdl	link_handle
	flush_type	flags[flush_type_flags, int32]
	reserved	const[0, int32]
	req_id		int64
}

cam_req_mgr_sync_mode {
	session_hdl	session_handle
	sync_mode	flags[sync_mode_flags, int32]
	num_links	len[link_hdls, int32]
	link_hdls	array[link_handle, MAX_LINKS_PER_SESSION]
	master_link_hdl	link_handle
	reserved	const[0, int32]
}

cam_mem_mgr_alloc_cmd {
	len		int64
	align		int64
	mmu_hdls	array[int32, CAM_MEM_MMU_MAX_HANDLE]
	num_hdl		len[mmu_hdls, int32]
	flags		flags[mem_flags, int32]
	out		cam_mem_alloc_out_params	(out)
}

cam_mem_alloc_out_params {
	buf_handle	int32
	fd		alloc_fd
	vaddr		int64
}

cam_mem_mgr_map_cmd {
	mmu_hdls	array[int32, CAM_MEM_MMU_MAX_HANDLE]
	num_hdl		len[mmu_hdls, int32]
	flags		flags[mem_flags, int32]
	fd		alloc_fd
	reserved	const[0, int32]
	out		cam_mem_map_out_params	(out)
}

cam_mem_map_out_params {
	buf_handle	int32
	reserved	const[0, int32]
	vaddr		int64
}

cam_mem_mgr_release_cmd {
	buf_handle	int32
	reserved	const[0, int32]
}

cam_req_mgr_link_control {
	ops		flags[link_control_operation_flags, int32]
	session_hdl	session_handle
	num_links	len[link_hdls, int32]
	reserved	const[0, int32]
	link_hdls	array[link_handle, MAX_LINKS_PER_SESSION]
}

cam_dump_req_cmd {
	issue_req_id	int64
	session_handle	session_handle
	link_hdl	int32
	dev_handle	int32
	error_type	int32
	buf_handle	int32
	offset		int32	(out)
	reserved	const[0, int32]
}

flush_type_flags = CAM_REQ_MGR_FLUSH_TYPE_ALL, CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ, CAM_REQ_MGR_FLUSH_TYPE_MAX
sync_mode_flags = CAM_REQ_MGR_SYNC_MODE_NO_SYNC, CAM_REQ_MGR_SYNC_MODE_SYNC
link_control_operation_flags = CAM_REQ_MGR_LINK_ACTIVATE, CAM_REQ_MGR_LINK_DEACTIVATE
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