cam_req_mgr.h 17 KB

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