cam_req_mgr.h 17 KB

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