cam_isp.h 27 KB

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