cam_sync.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  5. */
  6. #ifndef __UAPI_CAM_SYNC_H__
  7. #define __UAPI_CAM_SYNC_H__
  8. #include <linux/videodev2.h>
  9. #include <linux/types.h>
  10. #include <linux/ioctl.h>
  11. #include <linux/media.h>
  12. #define CAM_SYNC_DEVICE_NAME "cam_sync_device"
  13. /* V4L event which user space will subscribe to */
  14. #define CAM_SYNC_V4L_EVENT (V4L2_EVENT_PRIVATE_START + 0)
  15. #define CAM_SYNC_V4L_EVENT_V2 (V4L2_EVENT_PRIVATE_START + 1)
  16. /* Specific event ids to get notified in user space */
  17. #define CAM_SYNC_V4L_EVENT_ID_CB_TRIG 0
  18. /* Size of opaque payload sent to kernel for safekeeping until signal time */
  19. #define CAM_SYNC_USER_PAYLOAD_SIZE 2
  20. /* Device type for sync device needed for device discovery */
  21. #define CAM_SYNC_DEVICE_TYPE (MEDIA_ENT_F_OLD_BASE)
  22. #define CAM_SYNC_GET_PAYLOAD_PTR(ev, type) \
  23. (type *)((char *)ev.u.data + sizeof(struct cam_sync_ev_header))
  24. #define CAM_SYNC_GET_HEADER_PTR(ev) \
  25. ((struct cam_sync_ev_header *)ev.u.data)
  26. #define CAM_SYNC_GET_PAYLOAD_PTR_V2(ev, type) \
  27. (type *)((char *)ev.u.data + sizeof(struct cam_sync_ev_header_v2))
  28. #define CAM_SYNC_GET_HEADER_PTR_V2(ev) \
  29. ((struct cam_sync_ev_header_v2 *)ev.u.data)
  30. #define CAM_SYNC_STATE_INVALID 0
  31. #define CAM_SYNC_STATE_ACTIVE 1
  32. #define CAM_SYNC_STATE_SIGNALED_SUCCESS 2
  33. #define CAM_SYNC_STATE_SIGNALED_ERROR 3
  34. #define CAM_SYNC_STATE_SIGNALED_CANCEL 4
  35. /* Top level common sync event reason types */
  36. #define CAM_SYNC_COMMON_EVENT_START 0
  37. #define CAM_SYNC_COMMON_EVENT_UNUSED (CAM_SYNC_COMMON_EVENT_START + 0)
  38. #define CAM_SYNC_COMMON_EVENT_SUCCESS (CAM_SYNC_COMMON_EVENT_START + 1)
  39. #define CAM_SYNC_COMMON_EVENT_FLUSH (CAM_SYNC_COMMON_EVENT_START + 2)
  40. #define CAM_SYNC_COMMON_EVENT_STOP (CAM_SYNC_COMMON_EVENT_START + 3)
  41. #define CAM_SYNC_COMMON_EVENT_SYNX (CAM_SYNC_COMMON_EVENT_START + 4)
  42. #define CAM_SYNC_COMMON_REG_PAYLOAD_EVENT (CAM_SYNC_COMMON_EVENT_START + 5)
  43. #define CAM_SYNC_COMMON_SYNC_SIGNAL_EVENT (CAM_SYNC_COMMON_EVENT_START + 6)
  44. #define CAM_SYNC_COMMON_RELEASE_EVENT (CAM_SYNC_COMMON_EVENT_START + 7)
  45. #define CAM_SYNC_COMMON_EVENT_END (CAM_SYNC_COMMON_EVENT_START + 50)
  46. /* ISP Sync event reason types */
  47. #define CAM_SYNC_ISP_EVENT_START (CAM_SYNC_COMMON_EVENT_END + 1)
  48. #define CAM_SYNC_ISP_EVENT_UNKNOWN (CAM_SYNC_ISP_EVENT_START + 0)
  49. #define CAM_SYNC_ISP_EVENT_BUBBLE (CAM_SYNC_ISP_EVENT_START + 1)
  50. #define CAM_SYNC_ISP_EVENT_OVERFLOW (CAM_SYNC_ISP_EVENT_START + 2)
  51. #define CAM_SYNC_ISP_EVENT_P2I_ERROR (CAM_SYNC_ISP_EVENT_START + 3)
  52. #define CAM_SYNC_ISP_EVENT_VIOLATION (CAM_SYNC_ISP_EVENT_START + 4)
  53. #define CAM_SYNC_ISP_EVENT_BUSIF_OVERFLOW (CAM_SYNC_ISP_EVENT_START + 5)
  54. #define CAM_SYNC_ISP_EVENT_FLUSH (CAM_SYNC_ISP_EVENT_START + 6)
  55. #define CAM_SYNC_ISP_EVENT_HW_STOP (CAM_SYNC_ISP_EVENT_START + 7)
  56. #define CAM_SYNC_ISP_EVENT_RECOVERY_OVERFLOW (CAM_SYNC_ISP_EVENT_START + 8)
  57. #define CAM_SYNC_ISP_EVENT_CSID_OUTPUT_FIFO_OVERFLOW (CAM_SYNC_ISP_EVENT_START + 9)
  58. #define CAM_SYNC_ISP_EVENT_CSID_RX_ERROR (CAM_SYNC_ISP_EVENT_START + 10)
  59. #define CAM_SYNC_ISP_EVENT_CSID_SENSOR_SWITCH_ERROR (CAM_SYNC_ISP_EVENT_START + 11)
  60. #define CAM_SYNC_ISP_EVENT_END (CAM_SYNC_ISP_EVENT_START + 50)
  61. /* ICP Sync event reason types */
  62. #define CAM_SYNC_ICP_EVENT_START (CAM_SYNC_ISP_EVENT_END + 1)
  63. #define CAM_SYNC_ICP_EVENT_UNKNOWN (CAM_SYNC_ICP_EVENT_START + 0)
  64. #define CAM_SYNC_ICP_EVENT_FRAME_PROCESS_FAILURE (CAM_SYNC_ICP_EVENT_START + 1)
  65. #define CAM_SYNC_ICP_EVENT_CONFIG_ERR (CAM_SYNC_ICP_EVENT_START + 2)
  66. #define CAM_SYNC_ICP_EVENT_NO_MEMORY (CAM_SYNC_ICP_EVENT_START + 3)
  67. #define CAM_SYNC_ICP_EVENT_BAD_STATE (CAM_SYNC_ICP_EVENT_START + 4)
  68. #define CAM_SYNC_ICP_EVENT_BAD_PARAM (CAM_SYNC_ICP_EVENT_START + 5)
  69. #define CAM_SYNC_ICP_EVENT_BAD_ITEM (CAM_SYNC_ICP_EVENT_START + 6)
  70. #define CAM_SYNC_ICP_EVENT_INVALID_FORMAT (CAM_SYNC_ICP_EVENT_START + 7)
  71. #define CAM_SYNC_ICP_EVENT_UNSUPPORTED (CAM_SYNC_ICP_EVENT_START + 8)
  72. #define CAM_SYNC_ICP_EVENT_OUT_OF_BOUND (CAM_SYNC_ICP_EVENT_START + 9)
  73. #define CAM_SYNC_ICP_EVENT_TIME_OUT (CAM_SYNC_ICP_EVENT_START + 10)
  74. #define CAM_SYNC_ICP_EVENT_ABORTED (CAM_SYNC_ICP_EVENT_START + 11)
  75. #define CAM_SYNC_ICP_EVENT_HW_VIOLATION (CAM_SYNC_ICP_EVENT_START + 12)
  76. #define CAM_SYNC_ICP_EVENT_CMD_ERROR (CAM_SYNC_ICP_EVENT_START + 13)
  77. #define CAM_SYNC_ICP_EVENT_HFI_ERR_COMMAND_SIZE (CAM_SYNC_ICP_EVENT_START + 14)
  78. #define CAM_SYNC_ICP_EVENT_HFI_ERR_MESSAGE_SIZE (CAM_SYNC_ICP_EVENT_START + 15)
  79. #define CAM_SYNC_ICP_EVENT_HFI_ERR_QUEUE_EMPTY (CAM_SYNC_ICP_EVENT_START + 16)
  80. #define CAM_SYNC_ICP_EVENT_HFI_ERR_QUEUE_FULL (CAM_SYNC_ICP_EVENT_START + 17)
  81. #define CAM_SYNC_ICP_EVENT_END (CAM_SYNC_ICP_EVENT_START + 50)
  82. /* JPEG Sync event reason types */
  83. #define CAM_SYNC_JPEG_EVENT_START (CAM_SYNC_ICP_EVENT_END + 1)
  84. #define CAM_SYNC_JPEG_EVENT_UNKNOWN (CAM_SYNC_JPEG_EVENT_START + 0)
  85. #define CAM_SYNC_JPEG_EVENT_INVLD_CMD (CAM_SYNC_JPEG_EVENT_START + 1)
  86. #define CAM_SYNC_JPEG_EVENT_SET_IRQ_CB (CAM_SYNC_JPEG_EVENT_START + 2)
  87. #define CAM_SYNC_JPEG_EVENT_HW_RESET_FAILED (CAM_SYNC_JPEG_EVENT_START + 3)
  88. #define CAM_SYNC_JPEG_EVENT_CDM_CHANGE_BASE_ERR (CAM_SYNC_JPEG_EVENT_START + 4)
  89. #define CAM_SYNC_JPEG_EVENT_CDM_CONFIG_ERR (CAM_SYNC_JPEG_EVENT_START + 5)
  90. #define CAM_SYNC_JPEG_EVENT_START_HW_ERR (CAM_SYNC_JPEG_EVENT_START + 6)
  91. #define CAM_SYNC_JPEG_EVENT_START_HW_HANG (CAM_SYNC_JPEG_EVENT_START + 7)
  92. #define CAM_SYNC_JPEG_EVENT_MISR_CONFIG_ERR (CAM_SYNC_JPEG_EVENT_START + 8)
  93. #define CAM_SYNC_JPEG_EVENT_END (CAM_SYNC_JPEG_EVENT_START + 50)
  94. /* FD Sync event reason types */
  95. #define CAM_SYNC_FD_EVENT_START (CAM_SYNC_JPEG_EVENT_END + 1)
  96. #define CAM_SYNC_FD_EVENT_UNKNOWN (CAM_SYNC_FD_EVENT_START + 0)
  97. #define CAM_SYNC_FD_EVENT_IRQ_FRAME_DONE (CAM_SYNC_FD_EVENT_START + 1)
  98. #define CAM_SYNC_FD_EVENT_IRQ_RESET_DONE (CAM_SYNC_FD_EVENT_START + 2)
  99. #define CAM_SYNC_FD_EVENT_HALT (CAM_SYNC_FD_EVENT_START + 3)
  100. #define CAM_SYNC_FD_EVENT_END (CAM_SYNC_FD_EVENT_START + 50)
  101. /* LRME Sync event reason types */
  102. #define CAM_SYNC_LRME_EVENT_START (CAM_SYNC_FD_EVENT_END + 1)
  103. #define CAM_SYNC_LRME_EVENT_UNKNOWN (CAM_SYNC_LRME_EVENT_START + 0)
  104. #define CAM_SYNC_LRME_EVENT_CB_ERROR (CAM_SYNC_LRME_EVENT_START + 1)
  105. #define CAM_SYNC_LRME_EVENT_END (CAM_SYNC_LRME_EVENT_START + 50)
  106. /* OPE Sync event reason types */
  107. #define CAM_SYNC_OPE_EVENT_START (CAM_SYNC_LRME_EVENT_END + 1)
  108. #define CAM_SYNC_OPE_EVENT_UNKNOWN (CAM_SYNC_OPE_EVENT_START + 0)
  109. #define CAM_SYNC_OPE_EVENT_PAGE_FAULT (CAM_SYNC_OPE_EVENT_START + 1)
  110. #define CAM_SYNC_OPE_EVENT_HW_HANG (CAM_SYNC_OPE_EVENT_START + 2)
  111. #define CAM_SYNC_OPE_EVENT_HALT (CAM_SYNC_OPE_EVENT_START + 3)
  112. #define CAM_SYNC_OPE_EVENT_CONFIG_ERR (CAM_SYNC_OPE_EVENT_START + 4)
  113. #define CAM_SYNC_OPE_EVENT_HW_FLUSH (CAM_SYNC_OPE_EVENT_START + 5)
  114. #define CAM_SYNC_OPE_EVENT_HW_RESUBMIT (CAM_SYNC_OPE_EVENT_START + 6)
  115. #define CAM_SYNC_OPE_EVENT_HW_RESET_DONE (CAM_SYNC_OPE_EVENT_START + 7)
  116. #define CAM_SYNC_OPE_EVENT_HW_ERROR (CAM_SYNC_OPE_EVENT_START + 8)
  117. #define CAM_SYNC_OPE_EVENT_INVLD_CMD (CAM_SYNC_OPE_EVENT_START + 9)
  118. #define CAM_SYNC_OPE_EVENT_HW_RESET_FAILED (CAM_SYNC_OPE_EVENT_START + 10)
  119. #define CAM_SYNC_OPE_EVENT_END (CAM_SYNC_OPE_EVENT_START + 50)
  120. /* CRE Sync event reason types */
  121. #define CAM_SYNC_CRE_EVENT_START (CAM_SYNC_OPE_EVENT_END + 1)
  122. #define CAM_SYNC_CRE_EVENT_UNKNOWN (CAM_SYNC_CRE_EVENT_START + 0)
  123. #define CAM_SYNC_CRE_EVENT_CONFIG_ERR (CAM_SYNC_CRE_EVENT_START + 1)
  124. #define CAM_SYNC_CRE_EVENT_INVLD_CMD (CAM_SYNC_CRE_EVENT_START + 2)
  125. #define CAM_SYNC_CRE_EVENT_SET_IRQ_CB (CAM_SYNC_CRE_EVENT_START + 3)
  126. #define CAM_SYNC_CRE_EVENT_HW_RESET_FAILED (CAM_SYNC_CRE_EVENT_START + 4)
  127. #define CAM_SYNC_CRE_EVENT_HW_ERR (CAM_SYNC_CRE_EVENT_START + 5)
  128. #define CAM_SYNC_CRE_EVENT_END (CAM_SYNC_CRE_EVENT_START + 50)
  129. #define CAM_SYNC_EVENT_MAX 8
  130. #define CAM_SYNC_EVENT_REASON_CODE_INDEX 0
  131. /* Fence types supported by the driver, when used in the fence mask it
  132. * represents bit position, for masks it needs to be set as
  133. * BIT(fence_type) on other occasions use as is.
  134. */
  135. #define CAM_GENERIC_FENCE_TYPE_SYNC_OBJ 0x1
  136. #define CAM_GENERIC_FENCE_TYPE_DMA_FENCE 0x2
  137. #define CAM_GENERIC_FENCE_TYPE_SYNX_OBJ 0x3
  138. /* Additional param index for cam_generic_fence_config */
  139. #define CAM_GENERIC_FENCE_CONFIG_FLAG_PARAM_INDEX BIT(0)
  140. /* Flag fields for cam_generic_fence_config */
  141. #define CAM_GENERIC_FENCE_FLAG_IS_GLOBAL_SYNX_OBJ BIT(0)
  142. /**
  143. * struct cam_sync_ev_header - Event header for sync event notification
  144. *
  145. * @sync_obj: Sync object
  146. * @status: Status of the object
  147. */
  148. struct cam_sync_ev_header {
  149. __s32 sync_obj;
  150. __s32 status;
  151. };
  152. /**
  153. * struct cam_sync_ev_header_v2 - Event header for sync event notification
  154. *
  155. * @sync_obj: Sync object
  156. * @status: Status of the object
  157. * @version: sync driver version
  158. * @evt_param: event parameter
  159. */
  160. struct cam_sync_ev_header_v2 {
  161. __s32 sync_obj;
  162. __s32 status;
  163. uint32_t version;
  164. uint32_t evt_param[CAM_SYNC_EVENT_MAX];
  165. };
  166. /**
  167. * struct cam_sync_info - Sync object creation information
  168. *
  169. * @name: Optional string representation of the sync object
  170. * @sync_obj: Sync object returned after creation in kernel
  171. */
  172. struct cam_sync_info {
  173. char name[64];
  174. __s32 sync_obj;
  175. };
  176. /**
  177. * struct cam_sync_signal - Sync object signaling struct
  178. *
  179. * @sync_obj: Sync object to be signaled
  180. * @sync_state: State of the sync object to which it should be signaled
  181. */
  182. struct cam_sync_signal {
  183. __s32 sync_obj;
  184. __u32 sync_state;
  185. };
  186. /**
  187. * struct cam_sync_merge - Merge information for sync objects
  188. *
  189. * @sync_objs: Pointer to sync objects
  190. * @num_objs: Number of objects in the array
  191. * @merged: Merged sync object
  192. */
  193. struct cam_sync_merge {
  194. __u64 sync_objs;
  195. __u32 num_objs;
  196. __s32 merged;
  197. };
  198. /**
  199. * struct cam_sync_userpayload_info - Payload info from user space
  200. *
  201. * @sync_obj: Sync object for which payload has to be registered for
  202. * @reserved: Reserved
  203. * @payload: Pointer to user payload
  204. */
  205. struct cam_sync_userpayload_info {
  206. __s32 sync_obj;
  207. __u32 reserved;
  208. __u64 payload[CAM_SYNC_USER_PAYLOAD_SIZE];
  209. };
  210. /**
  211. * struct cam_sync_wait - Sync object wait information
  212. *
  213. * @sync_obj: Sync object to wait on
  214. * @reserved: Reserved
  215. * @timeout_ms: Timeout in milliseconds
  216. */
  217. struct cam_sync_wait {
  218. __s32 sync_obj;
  219. __u32 reserved;
  220. uint64_t timeout_ms;
  221. };
  222. /**
  223. * struct cam_generic_fence_config - Fence config
  224. * Based on the operation, fields could be
  225. * input/output
  226. *
  227. * @version: Struct version
  228. * @name: Optional string representation [used for create/import]
  229. * @fence_sel_mask: Fence select mask, if set for fence types other than the type
  230. * this input is processed for, the corresponding types would be
  231. * processed as well. For example if one wants to import a sync
  232. * object for an existing dma fence, set bit with index
  233. * CAM_GENERIC_FENCE_TYPE_SYNC_OBJ in mask,
  234. * a new sync object would be returned in sync_obj linked to an
  235. * existing dma_fence_fd.
  236. * @sync_obj: Sync object
  237. * @dma_fence_fd: DMA fence fd
  238. * @synx_obj: Synx object
  239. * @reason_code: Indicates if the operation was successful or not
  240. * for this set of fences. It is the responsibility of
  241. * the caller to clean up any partially processed batched
  242. * fences
  243. * @num_valid_params: Valid number of params being used
  244. * @valid_param_mask: Mask to indicate the field types in params
  245. * @params: Additional params
  246. */
  247. struct cam_generic_fence_config {
  248. __u32 version;
  249. char name[64];
  250. __u32 fence_sel_mask;
  251. __s32 sync_obj;
  252. __s32 dma_fence_fd;
  253. __s32 synx_obj;
  254. __s32 reason_code;
  255. __u32 num_valid_params;
  256. __u32 valid_param_mask;
  257. __u32 params[4];
  258. };
  259. /**
  260. * struct cam_generic_fence_signal_info - Fence signaling info
  261. *
  262. * @version: Struct version
  263. * @num_fences_requested: Number of fences to process
  264. * @num_fences_processed: Number of fences processed by the driver
  265. * @fence_handle_type: Type of the fence signal handle [user handle is expected]
  266. * @fence_data_size: Size of the data pointed to by fence_info_hdl,
  267. * it should be the consolidated size of
  268. * total fences to process * size of the corresponding signaling
  269. * input structure
  270. * @fence_info_hdl: Handle to the fence signal data (synx/dma)
  271. * @num_valid_params: Valid number of params being used
  272. * @valid_param_mask: Mask to indicate the field types in params
  273. * @params: Additional params
  274. */
  275. struct cam_generic_fence_signal_info {
  276. __u32 version;
  277. __u32 num_fences_requested;
  278. __u32 num_fences_processed;
  279. __u32 fence_handle_type;
  280. __u32 fence_data_size;
  281. __u64 fence_info_hdl;
  282. __u32 num_valid_params;
  283. __u32 valid_param_mask;
  284. __s32 params[3];
  285. };
  286. /**
  287. * struct cam_dma_fence_signal - DMA fence signaling info
  288. *
  289. * @version: Struct version
  290. * @dma_fence_fd: DMA fence to be signaled
  291. * @status: Any status if applicable, 0 for success
  292. * @num_valid_params: Valid number of params being used
  293. * @valid_param_mask: Mask to indicate the field types in params
  294. * @params: Additional params
  295. */
  296. struct cam_dma_fence_signal {
  297. __u32 version;
  298. __s32 dma_fence_fd;
  299. __s32 status;
  300. __u32 num_valid_params;
  301. __u32 valid_param_mask;
  302. __s32 params[3];
  303. };
  304. /**
  305. * struct cam_synx_obj_signal - Synx object signaling info
  306. *
  307. * @version: Struct version
  308. * @synx_obj: Synx object to be signaled
  309. * @status: Fence status
  310. * @reason_code: Indicates if the operation was successful or not
  311. * @num_valid_params: Valid number of params being used
  312. * @valid_param_mask: Mask to indicate the field types in params
  313. * @params: Additional params
  314. */
  315. struct cam_synx_obj_signal {
  316. __u32 version;
  317. __u32 synx_obj;
  318. __u32 status;
  319. __s32 reason_code;
  320. __u32 num_valid_params;
  321. __u32 valid_param_mask;
  322. __s32 params[4];
  323. };
  324. /**
  325. * struct cam_generic_fence_input_info - Parent structure that
  326. * provides info on fence batching
  327. *
  328. * @version: Struct version
  329. * @num_fences_requested: Number of fences to process
  330. * @num_fences_processed: Number of fences processed
  331. * If userland requests 5 fences to be created
  332. * and it fails on the 3rd, num processed will be
  333. * 3. This can be used by userspace to clean
  334. * partially batched fences
  335. * @num_valid_params: Valid number of params being used
  336. * @valid_param_mask: Mask to indicate the field types in params
  337. * @params: Additional params
  338. * @fence_info: Variable length fence info input based on num_fences
  339. */
  340. struct cam_generic_fence_input_info {
  341. __u32 version;
  342. __u32 num_fences_requested;
  343. __u32 num_fences_processed;
  344. __u32 num_valid_params;
  345. __u32 valid_param_mask;
  346. __s32 params[3];
  347. struct cam_generic_fence_config fence_cfg[1];
  348. };
  349. /**
  350. * struct cam_generic_fence_cmd_args - Generic fence cmd args
  351. *
  352. * @version: Struct version
  353. * @fence_type: Type of fence the ioctl cmd is for [dma/sync/synx]
  354. * @input_handle_type: Type of the fence input handle [user handle is expected]
  355. * @input_data_size: Size of the data pointed to by input_handle
  356. * @input_handle: Handle to the fence input data [create/signal/import...]
  357. * corresponding to the fence_type
  358. * @num_valid_params: Valid number of reserved params being used
  359. * @valid_param_mask: Mask to indicate the field types in params
  360. * @params: Additional params
  361. */
  362. struct cam_generic_fence_cmd_args {
  363. __u32 version;
  364. __u32 fence_type;
  365. __u32 input_handle_type;
  366. __u32 input_data_size;
  367. __u64 input_handle;
  368. __u32 num_valid_params;
  369. __u32 valid_param_mask;
  370. __u32 params[6];
  371. };
  372. /**
  373. * struct cam_private_ioctl_arg - Sync driver ioctl argument
  374. *
  375. * @id: IOCTL command id
  376. * @size: Size of command payload
  377. * @result: Result of command execution
  378. * @reserved: Reserved
  379. * @ioctl_ptr: Pointer to user data
  380. */
  381. struct cam_private_ioctl_arg {
  382. __u32 id;
  383. __u32 size;
  384. __u32 result;
  385. __u32 reserved;
  386. __u64 ioctl_ptr;
  387. };
  388. #define CAM_PRIVATE_IOCTL_CMD \
  389. _IOWR('V', BASE_VIDIOC_PRIVATE, struct cam_private_ioctl_arg)
  390. /* Exclusive sync object IOCTL cmds */
  391. #define CAM_SYNC_CREATE 0
  392. #define CAM_SYNC_DESTROY 1
  393. #define CAM_SYNC_SIGNAL 2
  394. #define CAM_SYNC_MERGE 3
  395. #define CAM_SYNC_REGISTER_PAYLOAD 4
  396. #define CAM_SYNC_DEREGISTER_PAYLOAD 5
  397. #define CAM_SYNC_WAIT 6
  398. /* Generic fence [sync/dma/synx] IOCTL cmds */
  399. #define CAM_GENERIC_FENCE_CREATE 11
  400. #define CAM_GENERIC_FENCE_RELEASE 12
  401. #define CAM_GENERIC_FENCE_IMPORT 13
  402. #define CAM_GENERIC_FENCE_SIGNAL 14
  403. #endif /* __UAPI_CAM_SYNC_H__ */