cam_isp.h 49 KB

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