cam_isp.h 46 KB

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