cam_isp.h 28 KB

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