cam_isp.h 28 KB

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