cam_isp.h 49 KB

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