cam_isp.h 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321
  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. * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __UAPI_CAM_ISP_H__
  7. #define __UAPI_CAM_ISP_H__
  8. #include <media/cam_defs.h>
  9. #include <media/cam_isp_vfe.h>
  10. #include <media/cam_isp_ife.h>
  11. #include <media/cam_isp_sfe.h>
  12. #include <media/cam_cpas.h>
  13. /* ISP driver name */
  14. #define CAM_ISP_DEV_NAME "cam-isp"
  15. /* HW type */
  16. #define CAM_ISP_HW_BASE 0
  17. #define CAM_ISP_HW_CSID 1
  18. #define CAM_ISP_HW_VFE 2
  19. #define CAM_ISP_HW_IFE 3
  20. #define CAM_ISP_HW_ISPIF 4
  21. #define CAM_ISP_HW_IFE_LITE 5
  22. #define CAM_ISP_HW_CSID_LITE 6
  23. #define CAM_ISP_HW_SFE 7
  24. #define CAM_ISP_HW_MC_TFE 8
  25. #define CAM_ISP_HW_MAX 9
  26. /* Color Pattern */
  27. #define CAM_ISP_PATTERN_BAYER_RGRGRG 0
  28. #define CAM_ISP_PATTERN_BAYER_GRGRGR 1
  29. #define CAM_ISP_PATTERN_BAYER_BGBGBG 2
  30. #define CAM_ISP_PATTERN_BAYER_GBGBGB 3
  31. #define CAM_ISP_PATTERN_YUV_YCBYCR 4
  32. #define CAM_ISP_PATTERN_YUV_YCRYCB 5
  33. #define CAM_ISP_PATTERN_YUV_CBYCRY 6
  34. #define CAM_ISP_PATTERN_YUV_CRYCBY 7
  35. #define CAM_ISP_PATTERN_MAX 8
  36. /* Usage Type */
  37. #define CAM_ISP_RES_USAGE_SINGLE 0
  38. #define CAM_ISP_RES_USAGE_DUAL 1
  39. #define CAM_ISP_RES_USAGE_MAX 2
  40. /* Resource ID */
  41. #define CAM_ISP_RES_ID_PORT 0
  42. #define CAM_ISP_RES_ID_CLK 1
  43. #define CAM_ISP_RES_ID_MAX 2
  44. /* Resource Type - Type of resource for the resource id
  45. * defined in cam_isp_vfe.h, cam_isp_ife.h
  46. */
  47. /* Lane Type in input resource for Port */
  48. #define CAM_ISP_LANE_TYPE_DPHY 0
  49. #define CAM_ISP_LANE_TYPE_CPHY 1
  50. #define CAM_ISP_LANE_TYPE_MAX 2
  51. /* ISP Resurce Composite Group ID */
  52. #define CAM_ISP_RES_COMP_GROUP_NONE 0
  53. #define CAM_ISP_RES_COMP_GROUP_ID_0 1
  54. #define CAM_ISP_RES_COMP_GROUP_ID_1 2
  55. #define CAM_ISP_RES_COMP_GROUP_ID_2 3
  56. #define CAM_ISP_RES_COMP_GROUP_ID_3 4
  57. #define CAM_ISP_RES_COMP_GROUP_ID_4 5
  58. #define CAM_ISP_RES_COMP_GROUP_ID_5 6
  59. #define CAM_ISP_RES_COMP_GROUP_ID_MAX 6
  60. /* ISP packet opcode for ISP */
  61. #define CAM_ISP_PACKET_OP_BASE 0
  62. #define CAM_ISP_PACKET_INIT_DEV 1
  63. #define CAM_ISP_PACKET_UPDATE_DEV 2
  64. #define CAM_ISP_PACKET_OP_MAX 3
  65. /* ISP packet meta_data type for command buffer */
  66. #define CAM_ISP_PACKET_META_BASE 0
  67. #define CAM_ISP_PACKET_META_LEFT 1
  68. #define CAM_ISP_PACKET_META_RIGHT 2
  69. #define CAM_ISP_PACKET_META_COMMON 3
  70. #define CAM_ISP_PACKET_META_DMI_LEFT 4
  71. #define CAM_ISP_PACKET_META_DMI_RIGHT 5
  72. #define CAM_ISP_PACKET_META_DMI_COMMON 6
  73. #define CAM_ISP_PACKET_META_CLOCK 7
  74. #define CAM_ISP_PACKET_META_CSID 8
  75. #define CAM_ISP_PACKET_META_DUAL_CONFIG 9
  76. #define CAM_ISP_PACKET_META_GENERIC_BLOB_LEFT 10
  77. #define CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT 11
  78. #define CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON 12
  79. #define CAM_ISP_PACKET_META_REG_DUMP_PER_REQUEST 13
  80. #define CAM_ISP_PACKET_META_REG_DUMP_ON_FLUSH 14
  81. #define CAM_ISP_PACKET_META_REG_DUMP_ON_ERROR 15
  82. #define CAM_ISP_PACKET_META_CSID_LEFT 16
  83. #define CAM_ISP_PACKET_META_CSID_RIGHT 17
  84. #define CAM_ISP_PACKET_META_CSID_COMMON 18
  85. /* SFE packet meta_data type for command buffer */
  86. #define CAM_ISP_SFE_PACKET_META_LEFT 0x15
  87. #define CAM_ISP_SFE_PACKET_META_RIGHT 0x16
  88. #define CAM_ISP_SFE_PACKET_META_COMMON 0x17
  89. #define CAM_ISP_SFE_PACKET_META_DUAL_CONFIG 0x18
  90. /* DSP mode */
  91. #define CAM_ISP_DSP_MODE_NONE 0
  92. #define CAM_ISP_DSP_MODE_ONE_WAY 1
  93. #define CAM_ISP_DSP_MODE_ROUND 2
  94. /* ISP Generic Cmd Buffer Blob types */
  95. #define CAM_ISP_GENERIC_BLOB_TYPE_HFR_CONFIG 0
  96. #define CAM_ISP_GENERIC_BLOB_TYPE_CLOCK_CONFIG 1
  97. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG 2
  98. #define CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG 3
  99. #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_CLOCK_CONFIG 4
  100. #define CAM_ISP_GENERIC_BLOB_TYPE_FE_CONFIG 5
  101. #define CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG_V2 6
  102. #define CAM_ISP_GENERIC_BLOB_TYPE_IFE_CORE_CONFIG 7
  103. #define CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG 8
  104. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2 9
  105. #define CAM_ISP_GENERIC_BLOB_TYPE_DISCARD_INITIAL_FRAMES 10
  106. #define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_DIMENSION_CONFIG 11
  107. #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_QCFA_CONFIG 12
  108. #define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG 13
  109. #define CAM_ISP_GENERIC_BLOB_TYPE_TPG_CORE_CONFIG 14
  110. #define CAM_ISP_GENERIC_BLOB_TYPE_DYNAMIC_MODE_SWITCH 15
  111. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_LIMITER_CFG 16
  112. #define CAM_ISP_GENERIC_BLOB_TYPE_FPS_CONFIG 17
  113. #define CAM_ISP_GENERIC_BLOB_TYPE_INIT_CONFIG 18
  114. #define CAM_ISP_GENERIC_BLOB_TYPE_RDI_LCR_CONFIG 19
  115. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_CLOCK_CONFIG 21
  116. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_CORE_CONFIG 22
  117. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_OUT_CONFIG 23
  118. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_HFR_CONFIG 24
  119. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_FE_CONFIG 25
  120. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_SCRATCH_BUF_CFG 26
  121. #define CAM_ISP_GENERIC_BLOB_TYPE_SFE_EXP_ORDER_CFG 27
  122. #define CAM_ISP_GENERIC_BLOB_TYPE_DRV_CONFIG 28
  123. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V3 29
  124. #define CAM_ISP_GENERIC_BLOB_TYPE_NFI_MODE_SWITCH 30
  125. #define CAM_ISP_GENERIC_BLOB_TYPE_IRQ_COMP_CFG 31
  126. #define CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG_V2 32
  127. #define CAM_ISP_VC_DT_CFG 4
  128. #define CAM_ISP_IFE0_HW 0x1
  129. #define CAM_ISP_IFE1_HW 0x2
  130. #define CAM_ISP_IFE0_LITE_HW 0x4
  131. #define CAM_ISP_IFE1_LITE_HW 0x8
  132. #define CAM_ISP_IFE2_LITE_HW 0x10
  133. #define CAM_ISP_IFE3_LITE_HW 0x20
  134. #define CAM_ISP_IFE4_LITE_HW 0x40
  135. #define CAM_ISP_IFE2_HW 0x100
  136. #define CAM_ISP_SFE0_HW 0x1000
  137. #define CAM_ISP_SFE1_HW 0x2000
  138. #define CAM_ISP_SFE2_HW 0x4000
  139. #define CAM_ISP_PXL_PATH 0x1
  140. #define CAM_ISP_PPP_PATH 0x2
  141. #define CAM_ISP_LCR_PATH 0x4
  142. #define CAM_ISP_RDI0_PATH 0x8
  143. #define CAM_ISP_RDI1_PATH 0x10
  144. #define CAM_ISP_RDI2_PATH 0x20
  145. #define CAM_ISP_RDI3_PATH 0x40
  146. #define CAM_ISP_RDI4_PATH 0x80
  147. #define CAM_ISP_PXL1_PATH 0x100
  148. #define CAM_ISP_PXL2_PATH 0x200
  149. /*
  150. * Multi Context Mask
  151. */
  152. #define CAM_ISP_MULTI_CTXT0_MASK 0x1
  153. #define CAM_ISP_MULTI_CTXT1_MASK 0x2
  154. #define CAM_ISP_MULTI_CTXT2_MASK 0x4
  155. /* Per Path Usage Data */
  156. #define CAM_ISP_USAGE_INVALID 0
  157. #define CAM_ISP_USAGE_LEFT_PX 1
  158. #define CAM_ISP_USAGE_RIGHT_PX 2
  159. #define CAM_ISP_USAGE_RDI 3
  160. #define CAM_ISP_USAGE_SFE_LEFT 4
  161. #define CAM_ISP_USAGE_SFE_RIGHT 5
  162. #define CAM_ISP_USAGE_SFE_RDI 6
  163. /* Acquire with custom hw */
  164. #define CAM_ISP_ACQ_CUSTOM_NONE 0
  165. #define CAM_ISP_ACQ_CUSTOM_PRIMARY 1
  166. #define CAM_ISP_ACQ_CUSTOM_SECONDARY 2
  167. #define CAM_IFE_CSID_RDI_MAX 5
  168. /* Feature Flag indicators */
  169. #define CAM_ISP_PARAM_FETCH_SECURITY_MODE BIT(0)
  170. #define CAM_ISP_CAN_USE_LITE_MODE BIT(1)
  171. #define CAM_ISP_DYNAMIC_SENOR_SWITCH_EN BIT(2)
  172. #define CAM_ISP_SFE_BINNED_EPOCH_CFG_ENABLE BIT(3)
  173. #define CAM_ISP_EPD_SUPPORT BIT(4)
  174. #define CAM_ISP_SFE_FS_MODE_EN BIT(5)
  175. #define CAM_ISP_SFE_SHDR_MODE_EN BIT(6)
  176. #define CAM_ISP_AEB_MODE_EN BIT(7)
  177. #define CAM_ISP_HDR_MODE_DYNAMIC_SWITCH_EN BIT(8)
  178. #define CAM_ISP_NFI_BASED_MODE_SWITCH_EN BIT(9)
  179. /* ISP core cfg flag params */
  180. #define CAM_ISP_PARAM_CORE_CFG_HDR_MUX_SEL BIT(0)
  181. #define CAM_ISP_PARAM_CORE_CFG_PP_FORMAT BIT(16)
  182. /**
  183. * Decode format1 Support for multi VCDT use case.
  184. * Format type is packed in 8 bits. BIT(0-7) is
  185. * format and BIT(8-15) is format1 type in the format
  186. * variable
  187. */
  188. #define CAM_IFE_DECODE_FORMAT_MASK 0xFF
  189. #define CAM_IFE_DECODE_FORMAT_SHIFT_VAL 8
  190. /*
  191. * to indicate if packing is to be done at Bus side.
  192. * CSID gives the plain data and packed at bus.
  193. * This mask reserves the param_mask for cam_isp_out_port_info_v3.
  194. *
  195. */
  196. #define CAM_IFE_USE_WM_PACK BIT(0)
  197. /*
  198. * to indicate if RCS to be enabled.
  199. */
  200. #define CAM_IFE_WM_RCS_EN BIT(1)
  201. /**
  202. * struct cam_isp_irq_comp_cfg - CSID composite config for MC-based TFE
  203. * Contains information regarding active contexts in CSID CAMIF
  204. * and active contexts in write engine TFE
  205. *
  206. * @ipp_src_ctxt_mask : Active paths in CSID CAMIF
  207. * @ipp_dst_comp_mask : Active paths in TFE
  208. * @num_valid_params : Number of valid params
  209. * @valid_param_mask : Valid param mask
  210. * @params : params
  211. */
  212. struct cam_isp_irq_comp_cfg {
  213. __u32 ipp_src_ctxt_mask;
  214. __u32 ipp_dst_comp_mask;
  215. __u32 num_valid_params;
  216. __u32 valid_param_mask;
  217. __u32 params[4];
  218. } __attribute__((packed));
  219. /**
  220. * struct cam_isp_drv_config - CSID config for DRV
  221. * Enables DRV and provides worst case timeout value in INIT packet,
  222. * provides path_idle_en and timeout updates (if any) in UPDATE packet
  223. *
  224. * @drv_en : Enables DRV block
  225. * @timeout_val : Timeout value from SOF to trigger vote up,
  226. * given in number of Global Counter cycles.
  227. * @path_idle_en : Mask for paths to be considered for consolidated IDLE signal.
  228. * When paths matching the mask go idle, BW is voted down.
  229. * @num_valid_params : Number of valid params
  230. * @valid_param_mask : Valid param mask
  231. * @params : params
  232. */
  233. struct cam_isp_drv_config {
  234. __u32 drv_en;
  235. __u32 timeout_val;
  236. __u32 path_idle_en;
  237. __u32 num_valid_params;
  238. __u32 valid_param_mask;
  239. __u32 params[5];
  240. } __attribute__((packed));
  241. /* Query devices */
  242. /**
  243. * struct cam_isp_dev_cap_info - A cap info for particular hw type
  244. *
  245. * @hw_type: Hardware type for the cap info
  246. * @num_hw: Number of HW of type @hw_type
  247. * @hw_version: Hardware version
  248. *
  249. */
  250. struct cam_isp_dev_cap_info {
  251. __u32 hw_type;
  252. __u32 num_hw;
  253. struct cam_hw_version hw_version;
  254. };
  255. /**
  256. * struct cam_isp_query_cap_cmd - ISP query device capability payload
  257. *
  258. * @device_iommu: returned iommu handles for device
  259. * @cdm_iommu: returned iommu handles for cdm
  260. * @num_dev: returned number of device capabilities
  261. * @reserved: reserved field for alignment
  262. * @dev_caps: returned device capability array
  263. *
  264. */
  265. struct cam_isp_query_cap_cmd {
  266. struct cam_iommu_handle device_iommu;
  267. struct cam_iommu_handle cdm_iommu;
  268. __s32 num_dev;
  269. __u32 reserved;
  270. struct cam_isp_dev_cap_info dev_caps[CAM_ISP_HW_MAX];
  271. };
  272. /* Acquire Device */
  273. /**
  274. * struct cam_isp_out_port_info - An output port resource info
  275. *
  276. * @res_type: output resource type defined in file
  277. * cam_isp_vfe.h or cam_isp_ife.h
  278. * @format: output format of the resource
  279. * @wdith: output width in pixels
  280. * @height: output height in lines
  281. * @comp_grp_id: composite group id for the resource.
  282. * @split_point: split point in pixels for the dual VFE.
  283. * @secure_mode: flag to tell if output should be run in secure
  284. * mode or not. See cam_defs.h for definition
  285. * @reserved: reserved field for alignment
  286. *
  287. */
  288. struct cam_isp_out_port_info {
  289. __u32 res_type;
  290. __u32 format;
  291. __u32 width;
  292. __u32 height;
  293. __u32 comp_grp_id;
  294. __u32 split_point;
  295. __u32 secure_mode;
  296. __u32 reserved;
  297. };
  298. /**
  299. * struct cam_isp_out_port_info_v2 - An output port resource info
  300. *
  301. * @res_type: output resource type defined in file
  302. * cam_isp_vfe.h or cam_isp_ife.h
  303. * @format: output format of the resource
  304. * @wdith: output width in pixels
  305. * @height: output height in lines
  306. * @comp_grp_id: composite group id for the resource.
  307. * @split_point: split point in pixels for the dual VFE.
  308. * @secure_mode: flag to tell if output should be run in secure
  309. * mode or not. See cam_defs.h for definition
  310. * @wm_mode: WM mode
  311. * @out_port_res1: Output reserved field
  312. * @out_port_res2: Output reserved field
  313. *
  314. */
  315. struct cam_isp_out_port_info_v2 {
  316. __u32 res_type;
  317. __u32 format;
  318. __u32 width;
  319. __u32 height;
  320. __u32 comp_grp_id;
  321. __u32 split_point;
  322. __u32 secure_mode;
  323. __u32 wm_mode;
  324. __u32 out_port_res1;
  325. __u32 out_port_res2;
  326. };
  327. /**
  328. * struct cam_isp_in_port_info - An input port resource info
  329. *
  330. * @res_type: input resource type define in file
  331. * cam_isp_vfe.h or cam_isp_ife.h
  332. * @lane_type: lane type: c-phy or d-phy.
  333. * @lane_num: active lane number
  334. * @lane_cfg: lane configurations: 4 bits per lane
  335. * @vc: input virtual channel number
  336. * @dt: input data type number
  337. * @format: input format
  338. * @test_pattern: test pattern for the testgen
  339. * @usage_type: whether dual vfe is required
  340. * @left_start: left input start offset in pixels
  341. * @left_stop: left input stop offset in pixels
  342. * @left_width: left input width in pixels
  343. * @right_start: right input start offset in pixels.
  344. * Only for Dual VFE
  345. * @right_stop: right input stop offset in pixels.
  346. * Only for Dual VFE
  347. * @right_width: right input width in pixels.
  348. * Only for dual VFE
  349. * @line_start: top of the line number
  350. * @line_stop: bottome of the line number
  351. * @height: input height in lines
  352. * @pixel_clk; sensor output clock
  353. * @batch_size: batch size for HFR mode
  354. * @dsp_mode: DSP stream mode (Defines as CAM_ISP_DSP_MODE_*)
  355. * @hbi_cnt: HBI count for the camif input
  356. * @reserved: Reserved field for alignment
  357. * @num_out_res: number of the output resource associated
  358. * @data: payload that contains the output resources
  359. *
  360. */
  361. struct cam_isp_in_port_info {
  362. __u32 res_type;
  363. __u32 lane_type;
  364. __u32 lane_num;
  365. __u32 lane_cfg;
  366. __u32 vc;
  367. __u32 dt;
  368. __u32 format;
  369. __u32 test_pattern;
  370. __u32 usage_type;
  371. __u32 left_start;
  372. __u32 left_stop;
  373. __u32 left_width;
  374. __u32 right_start;
  375. __u32 right_stop;
  376. __u32 right_width;
  377. __u32 line_start;
  378. __u32 line_stop;
  379. __u32 height;
  380. __u32 pixel_clk;
  381. __u32 batch_size;
  382. __u32 dsp_mode;
  383. __u32 hbi_cnt;
  384. __u32 reserved;
  385. __u32 num_out_res;
  386. struct cam_isp_out_port_info data[1];
  387. };
  388. /**
  389. * struct cam_isp_in_port_info_v2 - An input port resource info
  390. *
  391. * @res_type: input resource type define in file
  392. * cam_isp_vfe.h or cam_isp_ife.h
  393. * @lane_type: lane type: c-phy or d-phy.
  394. * @lane_num: active lane number
  395. * @lane_cfg: lane configurations: 4 bits per lane
  396. * @vc: input virtual channel number
  397. * @dt: input data type number
  398. * @num_valid_vc_dt: valid vc and dt in array
  399. * @format: input format
  400. * @test_pattern: test pattern for the testgen
  401. * @usage_type: whether dual vfe is required
  402. * @left_start: left input start offset in pixels
  403. * @left_stop: left input stop offset in pixels
  404. * @left_width: left input width in pixels
  405. * @right_start: right input start offset in pixels.
  406. * Only for Dual VFE
  407. * @right_stop: right input stop offset in pixels.
  408. * only for Dual VFE
  409. * @right_width: right input width in pixels.
  410. * only for dual VFE
  411. * @line_start: top of the line number
  412. * @line_stop: bottome of the line number
  413. * @height: input height in lines
  414. * @pixel_clk; sensor output clock
  415. * @batch_size: batch size for HFR mode
  416. * @dsp_mode: DSP stream mode (Defines as CAM_ISP_DSP_MODE_*)
  417. * @hbi_cnt: HBI count for the camif input
  418. * @cust_node: if any custom HW block is present before IFE
  419. * @num_out_res: number of the output resource associated
  420. * @bidirectional_bin: [0 : 15] - Set 1 for Horizontal binning
  421. * [16 : 31] - Set 1 for Vertical binning
  422. * @qcfa_bin: Quadra Binning info
  423. * @sfe_in_path_type: SFE input path type
  424. * 0:15 - refer to cam_isp_sfe.h for SFE paths
  425. * 16:31 - Corresponding IFE i/p path type
  426. * Example:((CAM_ISP_PXL_PATH << 16) |
  427. * CAM_ISP_SFE_INLINE_PIX)
  428. * This will acquire SFE inline IPP and IFE IPP
  429. * PPP is an exception CSID PPP -> IFE PPP
  430. * @feature_flag: See the macros defined under feature flag above
  431. * @ife_res_1: payload for future use.
  432. * @ife_res_2: payload for future use.
  433. * @data: payload that contains the output resources
  434. *
  435. */
  436. struct cam_isp_in_port_info_v2 {
  437. __u32 res_type;
  438. __u32 lane_type;
  439. __u32 lane_num;
  440. __u32 lane_cfg;
  441. __u32 vc[CAM_ISP_VC_DT_CFG];
  442. __u32 dt[CAM_ISP_VC_DT_CFG];
  443. __u32 num_valid_vc_dt;
  444. __u32 format;
  445. __u32 test_pattern;
  446. __u32 usage_type;
  447. __u32 left_start;
  448. __u32 left_stop;
  449. __u32 left_width;
  450. __u32 right_start;
  451. __u32 right_stop;
  452. __u32 right_width;
  453. __u32 line_start;
  454. __u32 line_stop;
  455. __u32 height;
  456. __u32 pixel_clk;
  457. __u32 batch_size;
  458. __u32 dsp_mode;
  459. __u32 hbi_cnt;
  460. __u32 cust_node;
  461. __u32 num_out_res;
  462. __u32 offline_mode;
  463. __u32 bidirectional_bin;
  464. __u32 qcfa_bin;
  465. __u32 sfe_in_path_type;
  466. __u32 feature_flag;
  467. __u32 ife_res_1;
  468. __u32 ife_res_2;
  469. struct cam_isp_out_port_info_v2 data[1];
  470. };
  471. /**
  472. * struct cam_isp_in_port_phy_info - CSID in port PHY info
  473. *
  474. * @res_type: input resource for the stream
  475. * @lane_type: Lane type--> C-Phy/ D-Phy
  476. * @lane_num: Number of lanes
  477. * @lane_cfg: Lane Configuraion
  478. */
  479. struct cam_isp_in_port_phy_info {
  480. __u32 res_type;
  481. __u32 lane_type;
  482. __u32 lane_num;
  483. __u32 lane_cfg;
  484. };
  485. /**
  486. * struct cam_isp_in_port_csid_info - CSID in port info
  487. *
  488. * @vc: Virtual Channel for the incoming stream
  489. * @dt: Data type for the incoming stream
  490. * @num_valid_vc_dt Number of valid vc dt in case of multi vc dt on a single path
  491. * @format: Incoming format for this input
  492. * @width: Width of incoming stream
  493. * @height: Height of incoming stream
  494. * @path_id: CSID IPP Path to be acquired
  495. * @param_mask: Reserved field to add new features
  496. * @params: Reserved fields
  497. */
  498. struct cam_isp_in_port_csid_info {
  499. __u32 vc[CAM_ISP_VC_DT_CFG];
  500. __u32 dt[CAM_ISP_VC_DT_CFG];
  501. __u32 num_valid_vc_dt;
  502. __u32 format;
  503. __u32 width;
  504. __u32 height;
  505. __u32 path_id;
  506. __u32 param_mask;
  507. __u32 params[7];
  508. };
  509. /**
  510. * struct cam_isp_out_port_info_v3 - An output port resource info
  511. *
  512. * @res_type: output resource type defined in file
  513. * cam_isp_vfe.h or cam_isp_ife.h
  514. * @format: output format of the resource
  515. * @width: output width in pixels
  516. * @height: output height in lines
  517. * @comp_grp_id: composite group id for the resource.
  518. * @split_point: split point in pixels for the dual VFE.
  519. * @secure_mode: flag to tell if output should be run in secure
  520. * mode or not. See cam_defs.h for definition
  521. * @wm_mode: WM mode
  522. * @context_id: Context ID in case of multi context
  523. * @param_mask: Reserved field to add new features
  524. * @params: Reserved fields
  525. */
  526. struct cam_isp_out_port_info_v3 {
  527. __u32 res_type;
  528. __u32 format;
  529. __u32 width;
  530. __u32 height;
  531. __u32 comp_grp_id;
  532. __u32 split_point;
  533. __u32 secure_mode;
  534. __u32 wm_mode;
  535. __u32 context_id;
  536. __u32 param_mask;
  537. __u32 params[6];
  538. };
  539. /**
  540. * struct cam_isp_in_port_info_v3 - A resource bundle
  541. *
  542. * @csid_info: resource id for the resource bundle
  543. * @phy_info: length of the while resource blob
  544. * @num_contexts Num of contexts in case of multi context
  545. * @feature_mask: Feature mask to store bit fields for any specific use case
  546. * @data: Pointer to out resource data
  547. */
  548. struct cam_isp_in_port_info_v3 {
  549. struct cam_isp_in_port_csid_info csid_info;
  550. struct cam_isp_in_port_phy_info phy_info;
  551. __u32 num_contexts;
  552. __u32 feature_mask;
  553. __u32 num_out_res;
  554. struct cam_isp_out_port_info_v3 data[1];
  555. };
  556. /**
  557. * struct cam_isp_resource - A resource bundle
  558. *
  559. * @resoruce_id: resource id for the resource bundle
  560. * @length: length of the while resource blob
  561. * @handle_type: type of the resource handle
  562. * @reserved: reserved field for alignment
  563. * @res_hdl: resource handle that points to the
  564. * resource array;
  565. *
  566. */
  567. struct cam_isp_resource {
  568. __u32 resource_id;
  569. __u32 length;
  570. __u32 handle_type;
  571. __u32 reserved;
  572. __u64 res_hdl;
  573. };
  574. /**
  575. * struct cam_isp_port_hfr_config - HFR configuration for this port
  576. *
  577. * @resource_type: Resource type
  578. * @subsample_pattern: Subsample pattern. Used in HFR mode. It
  579. * should be consistent with batchSize and
  580. * CAMIF programming.
  581. * @subsample_period: Subsample period. Used in HFR mode. It
  582. * should be consistent with batchSize and
  583. * CAMIF programming.
  584. * @framedrop_pattern: Framedrop pattern
  585. * @framedrop_period: Framedrop period
  586. * @reserved: Reserved for alignment
  587. */
  588. struct cam_isp_port_hfr_config {
  589. __u32 resource_type;
  590. __u32 subsample_pattern;
  591. __u32 subsample_period;
  592. __u32 framedrop_pattern;
  593. __u32 framedrop_period;
  594. __u32 reserved;
  595. } __attribute__((packed));
  596. /**
  597. * struct cam_isp_resource_hfr_config - Resource HFR configuration
  598. *
  599. * @num_ports: Number of ports
  600. * @reserved: Reserved for alignment
  601. * @port_hfr_config: HFR configuration for each IO port
  602. */
  603. struct cam_isp_resource_hfr_config {
  604. __u32 num_ports;
  605. __u32 reserved;
  606. struct cam_isp_port_hfr_config port_hfr_config[1];
  607. } __attribute__((packed));
  608. /**
  609. * struct cam_isp_dual_split_params - dual isp spilt parameters
  610. *
  611. * @split_point: Split point information x, where (0 < x < width)
  612. * left ISP's input ends at x + righ padding and
  613. * Right ISP's input starts at x - left padding
  614. * @right_padding: Padding added past the split point for left
  615. * ISP's input
  616. * @left_padding: Padding added before split point for right
  617. * ISP's input
  618. * @reserved: Reserved filed for alignment
  619. *
  620. */
  621. struct cam_isp_dual_split_params {
  622. __u32 split_point;
  623. __u32 right_padding;
  624. __u32 left_padding;
  625. __u32 reserved;
  626. };
  627. /**
  628. * struct cam_isp_dual_stripe_config - stripe config per bus client
  629. *
  630. * @offset: Start horizontal offset relative to
  631. * output buffer
  632. * In UBWC mode, this value indicates the H_INIT
  633. * value in pixel
  634. * @width: Width of the stripe in bytes
  635. * @tileconfig Ubwc meta tile config. Contain the partial
  636. * tile info
  637. * @port_id: port id of ISP output
  638. *
  639. */
  640. struct cam_isp_dual_stripe_config {
  641. __u32 offset;
  642. __u32 width;
  643. __u32 tileconfig;
  644. __u32 port_id;
  645. };
  646. /**
  647. * struct cam_isp_dual_config - dual isp configuration
  648. *
  649. * @num_ports Number of isp output ports
  650. * @reserved Reserved field for alignment
  651. * @split_params: Inpput split parameters
  652. * @stripes: Stripe information
  653. *
  654. */
  655. struct cam_isp_dual_config {
  656. __u32 num_ports;
  657. __u32 reserved;
  658. struct cam_isp_dual_split_params split_params;
  659. struct cam_isp_dual_stripe_config stripes[1];
  660. } __attribute__((packed));
  661. /**
  662. * struct cam_isp_clock_config - Clock configuration
  663. *
  664. * @usage_type: Usage type (Single/Dual)
  665. * @num_rdi: Number of RDI votes
  666. * @left_pix_hz: Pixel Clock for Left ISP
  667. * @right_pix_hz: Pixel Clock for Right ISP, valid only if Dual
  668. * @rdi_hz: RDI Clock. ISP clock will be max of RDI and
  669. * PIX clocks. For a particular context which ISP
  670. * HW the RDI is allocated to is not known to UMD.
  671. * Hence pass the clock and let KMD decide.
  672. */
  673. struct cam_isp_clock_config {
  674. __u32 usage_type;
  675. __u32 num_rdi;
  676. __u64 left_pix_hz;
  677. __u64 right_pix_hz;
  678. __u64 rdi_hz[1];
  679. } __attribute__((packed));
  680. /**
  681. * struct cam_isp_csid_clock_config - CSID clock configuration
  682. *
  683. * @csid_clock CSID clock
  684. */
  685. struct cam_isp_csid_clock_config {
  686. __u64 csid_clock;
  687. } __attribute__((packed));
  688. /**
  689. * struct cam_isp_csid_qcfa_config - CSID qcfa binning support configuration
  690. *
  691. * @csid_binning CSID binning
  692. */
  693. struct cam_isp_csid_qcfa_config {
  694. __u32 csid_binning;
  695. } __attribute__((packed));
  696. /**
  697. * struct cam_isp_bw_vote - Bandwidth vote information
  698. *
  699. * @resource_id: Resource ID
  700. * @reserved: Reserved field for alignment
  701. * @cam_bw_bps: Bandwidth vote for CAMNOC
  702. * @ext_bw_bps: Bandwidth vote for path-to-DDR after CAMNOC
  703. */
  704. struct cam_isp_bw_vote {
  705. __u32 resource_id;
  706. __u32 reserved;
  707. __u64 cam_bw_bps;
  708. __u64 ext_bw_bps;
  709. } __attribute__((packed));
  710. /**
  711. * struct cam_isp_bw_config - Bandwidth configuration
  712. *
  713. * @usage_type: Usage type (Single/Dual)
  714. * @num_rdi: Number of RDI votes
  715. * @left_pix_vote: Bandwidth vote for left ISP
  716. * @right_pix_vote: Bandwidth vote for right ISP
  717. * @rdi_vote: RDI bandwidth requirements
  718. */
  719. struct cam_isp_bw_config {
  720. __u32 usage_type;
  721. __u32 num_rdi;
  722. struct cam_isp_bw_vote left_pix_vote;
  723. struct cam_isp_bw_vote right_pix_vote;
  724. struct cam_isp_bw_vote rdi_vote[1];
  725. } __attribute__((packed));
  726. /**
  727. * struct cam_isp_bw_config_v2 - Bandwidth configuration
  728. *
  729. * @usage_type: Usage type (Single/Dual)
  730. * @num_paths: Number of axi data paths
  731. * @axi_path Per path vote info
  732. */
  733. struct cam_isp_bw_config_v2 {
  734. __u32 usage_type;
  735. __u32 num_paths;
  736. struct cam_axi_per_path_bw_vote axi_path[1];
  737. } __attribute__((packed));
  738. /**
  739. * struct cam_isp_bw_config_v3 - Bandwidth configuration
  740. *
  741. * @usage_type: Usage type (Single/Dual)
  742. * @num_paths: Number of axi data paths
  743. * @num_valid_params: Number of valid params
  744. * @valid_param_mask: Valid param mask
  745. * @params: params
  746. * @axi_path: Per path vote info v2
  747. */
  748. struct cam_isp_bw_config_v3 {
  749. __u32 usage_type;
  750. __u32 num_paths;
  751. __u32 num_valid_params;
  752. __u32 valid_param_mask;
  753. __u32 params[4];
  754. struct cam_axi_per_path_bw_vote_v2 axi_path[1];
  755. } __attribute__((packed));
  756. /**
  757. * struct cam_fe_config - Fetch Engine configuration
  758. *
  759. * @version: fetch engine veriosn
  760. * @min_vbi: require min vbi
  761. * @fs_mode: indicates if fs mode enabled
  762. * @fs_line_sync_en: frame level sync or line level
  763. * sync for fetch engine
  764. * @hbi_count: hbi count
  765. * @fs_sync_enable: indicates if fetch engine working
  766. * wokring in sync with write engine
  767. * @go_cmd_sel: softwrae go_cmd or hw go_cmd
  768. * @client_enable: enable read engine
  769. * @source_addr: adrress of buffer to read from
  770. * @width: buffer width
  771. * @height: buffer height
  772. * @stride: buffer stride (here equal to width)
  773. * @format: format of image in buffer
  774. * @unpacker_cfg: unpacker config type
  775. * @latency_buf_size: latency buffer for read engine
  776. */
  777. struct cam_fe_config {
  778. __u64 version;
  779. __u32 min_vbi;
  780. __u32 fs_mode;
  781. __u32 fs_line_sync_en;
  782. __u32 hbi_count;
  783. __u32 fs_sync_enable;
  784. __u32 go_cmd_sel;
  785. __u32 client_enable;
  786. __u32 source_addr;
  787. __u32 width;
  788. __u32 height;
  789. __u32 stride;
  790. __u32 format;
  791. __u32 unpacker_cfg;
  792. __u32 latency_buf_size;
  793. } __attribute__((packed));
  794. /**
  795. * struct cam_isp_sensor_path_dimension
  796. *
  797. * @width expected width
  798. * @height expected height
  799. * @measure_enabled flag to indicate if pixel measurement is to be enabled
  800. */
  801. struct cam_isp_sensor_dimension {
  802. __u32 width;
  803. __u32 height;
  804. __u32 measure_enabled;
  805. } __attribute__((packed));
  806. /**
  807. * struct cam_isp_sensor_blanking_config
  808. *
  809. * @hbi HBI value
  810. * @vbi VBI value
  811. */
  812. struct cam_isp_sensor_blanking_config {
  813. __u32 hbi;
  814. __u32 vbi;
  815. } __attribute__((packed));
  816. /**
  817. * struct cam_isp_sensor_config - Sensor Dimension configuration
  818. *
  819. * @ppp_path: expected ppp path configuration
  820. * @ipp_path: expected ipp path configuration
  821. * @rdi_path: expected rdi path configuration
  822. * @hbi: HBI value
  823. * @vbi: VBI value
  824. */
  825. struct cam_isp_sensor_config {
  826. struct cam_isp_sensor_dimension ppp_path;
  827. struct cam_isp_sensor_dimension ipp_path;
  828. struct cam_isp_sensor_dimension rdi_path[CAM_IFE_CSID_RDI_MAX];
  829. __u32 hbi;
  830. __u32 vbi;
  831. } __attribute__((packed));
  832. /**
  833. * struct cam_isp_core_config - ISP core registers configuration
  834. *
  835. * @version: Version info
  836. * @vid_ds16_r2pd: Enables Y and C merging PD output for video DS16
  837. * @vid_ds4_r2pd: Enables Y and C merging PD output for video DS4
  838. * @disp_ds16_r2pd: Enables Y and C merging PD output for disp DS16
  839. * @disp_ds4_r2pd: Enables Y and C merging PD output for disp DS4
  840. * @dsp_streaming_tap_point: This selects source for DSP streaming interface
  841. * @ihist_src_sel: Selects input for IHIST module
  842. * @hdr_be_src_sel: Selects input for HDR BE module
  843. * @hdr_bhist_src_sel: Selects input for HDR BHIST module
  844. * @input_mux_sel_pdaf: Selects input for PDAF
  845. * @input_mux_sel_pp: Selects input for Pixel Pipe
  846. * @core_cfg_flag: Core config flag to set HDR mux/PP
  847. * input format type
  848. */
  849. struct cam_isp_core_config {
  850. __u32 version;
  851. __u32 vid_ds16_r2pd;
  852. __u32 vid_ds4_r2pd;
  853. __u32 disp_ds16_r2pd;
  854. __u32 disp_ds4_r2pd;
  855. __u32 dsp_streaming_tap_point;
  856. __u32 ihist_src_sel;
  857. __u32 hdr_be_src_sel;
  858. __u32 hdr_bhist_src_sel;
  859. __u32 input_mux_sel_pdaf;
  860. __u32 input_mux_sel_pp;
  861. __u32 core_cfg_flag;
  862. } __attribute__((packed));
  863. /**
  864. * struct cam_isp_sfe_core_config - SFE core registers configuration
  865. *
  866. * @version : Version info
  867. * @mode_sel : Selects core for sHDR/non-sHDR mode
  868. * @ops_mode_cfg : Selects core if is inline/offline mode
  869. * @fs_mode_cfg : Selects output in fast shutter mode
  870. * @sfe_params : SFE params for future use
  871. */
  872. struct cam_isp_sfe_core_config {
  873. __u32 version;
  874. __u32 mode_sel;
  875. __u32 ops_mode_cfg;
  876. __u32 fs_mode_cfg;
  877. __u32 sfe_params[6];
  878. } __attribute__((packed));
  879. /**
  880. * struct cam_isp_sfe_scratch_buf_info - Scratch buf info
  881. *
  882. * @mem_handle : Scratch buffer handle
  883. * @offset : Offset to the buffer
  884. * @width : Width in pixels
  885. * @height : Height in pixels
  886. * @stride : Stride in pixels
  887. * @slice_height : Slice height in lines
  888. * @resource_type : rsrc type
  889. * @scratch_buf_params : for future use
  890. */
  891. struct cam_isp_sfe_scratch_buf_info {
  892. __s32 mem_handle;
  893. __u32 offset;
  894. __u32 width;
  895. __u32 height;
  896. __u32 stride;
  897. __u32 slice_height;
  898. __u32 resource_type;
  899. __u32 scratch_buf_params[5];
  900. };
  901. /**
  902. * struct cam_isp_sfe_init_scratch_buf_config - SFE init buffer cfg
  903. * Provides scratch buffer info for SFE ports
  904. * as part of INIT packet
  905. *
  906. * @num_ports : Number of ports
  907. * @reserved : reserved
  908. * @port_scratch_cfg : scratch buffer info
  909. */
  910. struct cam_isp_sfe_init_scratch_buf_config {
  911. __u32 num_ports;
  912. __u32 reserved;
  913. struct cam_isp_sfe_scratch_buf_info port_scratch_cfg[1];
  914. };
  915. /**
  916. * struct cam_isp_tpg_core_config - TPG core registers configuration
  917. *
  918. * @version : Version info
  919. * @vc_dt_pattern_id : TPG pattern - SparsePD, sHDR etc.
  920. * @qcfa_en : Selects qcfa in color bar
  921. * @pix_pattern : Pix pattern color bar cfg
  922. * @hbi_clk_cnt : Number of HBI # of cycles
  923. * @vbi_clk_cnt : Number of VBI # of cycles
  924. * @throttle_pattern : Defines bubble pattern in throttler
  925. * @tpg_params : TPG params for future use
  926. */
  927. struct cam_isp_tpg_core_config {
  928. __u32 version;
  929. __u32 vc_dt_pattern_id;
  930. __u32 qcfa_en;
  931. __u32 pix_pattern;
  932. __u32 hbi_clk_cnt;
  933. __u32 vbi_clk_cnt;
  934. __u32 throttle_pattern;
  935. __u32 tpg_params[3];
  936. } __attribute__((packed));
  937. /**
  938. * struct cam_isp_acquire_hw_info - ISP acquire HW params
  939. *
  940. * @common_info_version : Version of common info struct used
  941. * @common_info_size : Size of common info struct used
  942. * @common_info_offset : Offset of common info from start of data
  943. * @num_inputs : Number of inputs
  944. * @input_info_version : Version of input info struct used
  945. * @input_info_size : Size of input info struct used
  946. * @input_info_offset : Offset of input info from start of data
  947. * @data : Start of data region
  948. */
  949. struct cam_isp_acquire_hw_info {
  950. __u16 common_info_version;
  951. __u16 common_info_size;
  952. __u32 common_info_offset;
  953. __u32 num_inputs;
  954. __u32 input_info_version;
  955. __u32 input_info_size;
  956. __u32 input_info_offset;
  957. __u64 data;
  958. };
  959. /**
  960. * struct cam_isp_vfe_wm_config - VFE write master config per port
  961. *
  962. * @port_type : Unique ID of output port
  963. * @wm_mode : Write master mode
  964. * 0x0 - Line based mode
  965. * 0x1 - Frame based mode
  966. * 0x2 - Index based mode, valid for BAF only
  967. * @h_init : Horizontal starting coordinate in pixels. Must be a
  968. * multiple of 3 for TP10 format
  969. * @height : Height in pixels
  970. * @width : Width in pixels
  971. * @virtual_frame_en : Enabling virtual frame will prevent actual request from
  972. * being sent to NOC
  973. * @stride : Write master stride
  974. * @offset : Write master offset
  975. * @addr_reuse_en : Enabling addr-reuse will write output to the same addr
  976. * after the last addr that was read from FIFO.
  977. * @packer_format : Update packer format for Write master config
  978. * @reserved_3 : Reserved field for Write master config
  979. * For acquired version 3-->corresponds to context_id_mask
  980. * @reserved_4 : Reserved field for Write master config
  981. */
  982. struct cam_isp_vfe_wm_config {
  983. __u32 port_type;
  984. __u32 wm_mode;
  985. __u32 h_init;
  986. __u32 height;
  987. __u32 width;
  988. __u32 virtual_frame_en;
  989. __u32 stride;
  990. __u32 offset;
  991. __u32 addr_reuse_en;
  992. __u32 packer_format;
  993. __u32 reserved_3;
  994. __u32 reserved_4;
  995. };
  996. /**
  997. * struct cam_isp_vfe_wm_config_v2 - VFE write master config per port
  998. *
  999. * @version : Version for this structure
  1000. * @port_type : Unique ID of output port
  1001. * @wm_mode : Write master mode
  1002. * 0x0 - Line based mode
  1003. * 0x1 - Frame based mode
  1004. * 0x2 - Index based mode, valid for BAF only
  1005. * @h_init : Horizontal starting coordinate in pixels. Must be a
  1006. * multiple of 3 for TP10 format
  1007. * @height : Height in pixels
  1008. * @width : Width in pixels
  1009. * @virtual_frame_en : Enabling virtual frame will prevent actual request from
  1010. * being sent to NOC
  1011. * @stride : Write master stride
  1012. * @offset : Write master offset
  1013. * @addr_reuse_en : Enabling addr-reuse will write output to the same addr
  1014. * after the last addr that was read from FIFO.
  1015. * @packer_format : Update packer format for Write master config
  1016. * @offset_in_bytes : Offest in bytes
  1017. * @context_id_mask : context id mask in case of multi context
  1018. * @use_pack : Hint to use WM pack in case of per frame changes
  1019. * @enable : Enable/Disable WM at run time
  1020. * @params : Indicate params supported, to accommodate future changes
  1021. * @param_mask : Indicate params supported, to accommodate future changes
  1022. */
  1023. struct cam_isp_vfe_wm_config_v2 {
  1024. __u32 version;
  1025. __u32 port_type;
  1026. __u32 wm_mode;
  1027. __u32 h_init;
  1028. __u32 height;
  1029. __u32 width;
  1030. __u32 virtual_frame_en;
  1031. __u32 stride;
  1032. __u32 offset;
  1033. __u32 addr_reuse_en;
  1034. __u32 packer_format;
  1035. __u32 offset_in_bytes;
  1036. __u32 context_id_mask;
  1037. __u32 use_pack;
  1038. __u32 enable;
  1039. __u32 param_mask;
  1040. __u32 params[5];
  1041. };
  1042. /**
  1043. * struct cam_isp_vfe_out_config_v2 - VFE write master config
  1044. *
  1045. * @version : Version for this structure
  1046. * @num_ports : Number of ports
  1047. * @reserved : Reserved field
  1048. * @wm_config : VFE out config
  1049. * @params : Indicate params supported, to accommodate future changes
  1050. * @param_mask : Indicate params supported, to accommodate future changes
  1051. */
  1052. struct cam_isp_vfe_out_config_v2 {
  1053. __u32 version;
  1054. __u32 num_ports;
  1055. __u32 reserved;
  1056. struct cam_isp_vfe_wm_config_v2 wm_config[1];
  1057. __u32 param_mask;
  1058. __u32 params[5];
  1059. };
  1060. /**
  1061. * struct cam_isp_vfe_out_config - VFE write master config
  1062. *
  1063. * @num_ports : Number of ports
  1064. * @reserved : Reserved field
  1065. * @wm_config : VFE out config
  1066. */
  1067. struct cam_isp_vfe_out_config {
  1068. __u32 num_ports;
  1069. __u32 reserved;
  1070. struct cam_isp_vfe_wm_config wm_config[1];
  1071. };
  1072. /**
  1073. * struct cam_isp_mode_switch_info - Dynamic mode switch info
  1074. *
  1075. * @mup : MUP for incoming VC of next frame
  1076. * @num_expoures : Number of exposures
  1077. * @reserved : Reserved
  1078. */
  1079. struct cam_isp_mode_switch_info{
  1080. __u32 mup;
  1081. __u32 num_expoures;
  1082. __u32 reserved;
  1083. } __attribute__((packed));
  1084. /**
  1085. * struct cam_isp_nfi_mode_switch_info - New Frame ID (NFI) Based Switching Scheme info
  1086. *
  1087. * @version : Version info
  1088. * @mode_id : Mode ID value for the next frame
  1089. * @modeid_vc : The VC with which the embedded packet with MODE ID comes with.
  1090. * @x_offset : X offset of MODE ID location in horizontal
  1091. * direction within single EBD line packet, unit is byte.
  1092. * @y_offset : Y offset of MODE ID location in vertical direction
  1093. * within EBD Lines, unit is line packet.
  1094. * @reg_length : Number of bytes for each MODE ID
  1095. * @num_valid_params : Number of valid params
  1096. * @param_mask : Mask to indicate fields in params
  1097. * @params : Additional Params
  1098. */
  1099. struct cam_isp_nfi_mode_switch_info {
  1100. __u32 version;
  1101. __u32 mode_id;
  1102. __u32 modeid_vc;
  1103. __u32 x_offset;
  1104. __u32 y_offset;
  1105. __u32 reg_length;
  1106. __u32 num_valid_params;
  1107. __u32 param_mask;
  1108. __u32 params[4];
  1109. } __attribute__((packed));
  1110. /**
  1111. * struct cam_isp_sfe_wm_exp_order_config - SFE write master
  1112. * exposure order config
  1113. *
  1114. * This config will reflect for corresponding RM as well
  1115. *
  1116. * @res_type : output resource type defined in file
  1117. * cam_isp_sfe.h or cam_isp_ife.h
  1118. * @additional_params : Params for future use
  1119. */
  1120. struct cam_isp_sfe_wm_exp_order_config {
  1121. __u32 res_type;
  1122. __u32 additional_params[5];
  1123. };
  1124. /**
  1125. * struct cam_isp_sfe_exp_config - SFE out exposure config
  1126. *
  1127. * Exp order is determined by it's index in wm_config[]
  1128. * The last resource in the array will be considered as
  1129. * last [shortest] exposure.
  1130. *
  1131. * @num_ports : Number of ports
  1132. * @reserved : Reserved field
  1133. * @wm_config : WM exp config
  1134. */
  1135. struct cam_isp_sfe_exp_config {
  1136. __u32 num_ports;
  1137. __u32 reserved;
  1138. struct cam_isp_sfe_wm_exp_order_config wm_config[1];
  1139. };
  1140. /**
  1141. * struct cam_isp_discard_initial_frames - Discard init frames
  1142. *
  1143. * Some sensors require discarding the initial frames
  1144. * after the sensor is streamed on. The discard would be
  1145. * applied on all paths [IPP/PPP/RDIx] for the given
  1146. * pipeline.
  1147. *
  1148. * @num_frames : Number of frames to be discarded
  1149. * @discard_params : Params for future use
  1150. */
  1151. struct cam_isp_discard_initial_frames {
  1152. __u32 num_frames;
  1153. __u32 discard_params[5];
  1154. } __attribute__((packed));
  1155. /**
  1156. * struct cam_isp_wm_bw_limiter_config - ISP write master
  1157. * BW limter config
  1158. *
  1159. *
  1160. * @res_type : output resource type defined in file
  1161. * cam_isp_sfe.h or cam_isp_ife.h
  1162. * @enable_limiter : 0 for disable else enabled
  1163. * @counter_limit : Max counter value
  1164. * @additional_params : Params for future use
  1165. */
  1166. struct cam_isp_wm_bw_limiter_config {
  1167. __u32 res_type;
  1168. __u32 enable_limiter;
  1169. __u32 counter_limit[CAM_PACKET_MAX_PLANES];
  1170. __u32 additional_params[5];
  1171. };
  1172. /**
  1173. * struct cam_isp_out_rsrc_bw_limiter_config - ISP out rsrc BW limiter config
  1174. *
  1175. * Configure BW limiter for ISP WMs
  1176. *
  1177. * @num_ports : Number of ports
  1178. * @reserved : Reserved field
  1179. * @bw_limit_config : WM BW limiter config
  1180. */
  1181. struct cam_isp_out_rsrc_bw_limiter_config {
  1182. __u32 num_ports;
  1183. __u32 reserved;
  1184. struct cam_isp_wm_bw_limiter_config bw_limiter_config[1];
  1185. };
  1186. /**
  1187. * struct cam_isp_init_config - Init config for IFE/CSID/SFE
  1188. *
  1189. * Any configurations to be consumed by KMD
  1190. * prior to stream on - one time configuration per stream.
  1191. * This blob is expected only in INIT packet. Per frame
  1192. * dynamic settings will not be part of this blob.
  1193. *
  1194. * @epoch_factor : % factor for epoch config with respect to frame height
  1195. * If factor is 60, epoch will be configured to 3/5th of
  1196. * the frame height. If this field is 0,
  1197. * KMD will configure default 50% of the height
  1198. * @additional_params : Reserved fields for future use
  1199. */
  1200. struct cam_isp_init_config {
  1201. struct cam_isp_epoch_height_config {
  1202. __u32 epoch_factor;
  1203. } epoch_cfg;
  1204. __u32 additional_params[19];
  1205. };
  1206. /**
  1207. * struct cam_isp_lcr_rdi_config - RDI res id to be muxed to LCR
  1208. *
  1209. * Configure RDI Res id for LCR
  1210. *
  1211. * @res_id : Out port Res id, it is same as the out port
  1212. * configured during acquire. It would vary
  1213. * as per SFE or IFE. Based on this res id,
  1214. * Mux register in IFE will be programmed.
  1215. * Examples:
  1216. * IFE:
  1217. * CAM_ISP_IFE_OUT_RES_RDI_0
  1218. * SFE:
  1219. * CAM_ISP_SFE_OUT_RES_RDI_0
  1220. * This blob is expected as a part of init packet for
  1221. * all LCR cases. For SHDR-LCR cases, this can be used
  1222. * per request. For non-shdr cases, this blob is not
  1223. * expected as the input to LCR will remain same throughout
  1224. * the session
  1225. * @reserved : Reserved field
  1226. */
  1227. struct cam_isp_lcr_rdi_config {
  1228. __u32 res_id;
  1229. __u32 reserved[5];
  1230. };
  1231. #define CAM_ISP_ACQUIRE_COMMON_VER0 0x1000
  1232. #define CAM_ISP_ACQUIRE_COMMON_SIZE_VER0 0x0
  1233. #define CAM_ISP_ACQUIRE_INPUT_VER0 0x2000
  1234. #define CAM_ISP_ACQUIRE_INPUT_SIZE_VER0 sizeof(struct cam_isp_in_port_info)
  1235. #define CAM_ISP_ACQUIRE_OUT_VER0 0x3000
  1236. #define CAM_ISP_ACQUIRE_OUT_SIZE_VER0 sizeof(struct cam_isp_out_port_info)
  1237. #endif /* __UAPI_CAM_ISP_H__ */