cam_isp.h 28 KB

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