cam_isp.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __UAPI_CAM_ISP_H__
  6. #define __UAPI_CAM_ISP_H__
  7. #include <camera/media/cam_defs.h>
  8. #include <camera/media/cam_isp_vfe.h>
  9. #include <camera/media/cam_isp_ife.h>
  10. #include <camera/media/cam_cpas.h>
  11. /* ISP driver name */
  12. #define CAM_ISP_DEV_NAME "cam-isp"
  13. /* HW type */
  14. #define CAM_ISP_HW_BASE 0
  15. #define CAM_ISP_HW_CSID 1
  16. #define CAM_ISP_HW_VFE 2
  17. #define CAM_ISP_HW_IFE 3
  18. #define CAM_ISP_HW_ISPIF 4
  19. #define CAM_ISP_HW_IFE_LITE 5
  20. #define CAM_ISP_HW_CSID_LITE 6
  21. #define CAM_ISP_HW_MAX 7
  22. /* Color Pattern */
  23. #define CAM_ISP_PATTERN_BAYER_RGRGRG 0
  24. #define CAM_ISP_PATTERN_BAYER_GRGRGR 1
  25. #define CAM_ISP_PATTERN_BAYER_BGBGBG 2
  26. #define CAM_ISP_PATTERN_BAYER_GBGBGB 3
  27. #define CAM_ISP_PATTERN_YUV_YCBYCR 4
  28. #define CAM_ISP_PATTERN_YUV_YCRYCB 5
  29. #define CAM_ISP_PATTERN_YUV_CBYCRY 6
  30. #define CAM_ISP_PATTERN_YUV_CRYCBY 7
  31. #define CAM_ISP_PATTERN_MAX 8
  32. /* Usage Type */
  33. #define CAM_ISP_RES_USAGE_SINGLE 0
  34. #define CAM_ISP_RES_USAGE_DUAL 1
  35. #define CAM_ISP_RES_USAGE_MAX 2
  36. /* Resource ID */
  37. #define CAM_ISP_RES_ID_PORT 0
  38. #define CAM_ISP_RES_ID_CLK 1
  39. #define CAM_ISP_RES_ID_MAX 2
  40. /* Resource Type - Type of resource for the resource id
  41. * defined in cam_isp_vfe.h, cam_isp_ife.h
  42. */
  43. /* Lane Type in input resource for Port */
  44. #define CAM_ISP_LANE_TYPE_DPHY 0
  45. #define CAM_ISP_LANE_TYPE_CPHY 1
  46. #define CAM_ISP_LANE_TYPE_MAX 2
  47. /* ISP Resurce Composite Group ID */
  48. #define CAM_ISP_RES_COMP_GROUP_NONE 0
  49. #define CAM_ISP_RES_COMP_GROUP_ID_0 1
  50. #define CAM_ISP_RES_COMP_GROUP_ID_1 2
  51. #define CAM_ISP_RES_COMP_GROUP_ID_2 3
  52. #define CAM_ISP_RES_COMP_GROUP_ID_3 4
  53. #define CAM_ISP_RES_COMP_GROUP_ID_4 5
  54. #define CAM_ISP_RES_COMP_GROUP_ID_5 6
  55. #define CAM_ISP_RES_COMP_GROUP_ID_MAX 6
  56. /* ISP packet opcode for ISP */
  57. #define CAM_ISP_PACKET_OP_BASE 0
  58. #define CAM_ISP_PACKET_INIT_DEV 1
  59. #define CAM_ISP_PACKET_UPDATE_DEV 2
  60. #define CAM_ISP_PACKET_OP_MAX 3
  61. /* ISP packet meta_data type for command buffer */
  62. #define CAM_ISP_PACKET_META_BASE 0
  63. #define CAM_ISP_PACKET_META_LEFT 1
  64. #define CAM_ISP_PACKET_META_RIGHT 2
  65. #define CAM_ISP_PACKET_META_COMMON 3
  66. #define CAM_ISP_PACKET_META_DMI_LEFT 4
  67. #define CAM_ISP_PACKET_META_DMI_RIGHT 5
  68. #define CAM_ISP_PACKET_META_DMI_COMMON 6
  69. #define CAM_ISP_PACKET_META_CLOCK 7
  70. #define CAM_ISP_PACKET_META_CSID 8
  71. #define CAM_ISP_PACKET_META_DUAL_CONFIG 9
  72. #define CAM_ISP_PACKET_META_GENERIC_BLOB_LEFT 10
  73. #define CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT 11
  74. #define CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON 12
  75. #define CAM_ISP_PACKET_META_REG_DUMP_PER_REQUEST 13
  76. #define CAM_ISP_PACKET_META_REG_DUMP_ON_FLUSH 14
  77. #define CAM_ISP_PACKET_META_REG_DUMP_ON_ERROR 15
  78. /* DSP mode */
  79. #define CAM_ISP_DSP_MODE_NONE 0
  80. #define CAM_ISP_DSP_MODE_ONE_WAY 1
  81. #define CAM_ISP_DSP_MODE_ROUND 2
  82. /* ISP Generic Cmd Buffer Blob types */
  83. #define CAM_ISP_GENERIC_BLOB_TYPE_HFR_CONFIG 0
  84. #define CAM_ISP_GENERIC_BLOB_TYPE_CLOCK_CONFIG 1
  85. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG 2
  86. #define CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG 3
  87. #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_CLOCK_CONFIG 4
  88. #define CAM_ISP_GENERIC_BLOB_TYPE_FE_CONFIG 5
  89. #define CAM_ISP_GENERIC_BLOB_TYPE_UBWC_CONFIG_V2 6
  90. #define CAM_ISP_GENERIC_BLOB_TYPE_IFE_CORE_CONFIG 7
  91. #define CAM_ISP_GENERIC_BLOB_TYPE_VFE_OUT_CONFIG 8
  92. #define CAM_ISP_GENERIC_BLOB_TYPE_BW_CONFIG_V2 9
  93. #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_CONFIG 10
  94. #define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_DIMENSION_CONFIG 11
  95. #define CAM_ISP_GENERIC_BLOB_TYPE_CSID_QCFA_CONFIG 12
  96. #define CAM_ISP_GENERIC_BLOB_TYPE_SENSOR_BLANKING_CONFIG 13
  97. #define CAM_ISP_VC_DT_CFG 4
  98. #define CAM_ISP_IFE0_HW 0x1
  99. #define CAM_ISP_IFE1_HW 0x2
  100. #define CAM_ISP_IFE0_LITE_HW 0x4
  101. #define CAM_ISP_IFE1_LITE_HW 0x8
  102. #define CAM_ISP_IFE2_LITE_HW 0x10
  103. #define CAM_ISP_IFE3_LITE_HW 0x20
  104. #define CAM_ISP_IFE4_LITE_HW 0x40
  105. #define CAM_ISP_IFE2_HW 0x100
  106. #define CAM_ISP_PXL_PATH 0x1
  107. #define CAM_ISP_PPP_PATH 0x2
  108. #define CAM_ISP_LCR_PATH 0x4
  109. #define CAM_ISP_RDI0_PATH 0x8
  110. #define CAM_ISP_RDI1_PATH 0x10
  111. #define CAM_ISP_RDI2_PATH 0x20
  112. #define CAM_ISP_RDI3_PATH 0x40
  113. /* Per Path Usage Data */
  114. #define CAM_ISP_USAGE_INVALID 0
  115. #define CAM_ISP_USAGE_LEFT_PX 1
  116. #define CAM_ISP_USAGE_RIGHT_PX 2
  117. #define CAM_ISP_USAGE_RDI 3
  118. /* Acquire with custom hw */
  119. #define CAM_ISP_ACQ_CUSTOM_NONE 0
  120. #define CAM_ISP_ACQ_CUSTOM_PRIMARY 1
  121. #define CAM_ISP_ACQ_CUSTOM_SECONDARY 2
  122. #define CAM_IFE_CSID_RDI_MAX 4
  123. /* Query devices */
  124. /**
  125. * struct cam_isp_dev_cap_info - A cap info for particular hw type
  126. *
  127. * @hw_type: Hardware type for the cap info
  128. * @num_hw: Number of HW of type @hw_type
  129. * @hw_version: Hardware version
  130. *
  131. */
  132. struct cam_isp_dev_cap_info {
  133. __u32 hw_type;
  134. __u32 num_hw;
  135. struct cam_hw_version hw_version;
  136. };
  137. /**
  138. * struct cam_isp_query_cap_cmd - ISP query device capability payload
  139. *
  140. * @device_iommu: returned iommu handles for device
  141. * @cdm_iommu: returned iommu handles for cdm
  142. * @num_dev: returned number of device capabilities
  143. * @reserved: reserved field for alignment
  144. * @dev_caps: returned device capability array
  145. *
  146. */
  147. struct cam_isp_query_cap_cmd {
  148. struct cam_iommu_handle device_iommu;
  149. struct cam_iommu_handle cdm_iommu;
  150. __s32 num_dev;
  151. __u32 reserved;
  152. struct cam_isp_dev_cap_info dev_caps[CAM_ISP_HW_MAX];
  153. };
  154. /* Acquire Device */
  155. /**
  156. * struct cam_isp_out_port_info - An output port resource info
  157. *
  158. * @res_type: output resource type defined in file
  159. * cam_isp_vfe.h or cam_isp_ife.h
  160. * @format: output format of the resource
  161. * @wdith: output width in pixels
  162. * @height: output height in lines
  163. * @comp_grp_id: composite group id for the resource.
  164. * @split_point: split point in pixels for the dual VFE.
  165. * @secure_mode: flag to tell if output should be run in secure
  166. * mode or not. See cam_defs.h for definition
  167. * @reserved: reserved field for alignment
  168. *
  169. */
  170. struct cam_isp_out_port_info {
  171. __u32 res_type;
  172. __u32 format;
  173. __u32 width;
  174. __u32 height;
  175. __u32 comp_grp_id;
  176. __u32 split_point;
  177. __u32 secure_mode;
  178. __u32 reserved;
  179. };
  180. /**
  181. * struct cam_isp_out_port_info_v2 - An output port resource info
  182. *
  183. * @res_type: output resource type defined in file
  184. * cam_isp_vfe.h or cam_isp_ife.h
  185. * @format: output format of the resource
  186. * @wdith: output width in pixels
  187. * @height: output height in lines
  188. * @comp_grp_id: composite group id for the resource.
  189. * @split_point: split point in pixels for the dual VFE.
  190. * @secure_mode: flag to tell if output should be run in secure
  191. * mode or not. See cam_defs.h for definition
  192. * @wm_mode: WM mode
  193. * @out_port_res1: Output reserved field
  194. * @out_port_res2: Output reserved field
  195. *
  196. */
  197. struct cam_isp_out_port_info_v2 {
  198. __u32 res_type;
  199. __u32 format;
  200. __u32 width;
  201. __u32 height;
  202. __u32 comp_grp_id;
  203. __u32 split_point;
  204. __u32 secure_mode;
  205. __u32 wm_mode;
  206. __u32 out_port_res1;
  207. __u32 out_port_res2;
  208. };
  209. /**
  210. * struct cam_isp_in_port_info - An input port resource info
  211. *
  212. * @res_type: input resource type define in file
  213. * cam_isp_vfe.h or cam_isp_ife.h
  214. * @lane_type: lane type: c-phy or d-phy.
  215. * @lane_num: active lane number
  216. * @lane_cfg: lane configurations: 4 bits per lane
  217. * @vc: input virtual channel number
  218. * @dt: input data type number
  219. * @format: input format
  220. * @test_pattern: test pattern for the testgen
  221. * @usage_type: whether dual vfe is required
  222. * @left_start: left input start offset in pixels
  223. * @left_stop: left input stop offset in pixels
  224. * @left_width: left input width in pixels
  225. * @right_start: right input start offset in pixels.
  226. * Only for Dual VFE
  227. * @right_stop: right input stop offset in pixels.
  228. * Only for Dual VFE
  229. * @right_width: right input width in pixels.
  230. * Only for dual VFE
  231. * @line_start: top of the line number
  232. * @line_stop: bottome of the line number
  233. * @height: input height in lines
  234. * @pixel_clk; sensor output clock
  235. * @batch_size: batch size for HFR mode
  236. * @dsp_mode: DSP stream mode (Defines as CAM_ISP_DSP_MODE_*)
  237. * @hbi_cnt: HBI count for the camif input
  238. * @reserved: Reserved field for alignment
  239. * @num_out_res: number of the output resource associated
  240. * @data: payload that contains the output resources
  241. *
  242. */
  243. struct cam_isp_in_port_info {
  244. __u32 res_type;
  245. __u32 lane_type;
  246. __u32 lane_num;
  247. __u32 lane_cfg;
  248. __u32 vc;
  249. __u32 dt;
  250. __u32 format;
  251. __u32 test_pattern;
  252. __u32 usage_type;
  253. __u32 left_start;
  254. __u32 left_stop;
  255. __u32 left_width;
  256. __u32 right_start;
  257. __u32 right_stop;
  258. __u32 right_width;
  259. __u32 line_start;
  260. __u32 line_stop;
  261. __u32 height;
  262. __u32 pixel_clk;
  263. __u32 batch_size;
  264. __u32 dsp_mode;
  265. __u32 hbi_cnt;
  266. __u32 reserved;
  267. __u32 num_out_res;
  268. struct cam_isp_out_port_info data[1];
  269. };
  270. /**
  271. * struct cam_isp_in_port_info_v2 - An input port resource info
  272. *
  273. * @res_type: input resource type define in file
  274. * cam_isp_vfe.h or cam_isp_ife.h
  275. * @lane_type: lane type: c-phy or d-phy.
  276. * @lane_num: active lane number
  277. * @lane_cfg: lane configurations: 4 bits per lane
  278. * @vc: input virtual channel number
  279. * @dt: input data type number
  280. * @num_valid_vc_dt: valid vc and dt in array
  281. * @format: input format
  282. * @test_pattern: test pattern for the testgen
  283. * @usage_type: whether dual vfe is required
  284. * @left_start: left input start offset in pixels
  285. * @left_stop: left input stop offset in pixels
  286. * @left_width: left input width in pixels
  287. * @right_start: right input start offset in pixels.
  288. * Only for Dual VFE
  289. * @right_stop: right input stop offset in pixels.
  290. * only for Dual VFE
  291. * @right_width: right input width in pixels.
  292. * only for dual VFE
  293. * @line_start: top of the line number
  294. * @line_stop: bottome of the line number
  295. * @height: input height in lines
  296. * @pixel_clk; sensor output clock
  297. * @batch_size: batch size for HFR mode
  298. * @dsp_mode: DSP stream mode (Defines as CAM_ISP_DSP_MODE_*)
  299. * @hbi_cnt: HBI count for the camif input
  300. * @cust_node: if any custom HW block is present before IFE
  301. * @num_out_res: number of the output resource associated
  302. * @horizontal_bin: Horizontal Binning info
  303. * @qcfa_bin: Quadra Binning info
  304. * @csid_res_1: payload for future use
  305. * @csid_res_2: payload for future use
  306. * @ife_res_1: payload for future use
  307. * @ife_res_2: payload for future use
  308. * @data: payload that contains the output resources
  309. *
  310. */
  311. struct cam_isp_in_port_info_v2 {
  312. __u32 res_type;
  313. __u32 lane_type;
  314. __u32 lane_num;
  315. __u32 lane_cfg;
  316. __u32 vc[CAM_ISP_VC_DT_CFG];
  317. __u32 dt[CAM_ISP_VC_DT_CFG];
  318. __u32 num_valid_vc_dt;
  319. __u32 format;
  320. __u32 test_pattern;
  321. __u32 usage_type;
  322. __u32 left_start;
  323. __u32 left_stop;
  324. __u32 left_width;
  325. __u32 right_start;
  326. __u32 right_stop;
  327. __u32 right_width;
  328. __u32 line_start;
  329. __u32 line_stop;
  330. __u32 height;
  331. __u32 pixel_clk;
  332. __u32 batch_size;
  333. __u32 dsp_mode;
  334. __u32 hbi_cnt;
  335. __u32 cust_node;
  336. __u32 num_out_res;
  337. __u32 offline_mode;
  338. __u32 horizontal_bin;
  339. __u32 qcfa_bin;
  340. __u32 csid_res_1;
  341. __u32 csid_res_2;
  342. __u32 ife_res_1;
  343. __u32 ife_res_2;
  344. struct cam_isp_out_port_info_v2 data[1];
  345. };
  346. /**
  347. * struct cam_isp_resource - A resource bundle
  348. *
  349. * @resoruce_id: resource id for the resource bundle
  350. * @length: length of the while resource blob
  351. * @handle_type: type of the resource handle
  352. * @reserved: reserved field for alignment
  353. * @res_hdl: resource handle that points to the
  354. * resource array;
  355. *
  356. */
  357. struct cam_isp_resource {
  358. __u32 resource_id;
  359. __u32 length;
  360. __u32 handle_type;
  361. __u32 reserved;
  362. __u64 res_hdl;
  363. };
  364. /**
  365. * struct cam_isp_port_hfr_config - HFR configuration for this port
  366. *
  367. * @resource_type: Resource type
  368. * @subsample_pattern: Subsample pattern. Used in HFR mode. It
  369. * should be consistent with batchSize and
  370. * CAMIF programming.
  371. * @subsample_period: Subsample period. Used in HFR mode. It
  372. * should be consistent with batchSize and
  373. * CAMIF programming.
  374. * @framedrop_pattern: Framedrop pattern
  375. * @framedrop_period: Framedrop period
  376. * @reserved: Reserved for alignment
  377. */
  378. struct cam_isp_port_hfr_config {
  379. __u32 resource_type;
  380. __u32 subsample_pattern;
  381. __u32 subsample_period;
  382. __u32 framedrop_pattern;
  383. __u32 framedrop_period;
  384. __u32 reserved;
  385. } __attribute__((packed));
  386. /**
  387. * struct cam_isp_resource_hfr_config - Resource HFR configuration
  388. *
  389. * @num_ports: Number of ports
  390. * @reserved: Reserved for alignment
  391. * @port_hfr_config: HFR configuration for each IO port
  392. */
  393. struct cam_isp_resource_hfr_config {
  394. __u32 num_ports;
  395. __u32 reserved;
  396. struct cam_isp_port_hfr_config port_hfr_config[1];
  397. } __attribute__((packed));
  398. /**
  399. * struct cam_isp_dual_split_params - dual isp spilt parameters
  400. *
  401. * @split_point: Split point information x, where (0 < x < width)
  402. * left ISP's input ends at x + righ padding and
  403. * Right ISP's input starts at x - left padding
  404. * @right_padding: Padding added past the split point for left
  405. * ISP's input
  406. * @left_padding: Padding added before split point for right
  407. * ISP's input
  408. * @reserved: Reserved filed for alignment
  409. *
  410. */
  411. struct cam_isp_dual_split_params {
  412. __u32 split_point;
  413. __u32 right_padding;
  414. __u32 left_padding;
  415. __u32 reserved;
  416. };
  417. /**
  418. * struct cam_isp_dual_stripe_config - stripe config per bus client
  419. *
  420. * @offset: Start horizontal offset relative to
  421. * output buffer
  422. * In UBWC mode, this value indicates the H_INIT
  423. * value in pixel
  424. * @width: Width of the stripe in bytes
  425. * @tileconfig Ubwc meta tile config. Contain the partial
  426. * tile info
  427. * @port_id: port id of ISP output
  428. *
  429. */
  430. struct cam_isp_dual_stripe_config {
  431. __u32 offset;
  432. __u32 width;
  433. __u32 tileconfig;
  434. __u32 port_id;
  435. };
  436. /**
  437. * struct cam_isp_dual_config - dual isp configuration
  438. *
  439. * @num_ports Number of isp output ports
  440. * @reserved Reserved field for alignment
  441. * @split_params: Inpput split parameters
  442. * @stripes: Stripe information
  443. *
  444. */
  445. struct cam_isp_dual_config {
  446. __u32 num_ports;
  447. __u32 reserved;
  448. struct cam_isp_dual_split_params split_params;
  449. struct cam_isp_dual_stripe_config stripes[1];
  450. } __attribute__((packed));
  451. /**
  452. * struct cam_isp_clock_config - Clock configuration
  453. *
  454. * @usage_type: Usage type (Single/Dual)
  455. * @num_rdi: Number of RDI votes
  456. * @left_pix_hz: Pixel Clock for Left ISP
  457. * @right_pix_hz: Pixel Clock for Right ISP, valid only if Dual
  458. * @rdi_hz: RDI Clock. ISP clock will be max of RDI and
  459. * PIX clocks. For a particular context which ISP
  460. * HW the RDI is allocated to is not known to UMD.
  461. * Hence pass the clock and let KMD decide.
  462. */
  463. struct cam_isp_clock_config {
  464. __u32 usage_type;
  465. __u32 num_rdi;
  466. __u64 left_pix_hz;
  467. __u64 right_pix_hz;
  468. __u64 rdi_hz[1];
  469. } __attribute__((packed));
  470. /**
  471. * struct cam_isp_csid_clock_config - CSID clock configuration
  472. *
  473. * @csid_clock CSID clock
  474. */
  475. struct cam_isp_csid_clock_config {
  476. __u64 csid_clock;
  477. } __attribute__((packed));
  478. /**
  479. * struct cam_isp_csid_qcfa_config - CSID qcfa binning support configuration
  480. *
  481. * @csid_binning CSID binning
  482. */
  483. struct cam_isp_csid_qcfa_config {
  484. __u32 csid_binning;
  485. } __attribute__((packed));
  486. /**
  487. * struct cam_isp_bw_vote - Bandwidth vote information
  488. *
  489. * @resource_id: Resource ID
  490. * @reserved: Reserved field for alignment
  491. * @cam_bw_bps: Bandwidth vote for CAMNOC
  492. * @ext_bw_bps: Bandwidth vote for path-to-DDR after CAMNOC
  493. */
  494. struct cam_isp_bw_vote {
  495. __u32 resource_id;
  496. __u32 reserved;
  497. __u64 cam_bw_bps;
  498. __u64 ext_bw_bps;
  499. } __attribute__((packed));
  500. /**
  501. * struct cam_isp_bw_config - Bandwidth configuration
  502. *
  503. * @usage_type: Usage type (Single/Dual)
  504. * @num_rdi: Number of RDI votes
  505. * @left_pix_vote: Bandwidth vote for left ISP
  506. * @right_pix_vote: Bandwidth vote for right ISP
  507. * @rdi_vote: RDI bandwidth requirements
  508. */
  509. struct cam_isp_bw_config {
  510. __u32 usage_type;
  511. __u32 num_rdi;
  512. struct cam_isp_bw_vote left_pix_vote;
  513. struct cam_isp_bw_vote right_pix_vote;
  514. struct cam_isp_bw_vote rdi_vote[1];
  515. } __attribute__((packed));
  516. /**
  517. * struct cam_isp_bw_config_v2 - Bandwidth configuration
  518. *
  519. * @usage_type: Usage type (Single/Dual)
  520. * @num_paths: Number of axi data paths
  521. * @axi_path Per path vote info
  522. */
  523. struct cam_isp_bw_config_v2 {
  524. __u32 usage_type;
  525. __u32 num_paths;
  526. struct cam_axi_per_path_bw_vote axi_path[1];
  527. } __attribute__((packed));
  528. /**
  529. * struct cam_fe_config - Fetch Engine configuration
  530. *
  531. * @version: fetch engine veriosn
  532. * @min_vbi: require min vbi
  533. * @fs_mode: indicates if fs mode enabled
  534. * @fs_line_sync_en: frame level sync or line level
  535. * sync for fetch engine
  536. * @hbi_count: hbi count
  537. * @fs_sync_enable: indicates if fetch engine working
  538. * wokring in sync with write engine
  539. * @go_cmd_sel: softwrae go_cmd or hw go_cmd
  540. * @client_enable: enable read engine
  541. * @source_addr: adrress of buffer to read from
  542. * @width: buffer width
  543. * @height: buffer height
  544. * @stride: buffer stride (here equal to width)
  545. * @format: format of image in buffer
  546. * @unpacker_cfg: unpacker config type
  547. * @latency_buf_size: latency buffer for read engine
  548. */
  549. struct cam_fe_config {
  550. __u64 version;
  551. __u32 min_vbi;
  552. __u32 fs_mode;
  553. __u32 fs_line_sync_en;
  554. __u32 hbi_count;
  555. __u32 fs_sync_enable;
  556. __u32 go_cmd_sel;
  557. __u32 client_enable;
  558. __u32 source_addr;
  559. __u32 width;
  560. __u32 height;
  561. __u32 stride;
  562. __u32 format;
  563. __u32 unpacker_cfg;
  564. __u32 latency_buf_size;
  565. } __attribute__((packed));
  566. /**
  567. * struct cam_isp_sensor_path_dimension
  568. *
  569. * @width expected width
  570. * @height expected height
  571. * @measure_enabled flag to indicate if pixel measurement is to be enabled
  572. */
  573. struct cam_isp_sensor_dimension {
  574. __u32 width;
  575. __u32 height;
  576. __u32 measure_enabled;
  577. } __attribute__((packed));
  578. /**
  579. * struct cam_isp_sensor_blanking_config
  580. *
  581. * @hbi HBI value
  582. * @vbi VBI value
  583. */
  584. struct cam_isp_sensor_blanking_config {
  585. __u32 hbi;
  586. __u32 vbi;
  587. } __attribute__((packed));
  588. /**
  589. * struct cam_isp_sensor_config - Sensor Dimension configuration
  590. *
  591. * @ppp_path: expected ppp path configuration
  592. * @ipp_path: expected ipp path configuration
  593. * @rdi_path: expected rdi path configuration
  594. * @hbi: HBI value
  595. * @vbi: VBI value
  596. */
  597. struct cam_isp_sensor_config {
  598. struct cam_isp_sensor_dimension ppp_path;
  599. struct cam_isp_sensor_dimension ipp_path;
  600. struct cam_isp_sensor_dimension rdi_path[CAM_IFE_CSID_RDI_MAX];
  601. __u32 hbi;
  602. __u32 vbi;
  603. } __attribute__((packed));
  604. /**
  605. * struct cam_isp_core_config - ISP core registers configuration
  606. *
  607. * @version: Version info
  608. * @vid_ds16_r2pd: Enables Y and C merging PD output for video DS16
  609. * @vid_ds4_r2pd: Enables Y and C merging PD output for video DS4
  610. * @disp_ds16_r2pd: Enables Y and C merging PD output for disp DS16
  611. * @disp_ds4_r2pd: Enables Y and C merging PD output for disp DS4
  612. * @dsp_streaming_tap_point: This selects source for DSP streaming interface
  613. * @ihist_src_sel: Selects input for IHIST module
  614. * @hdr_be_src_sel: Selects input for HDR BE module
  615. * @hdr_bhist_src_sel: Selects input for HDR BHIST module
  616. * @input_mux_sel_pdaf: Selects input for PDAF
  617. * @input_mux_sel_pp: Selects input for Pixel Pipe
  618. * @reserved: Reserved
  619. */
  620. struct cam_isp_core_config {
  621. __u32 version;
  622. __u32 vid_ds16_r2pd;
  623. __u32 vid_ds4_r2pd;
  624. __u32 disp_ds16_r2pd;
  625. __u32 disp_ds4_r2pd;
  626. __u32 dsp_streaming_tap_point;
  627. __u32 ihist_src_sel;
  628. __u32 hdr_be_src_sel;
  629. __u32 hdr_bhist_src_sel;
  630. __u32 input_mux_sel_pdaf;
  631. __u32 input_mux_sel_pp;
  632. __u32 reserved;
  633. } __attribute__((packed));
  634. /**
  635. * struct cam_isp_acquire_hw_info - ISP acquire HW params
  636. *
  637. * @common_info_version : Version of common info struct used
  638. * @common_info_size : Size of common info struct used
  639. * @common_info_offset : Offset of common info from start of data
  640. * @num_inputs : Number of inputs
  641. * @input_info_version : Version of input info struct used
  642. * @input_info_size : Size of input info struct used
  643. * @input_info_offset : Offset of input info from start of data
  644. * @data : Start of data region
  645. */
  646. struct cam_isp_acquire_hw_info {
  647. __u16 common_info_version;
  648. __u16 common_info_size;
  649. __u32 common_info_offset;
  650. __u32 num_inputs;
  651. __u32 input_info_version;
  652. __u32 input_info_size;
  653. __u32 input_info_offset;
  654. __u64 data;
  655. };
  656. /**
  657. * struct cam_isp_vfe_wm_config - VFE write master config per port
  658. *
  659. * @port_type : Unique ID of output port
  660. * @wm_mode : Write master mode
  661. * 0x0 - Line based mode
  662. * 0x1 - Frame based mode
  663. * 0x2 - Index based mode, valid for BAF only
  664. * @h_init : Horizontal starting coordinate in pixels. Must be a
  665. * multiple of 3 for TP10 format
  666. * @height : Height in pixels
  667. * @width : Width in pixels
  668. * @virtual_frame_en : Enabling virtual frame will prevent actual request from
  669. * being sent to NOC
  670. * @stride : Write master stride
  671. * @offset : Write master offset
  672. * @reserved_1 : Reserved field for Write master config
  673. * @reserved_2 : Reserved field for Write master config
  674. * @reserved_3 : Reserved field for Write master config
  675. * @reserved_4 : Reserved field for Write master config
  676. */
  677. struct cam_isp_vfe_wm_config {
  678. __u32 port_type;
  679. __u32 wm_mode;
  680. __u32 h_init;
  681. __u32 height;
  682. __u32 width;
  683. __u32 virtual_frame_en;
  684. __u32 stride;
  685. __u32 offset;
  686. __u32 reserved_1;
  687. __u32 reserved_2;
  688. __u32 reserved_3;
  689. __u32 reserved_4;
  690. };
  691. /**
  692. * struct cam_isp_vfe_out_config - VFE write master config
  693. *
  694. * @num_ports : Number of ports
  695. * @reserved : Reserved field
  696. * @wm_config : VFE out config
  697. */
  698. struct cam_isp_vfe_out_config {
  699. __u32 num_ports;
  700. __u32 reserved;
  701. struct cam_isp_vfe_wm_config wm_config[1];
  702. };
  703. /**
  704. * struct cam_isp_csid_epd_config - Support for EPD Packet config
  705. *
  706. * @is_epd_sensor : flag to check if epd supported
  707. */
  708. struct cam_isp_csid_epd_config {
  709. __u32 is_epd_supported;
  710. };
  711. #define CAM_ISP_ACQUIRE_COMMON_VER0 0x1000
  712. #define CAM_ISP_ACQUIRE_COMMON_SIZE_VER0 0x0
  713. #define CAM_ISP_ACQUIRE_INPUT_VER0 0x2000
  714. #define CAM_ISP_ACQUIRE_INPUT_SIZE_VER0 sizeof(struct cam_isp_in_port_info)
  715. #define CAM_ISP_ACQUIRE_OUT_VER0 0x3000
  716. #define CAM_ISP_ACQUIRE_OUT_SIZE_VER0 sizeof(struct cam_isp_out_port_info)
  717. #endif /* __UAPI_CAM_ISP_H__ */