cam_isp.h 29 KB

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