cam_req_mgr.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __UAPI_LINUX_CAM_REQ_MGR_H
  6. #define __UAPI_LINUX_CAM_REQ_MGR_H
  7. #include <linux/videodev2.h>
  8. #include <linux/types.h>
  9. #include <linux/ioctl.h>
  10. #include <linux/media.h>
  11. #include <media/cam_defs.h>
  12. #define CAM_REQ_MGR_VNODE_NAME "cam-req-mgr-devnode"
  13. #define CAM_DEVICE_TYPE_BASE (MEDIA_ENT_F_OLD_BASE)
  14. #define CAM_VNODE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE)
  15. #define CAM_SENSOR_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 1)
  16. #define CAM_IFE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 2)
  17. #define CAM_ICP_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 3)
  18. #define CAM_LRME_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 4)
  19. #define CAM_JPEG_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 5)
  20. #define CAM_FD_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 6)
  21. #define CAM_CPAS_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 7)
  22. #define CAM_CSIPHY_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 8)
  23. #define CAM_ACTUATOR_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 9)
  24. #define CAM_CCI_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 10)
  25. #define CAM_FLASH_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 11)
  26. #define CAM_EEPROM_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 12)
  27. #define CAM_OIS_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 13)
  28. #define CAM_CUSTOM_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 14)
  29. #define CAM_OPE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 15)
  30. #define CAM_TFE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 16)
  31. #define CAM_CRE_DEVICE_TYPE (CAM_DEVICE_TYPE_BASE + 17)
  32. /* cam_req_mgr hdl info */
  33. #define CAM_REQ_MGR_HDL_IDX_POS 8
  34. #define CAM_REQ_MGR_HDL_IDX_MASK ((1 << CAM_REQ_MGR_HDL_IDX_POS) - 1)
  35. #define CAM_REQ_MGR_GET_HDL_IDX(hdl) (hdl & CAM_REQ_MGR_HDL_IDX_MASK)
  36. /**
  37. * Max handles supported by cam_req_mgr
  38. * It includes both session and device handles
  39. */
  40. #define CAM_REQ_MGR_MAX_HANDLES 64
  41. #define CAM_REQ_MGR_MAX_HANDLES_V2 256
  42. #define MAX_LINKS_PER_SESSION 2
  43. /* V4L event type which user space will subscribe to */
  44. #define V4L_EVENT_CAM_REQ_MGR_EVENT (V4L2_EVENT_PRIVATE_START + 0)
  45. /* Specific event ids to get notified in user space */
  46. #define V4L_EVENT_CAM_REQ_MGR_SOF 0
  47. #define V4L_EVENT_CAM_REQ_MGR_ERROR 1
  48. #define V4L_EVENT_CAM_REQ_MGR_SOF_BOOT_TS 2
  49. #define V4L_EVENT_CAM_REQ_MGR_CUSTOM_EVT 3
  50. /* SOF Event status */
  51. #define CAM_REQ_MGR_SOF_EVENT_SUCCESS 0
  52. #define CAM_REQ_MGR_SOF_EVENT_ERROR 1
  53. /* Link control operations */
  54. #define CAM_REQ_MGR_LINK_ACTIVATE 0
  55. #define CAM_REQ_MGR_LINK_DEACTIVATE 1
  56. /**
  57. * Request Manager : flush_type
  58. * @CAM_REQ_MGR_FLUSH_TYPE_ALL: Req mgr will remove all the pending
  59. * requests from input/processing queue.
  60. * @CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ: Req mgr will remove only particular
  61. * request id from input/processing queue.
  62. * @CAM_REQ_MGR_FLUSH_TYPE_MAX: Max number of the flush type
  63. * @opcode: CAM_REQ_MGR_FLUSH_REQ
  64. */
  65. #define CAM_REQ_MGR_FLUSH_TYPE_ALL 0
  66. #define CAM_REQ_MGR_FLUSH_TYPE_CANCEL_REQ 1
  67. #define CAM_REQ_MGR_FLUSH_TYPE_MAX 2
  68. /**
  69. * Request Manager : Sync Mode type
  70. * @CAM_REQ_MGR_SYNC_MODE_NO_SYNC: Req mgr will apply non-sync mode for this
  71. * request.
  72. * @CAM_REQ_MGR_SYNC_MODE_SYNC: Req mgr will apply sync mode for this request.
  73. */
  74. #define CAM_REQ_MGR_SYNC_MODE_NO_SYNC 0
  75. #define CAM_REQ_MGR_SYNC_MODE_SYNC 1
  76. /**
  77. * struct cam_req_mgr_event_data
  78. * @session_hdl: session handle
  79. * @link_hdl: link handle
  80. * @frame_id: frame id
  81. * @reserved: reserved for 64 bit aligngment
  82. * @req_id: request id
  83. * @tv_sec: timestamp in seconds
  84. * @tv_usec: timestamp in micro seconds
  85. */
  86. struct cam_req_mgr_event_data {
  87. __s32 session_hdl;
  88. __s32 link_hdl;
  89. __s32 frame_id;
  90. __s32 reserved;
  91. __s64 req_id;
  92. __u64 tv_sec;
  93. __u64 tv_usec;
  94. };
  95. /**
  96. * struct cam_req_mgr_session_info
  97. * @session_hdl: In/Output param - session_handle
  98. * @opcode1: CAM_REQ_MGR_CREATE_SESSION
  99. * @opcode2: CAM_REQ_MGR_DESTROY_SESSION
  100. */
  101. struct cam_req_mgr_session_info {
  102. __s32 session_hdl;
  103. __s32 reserved;
  104. };
  105. /**
  106. * struct cam_req_mgr_link_info
  107. * @session_hdl: Input param - Identifier for CSL session
  108. * @num_devices: Input Param - Num of devices to be linked
  109. * @dev_hdls: Input param - List of device handles to be linked
  110. * @link_hdl: Output Param -Identifier for link
  111. * @opcode: CAM_REQ_MGR_LINK
  112. */
  113. struct cam_req_mgr_link_info {
  114. __s32 session_hdl;
  115. __u32 num_devices;
  116. __s32 dev_hdls[CAM_REQ_MGR_MAX_HANDLES];
  117. __s32 link_hdl;
  118. };
  119. struct cam_req_mgr_link_info_v2 {
  120. __s32 session_hdl;
  121. __u32 num_devices;
  122. __s32 dev_hdls[CAM_REQ_MGR_MAX_HANDLES_V2];
  123. __s32 link_hdl;
  124. };
  125. struct cam_req_mgr_ver_info {
  126. __u32 version;
  127. union {
  128. struct cam_req_mgr_link_info link_info_v1;
  129. struct cam_req_mgr_link_info_v2 link_info_v2;
  130. } u;
  131. };
  132. /**
  133. * struct cam_req_mgr_unlink_info
  134. * @session_hdl: input param - session handle
  135. * @link_hdl: input param - link handle
  136. * @opcode: CAM_REQ_MGR_UNLINK
  137. */
  138. struct cam_req_mgr_unlink_info {
  139. __s32 session_hdl;
  140. __s32 link_hdl;
  141. };
  142. /**
  143. * struct cam_req_mgr_flush_info
  144. * @brief: User can tell drivers to flush a particular request id or
  145. * flush all requests from its pending processing queue. Flush is a
  146. * blocking call and driver shall ensure all requests are flushed
  147. * before returning.
  148. * @session_hdl: Input param - Identifier for CSL session
  149. * @link_hdl: Input Param -Identifier for link
  150. * @flush_type: User can cancel a particular req id or can flush
  151. * all requests in queue
  152. * @reserved: reserved for 64 bit aligngment
  153. * @req_id: field is valid only if flush type is cancel request
  154. * for flush all this field value is not considered.
  155. * @opcode: CAM_REQ_MGR_FLUSH_REQ
  156. */
  157. struct cam_req_mgr_flush_info {
  158. __s32 session_hdl;
  159. __s32 link_hdl;
  160. __u32 flush_type;
  161. __u32 reserved;
  162. __s64 req_id;
  163. };
  164. /** struct cam_req_mgr_sched_info
  165. * @session_hdl: Input param - Identifier for CSL session
  166. * @link_hdl: Input Param -Identifier for link
  167. * inluding itself.
  168. * @bubble_enable: Input Param - Cam req mgr will do bubble recovery if this
  169. * flag is set.
  170. * @sync_mode: Type of Sync mode for this request
  171. * @additional_timeout: Additional timeout value (in ms) associated with
  172. * this request. This value needs to be 0 in cases where long exposure is
  173. * not configured for the sensor.The max timeout that will be supported
  174. * is 50000 ms
  175. * @reserved: Reserved
  176. * @req_id: Input Param - Request Id from which all requests will be flushed
  177. */
  178. struct cam_req_mgr_sched_request {
  179. __s32 session_hdl;
  180. __s32 link_hdl;
  181. __s32 bubble_enable;
  182. __s32 sync_mode;
  183. __s32 additional_timeout;
  184. __s32 reserved;
  185. __s64 req_id;
  186. };
  187. /**
  188. * struct cam_req_mgr_sync_mode
  189. * @session_hdl: Input param - Identifier for CSL session
  190. * @sync_mode: Input Param - Type of sync mode
  191. * @num_links: Input Param - Num of links in sync mode (Valid only
  192. * when sync_mode is one of SYNC enabled modes)
  193. * @link_hdls: Input Param - Array of link handles to be in sync mode
  194. * (Valid only when sync_mode is one of SYNC
  195. * enabled modes)
  196. * @master_link_hdl: Input Param - To dictate which link's SOF drives system
  197. * (Valid only when sync_mode is one of SYNC
  198. * enabled modes)
  199. *
  200. * @opcode: CAM_REQ_MGR_SYNC_MODE
  201. */
  202. struct cam_req_mgr_sync_mode {
  203. __s32 session_hdl;
  204. __s32 sync_mode;
  205. __s32 num_links;
  206. __s32 link_hdls[MAX_LINKS_PER_SESSION];
  207. __s32 master_link_hdl;
  208. __s32 reserved;
  209. };
  210. /**
  211. * struct cam_req_mgr_link_control
  212. * @ops: Link operations: activate/deactive
  213. * @session_hdl: Input param - Identifier for CSL session
  214. * @num_links: Input Param - Num of links
  215. * @reserved: reserved field
  216. * @init_timeout: To account for INIT exposure settings (ms)
  217. * If there is no change in exp settings
  218. * field needs to assigned to 0ms.
  219. * @link_hdls: Input Param - Links to be activated/deactivated
  220. *
  221. * @opcode: CAM_REQ_MGR_LINK_CONTROL
  222. */
  223. struct cam_req_mgr_link_control {
  224. __s32 ops;
  225. __s32 session_hdl;
  226. __s32 num_links;
  227. __s32 reserved;
  228. __s32 init_timeout[MAX_LINKS_PER_SESSION];
  229. __s32 link_hdls[MAX_LINKS_PER_SESSION];
  230. };
  231. /**
  232. * cam_req_mgr specific opcode ids
  233. */
  234. #define CAM_REQ_MGR_CREATE_DEV_NODES (CAM_COMMON_OPCODE_MAX + 1)
  235. #define CAM_REQ_MGR_CREATE_SESSION (CAM_COMMON_OPCODE_MAX + 2)
  236. #define CAM_REQ_MGR_DESTROY_SESSION (CAM_COMMON_OPCODE_MAX + 3)
  237. #define CAM_REQ_MGR_LINK (CAM_COMMON_OPCODE_MAX + 4)
  238. #define CAM_REQ_MGR_UNLINK (CAM_COMMON_OPCODE_MAX + 5)
  239. #define CAM_REQ_MGR_SCHED_REQ (CAM_COMMON_OPCODE_MAX + 6)
  240. #define CAM_REQ_MGR_FLUSH_REQ (CAM_COMMON_OPCODE_MAX + 7)
  241. #define CAM_REQ_MGR_SYNC_MODE (CAM_COMMON_OPCODE_MAX + 8)
  242. #define CAM_REQ_MGR_ALLOC_BUF (CAM_COMMON_OPCODE_MAX + 9)
  243. #define CAM_REQ_MGR_MAP_BUF (CAM_COMMON_OPCODE_MAX + 10)
  244. #define CAM_REQ_MGR_RELEASE_BUF (CAM_COMMON_OPCODE_MAX + 11)
  245. #define CAM_REQ_MGR_CACHE_OPS (CAM_COMMON_OPCODE_MAX + 12)
  246. #define CAM_REQ_MGR_LINK_CONTROL (CAM_COMMON_OPCODE_MAX + 13)
  247. #define CAM_REQ_MGR_LINK_V2 (CAM_COMMON_OPCODE_MAX + 14)
  248. #define CAM_REQ_MGR_REQUEST_DUMP (CAM_COMMON_OPCODE_MAX + 15)
  249. /* end of cam_req_mgr opcodes */
  250. #define CAM_MEM_FLAG_HW_READ_WRITE (1<<0)
  251. #define CAM_MEM_FLAG_HW_READ_ONLY (1<<1)
  252. #define CAM_MEM_FLAG_HW_WRITE_ONLY (1<<2)
  253. #define CAM_MEM_FLAG_KMD_ACCESS (1<<3)
  254. #define CAM_MEM_FLAG_UMD_ACCESS (1<<4)
  255. #define CAM_MEM_FLAG_PROTECTED_MODE (1<<5)
  256. #define CAM_MEM_FLAG_CMD_BUF_TYPE (1<<6)
  257. #define CAM_MEM_FLAG_PIXEL_BUF_TYPE (1<<7)
  258. #define CAM_MEM_FLAG_STATS_BUF_TYPE (1<<8)
  259. #define CAM_MEM_FLAG_PACKET_BUF_TYPE (1<<9)
  260. #define CAM_MEM_FLAG_CACHE (1<<10)
  261. #define CAM_MEM_FLAG_HW_SHARED_ACCESS (1<<11)
  262. #define CAM_MEM_FLAG_CDSP_OUTPUT (1<<12)
  263. #define CAM_MEM_FLAG_DISABLE_DELAYED_UNMAP (1<<13)
  264. #define CAM_MEM_FLAG_KMD_DEBUG_FLAG (1<<14)
  265. #define CAM_MEM_MMU_MAX_HANDLE 16
  266. /* Maximum allowed buffers in existence */
  267. #define CAM_MEM_BUFQ_MAX 2048
  268. #define CAM_MEM_MGR_SECURE_BIT_POS 15
  269. #define CAM_MEM_MGR_HDL_IDX_SIZE 15
  270. #define CAM_MEM_MGR_HDL_FD_SIZE 16
  271. #define CAM_MEM_MGR_HDL_IDX_END_POS 16
  272. #define CAM_MEM_MGR_HDL_FD_END_POS 32
  273. #define CAM_MEM_MGR_HDL_IDX_MASK ((1 << CAM_MEM_MGR_HDL_IDX_SIZE) - 1)
  274. #define GET_MEM_HANDLE(idx, fd) \
  275. ((idx & CAM_MEM_MGR_HDL_IDX_MASK) | \
  276. (fd << (CAM_MEM_MGR_HDL_FD_END_POS - CAM_MEM_MGR_HDL_FD_SIZE))) \
  277. #define GET_FD_FROM_HANDLE(hdl) \
  278. (hdl >> (CAM_MEM_MGR_HDL_FD_END_POS - CAM_MEM_MGR_HDL_FD_SIZE)) \
  279. #define CAM_MEM_MGR_GET_HDL_IDX(hdl) (hdl & CAM_MEM_MGR_HDL_IDX_MASK)
  280. #define CAM_MEM_MGR_SET_SECURE_HDL(hdl, flag) \
  281. ((flag) ? (hdl |= (1 << CAM_MEM_MGR_SECURE_BIT_POS)) : \
  282. ((hdl) &= ~(1 << CAM_MEM_MGR_SECURE_BIT_POS)))
  283. #define CAM_MEM_MGR_IS_SECURE_HDL(hdl) \
  284. (((hdl) & \
  285. (1<<CAM_MEM_MGR_SECURE_BIT_POS)) >> CAM_MEM_MGR_SECURE_BIT_POS)
  286. /**
  287. * memory allocation type
  288. */
  289. #define CAM_MEM_DMA_NONE 0
  290. #define CAM_MEM_DMA_BIDIRECTIONAL 1
  291. #define CAM_MEM_DMA_TO_DEVICE 2
  292. #define CAM_MEM_DMA_FROM_DEVICE 3
  293. /**
  294. * memory cache operation
  295. */
  296. #define CAM_MEM_CLEAN_CACHE 1
  297. #define CAM_MEM_INV_CACHE 2
  298. #define CAM_MEM_CLEAN_INV_CACHE 3
  299. /**
  300. * struct cam_mem_alloc_out_params
  301. * @buf_handle: buffer handle
  302. * @fd: output buffer file descriptor
  303. * @vaddr: virtual address pointer
  304. */
  305. struct cam_mem_alloc_out_params {
  306. __u32 buf_handle;
  307. __s32 fd;
  308. __u64 vaddr;
  309. };
  310. /**
  311. * struct cam_mem_map_out_params
  312. * @buf_handle: buffer handle
  313. * @size: size of the buffer being mapped
  314. * @vaddr: virtual address pointer
  315. */
  316. struct cam_mem_map_out_params {
  317. __u32 buf_handle;
  318. __u32 size;
  319. __u64 vaddr;
  320. };
  321. /**
  322. * struct cam_mem_mgr_alloc_cmd
  323. * @len: size of buffer to allocate
  324. * @align: alignment of the buffer
  325. * @mmu_hdls: array of mmu handles
  326. * @num_hdl: number of handles
  327. * @flags: flags of the buffer
  328. * @out: out params
  329. */
  330. /* CAM_REQ_MGR_ALLOC_BUF */
  331. struct cam_mem_mgr_alloc_cmd {
  332. __u64 len;
  333. __u64 align;
  334. __s32 mmu_hdls[CAM_MEM_MMU_MAX_HANDLE];
  335. __u32 num_hdl;
  336. __u32 flags;
  337. struct cam_mem_alloc_out_params out;
  338. };
  339. /**
  340. * struct cam_mem_mgr_map_cmd
  341. * @mmu_hdls: array of mmu handles
  342. * @num_hdl: number of handles
  343. * @flags: flags of the buffer
  344. * @fd: output buffer file descriptor
  345. * @reserved: reserved field
  346. * @out: out params
  347. */
  348. /* CAM_REQ_MGR_MAP_BUF */
  349. struct cam_mem_mgr_map_cmd {
  350. __s32 mmu_hdls[CAM_MEM_MMU_MAX_HANDLE];
  351. __u32 num_hdl;
  352. __u32 flags;
  353. __s32 fd;
  354. __u32 reserved;
  355. struct cam_mem_map_out_params out;
  356. };
  357. /**
  358. * struct cam_mem_mgr_map_cmd
  359. * @buf_handle: buffer handle
  360. * @reserved: reserved field
  361. */
  362. /* CAM_REQ_MGR_RELEASE_BUF */
  363. struct cam_mem_mgr_release_cmd {
  364. __s32 buf_handle;
  365. __u32 reserved;
  366. };
  367. /**
  368. * struct cam_mem_mgr_map_cmd
  369. * @buf_handle: buffer handle
  370. * @ops: cache operations
  371. */
  372. /* CAM_REQ_MGR_CACHE_OPS */
  373. struct cam_mem_cache_ops_cmd {
  374. __s32 buf_handle;
  375. __u32 mem_cache_ops;
  376. };
  377. /**
  378. * Request Manager : error message type
  379. * @CAM_REQ_MGR_ERROR_TYPE_DEVICE: Device error message, fatal to session
  380. * @CAM_REQ_MGR_ERROR_TYPE_REQUEST: Error on a single request, not fatal
  381. * @CAM_REQ_MGR_ERROR_TYPE_BUFFER: Buffer was not filled, not fatal
  382. * @CAM_REQ_MGR_ERROR_TYPE_RECOVERY: Fatal error, can be recovered
  383. * @CAM_REQ_MGR_ERROR_TYPE_SOF_FREEZE: SOF freeze, can be recovered
  384. * @CAM_REQ_MGR_ERROR_TYPE_FULL_RECOVERY: Full recovery, can be recovered
  385. * @CAM_REQ_MGR_ERROR_TYPE_PAGE_FAULT: page fault, can be recovered
  386. */
  387. #define CAM_REQ_MGR_ERROR_TYPE_DEVICE 0
  388. #define CAM_REQ_MGR_ERROR_TYPE_REQUEST 1
  389. #define CAM_REQ_MGR_ERROR_TYPE_BUFFER 2
  390. #define CAM_REQ_MGR_ERROR_TYPE_RECOVERY 3
  391. #define CAM_REQ_MGR_ERROR_TYPE_SOF_FREEZE 4
  392. #define CAM_REQ_MGR_ERROR_TYPE_FULL_RECOVERY 5
  393. #define CAM_REQ_MGR_ERROR_TYPE_PAGE_FAULT 6
  394. /**
  395. * Request Manager : Error codes
  396. * @CAM_REQ_MGR_ISP_UNREPORTED_ERROR : No Error Code reported
  397. * @CAM_REQ_MGR_LINK_STALLED_ERROR : Unable to apply requests on link
  398. * @CAM_REQ_MGR_CSID_FATAL_ERROR : CSID FATAL Error
  399. * @CAM_REQ_MGR_CSID_FIFO_OVERFLOW_ERROR : CSID FIFO Overflow
  400. * @CAM_REQ_MGR_CSID_RECOVERY_OVERFLOW_ERROR : CSID Recovery Overflow
  401. * @CAM_REQ_MGR_CSID_PIXEL_COUNT_MISMATCH : CSID Pixel Count Mismatch
  402. */
  403. #define CAM_REQ_MGR_ISP_UNREPORTED_ERROR 0
  404. #define CAM_REQ_MGR_LINK_STALLED_ERROR BIT(0)
  405. #define CAM_REQ_MGR_CSID_FATAL_ERROR BIT(1)
  406. #define CAM_REQ_MGR_CSID_FIFO_OVERFLOW_ERROR BIT(2)
  407. #define CAM_REQ_MGR_CSID_RECOVERY_OVERFLOW_ERROR BIT(3)
  408. #define CAM_REQ_MGR_CSID_PIXEL_COUNT_MISMATCH BIT(5)
  409. /**
  410. * struct cam_req_mgr_error_msg
  411. * @error_type: type of error
  412. * @request_id: request id of frame
  413. * @device_hdl: device handle
  414. * @linke_hdl: link_hdl
  415. * @resource_size: size of the resource
  416. * @error_code: Error code reported by the event.
  417. * Note: This field is a bit field.
  418. */
  419. struct cam_req_mgr_error_msg {
  420. __u32 error_type;
  421. __u32 request_id;
  422. __s32 device_hdl;
  423. __s32 link_hdl;
  424. __u32 resource_size;
  425. __u32 error_code;
  426. };
  427. /**
  428. * struct cam_req_mgr_frame_msg
  429. * @request_id: request id of the frame
  430. * @frame_id: frame id of the frame
  431. * @timestamp: timestamp of the frame
  432. * @link_hdl: link handle associated with this message
  433. * @sof_status: sof status success or fail
  434. * @frame_id_meta: refers to the meta for
  435. * that frame in specific usecases
  436. * @reserved: reserved
  437. */
  438. struct cam_req_mgr_frame_msg {
  439. __u64 request_id;
  440. __u64 frame_id;
  441. __u64 timestamp;
  442. __s32 link_hdl;
  443. __u32 sof_status;
  444. __u32 frame_id_meta;
  445. __u32 reserved;
  446. };
  447. /**
  448. * struct cam_req_mgr_custom_msg
  449. * @custom_type: custom type
  450. * @request_id: request id of the frame
  451. * @frame_id: frame id of the frame
  452. * @timestamp: timestamp of the frame
  453. * @link_hdl: link handle associated with this message
  454. * @custom_data: custom data
  455. */
  456. struct cam_req_mgr_custom_msg {
  457. __u32 custom_type;
  458. __u64 request_id;
  459. __u64 frame_id;
  460. __u64 timestamp;
  461. __s32 link_hdl;
  462. __u64 custom_data;
  463. };
  464. /**
  465. * struct cam_req_mgr_message
  466. * @session_hdl: session to which the frame belongs to
  467. * @reserved: reserved field
  468. * @u: union which can either be error/frame/custom message
  469. */
  470. struct cam_req_mgr_message {
  471. __s32 session_hdl;
  472. __s32 reserved;
  473. union {
  474. struct cam_req_mgr_error_msg err_msg;
  475. struct cam_req_mgr_frame_msg frame_msg;
  476. struct cam_req_mgr_custom_msg custom_msg;
  477. } u;
  478. };
  479. #endif /* __UAPI_LINUX_CAM_REQ_MGR_H */