cam_tfe.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
  4. * Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved.
  5. */
  6. #ifndef __UAPI_CAM_TFE_H__
  7. #define __UAPI_CAM_TFE_H__
  8. #include <media/cam_defs.h>
  9. #include <media/cam_isp_tfe.h>
  10. #include <media/cam_cpas.h>
  11. /* ISP TFE driver name */
  12. #define CAM_ISP_TFE_DEV_NAME "cam-isp"
  13. /* HW type */
  14. #define CAM_ISP_TFE_HW_BASE 0
  15. #define CAM_ISP_TFE_HW_CSID 1
  16. #define CAM_ISP_TFE_HW_TFE 2
  17. #define CAM_ISP_TFE_HW_MAX 3
  18. /* Color Pattern */
  19. #define CAM_ISP_TFE_PATTERN_BAYER_RGRGRG 0
  20. #define CAM_ISP_TFE_PATTERN_BAYER_GRGRGR 1
  21. #define CAM_ISP_TFE_PATTERN_BAYER_BGBGBG 2
  22. #define CAM_ISP_TFE_PATTERN_BAYER_GBGBGB 3
  23. #define CAM_ISP_TFE_PATTERN_YUV_YCBYCR 4
  24. #define CAM_ISP_TFE_PATTERN_YUV_YCRYCB 5
  25. #define CAM_ISP_TFE_PATTERN_YUV_CBYCRY 6
  26. #define CAM_ISP_TFE_PATTERN_YUV_CRYCBY 7
  27. #define CAM_ISP_TFE_PATTERN_MAX 8
  28. /* Usage Type */
  29. #define CAM_ISP_TFE_IN_RES_USAGE_SINGLE 0
  30. #define CAM_ISP_TFE_IN_RES_USAGE_DUAL 1
  31. #define CAM_ISP_TFE_IN_RES_USAGE_MAX 2
  32. /* Resource ID */
  33. #define CAM_ISP_TFE_RES_ID_PORT 0
  34. #define CAM_ISP_TFE_RES_ID_MAX 1
  35. /* Resource Type - Type of resource for the resource id
  36. * defined in cam_isp_tfe.h
  37. */
  38. /* Lane Type in input resource for Port */
  39. #define CAM_ISP_TFE_IN_LANE_TYPE_DPHY 0
  40. #define CAM_ISP_TFE_IN_LANE_TYPE_CPHY 1
  41. #define CAM_ISP_TFE_IN_LANE_TYPE_MAX 2
  42. /* ISP TFE packet opcode */
  43. #define CAM_ISP_TFE_PACKET_OP_BASE 0
  44. #define CAM_ISP_TFE_PACKET_INIT_DEV 1
  45. #define CAM_ISP_TFE_PACKET_CONFIG_DEV 2
  46. #define CAM_ISP_TFE_PACKET_OP_MAX 3
  47. /* ISP TFE packet meta_data type for command buffer */
  48. #define CAM_ISP_TFE_PACKET_META_BASE 0
  49. #define CAM_ISP_TFE_PACKET_META_LEFT 1
  50. #define CAM_ISP_TFE_PACKET_META_RIGHT 2
  51. #define CAM_ISP_TFE_PACKET_META_COMMON 3
  52. #define CAM_ISP_TFE_PACKET_META_DUAL_CONFIG 4
  53. #define CAM_ISP_TFE_PACKET_META_GENERIC_BLOB_COMMON 5
  54. #define CAM_ISP_TFE_PACKET_META_REG_DUMP_PER_REQUEST 6
  55. #define CAM_ISP_TFE_PACKET_META_REG_DUMP_ON_FLUSH 7
  56. #define CAM_ISP_TFE_PACKET_META_REG_DUMP_ON_ERROR 8
  57. #define CAM_ISP_TFE_PACKET_META_GENERIC_BLOB_LEFT 9
  58. #define CAM_ISP_TFE_PACKET_META_GENERIC_BLOB_RIGHT 10
  59. /* ISP TFE Generic Cmd Buffer Blob types */
  60. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_HFR_CONFIG 0
  61. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_CLOCK_CONFIG 1
  62. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_BW_CONFIG_V2 2
  63. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_CSID_CLOCK_CONFIG 3
  64. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_INIT_CONFIG 4
  65. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_DYNAMIC_MODE_SWITCH 15
  66. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_BW_LIMITER_CFG 16
  67. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_ALIGNMENT_OFFSET_INFO 17
  68. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_UPDATE_OUT_RES 18
  69. #define CAM_ISP_TFE_GENERIC_BLOB_TYPE_DISCARD_INITIAL_FRAMES 19
  70. /* DSP mode */
  71. #define CAM_ISP_TFE_DSP_MODE_NONE 0
  72. #define CAM_ISP_TFE_DSP_MODE_ONE_WAY 1
  73. #define CAM_ISP_TFE_DSP_MODE_ROUND 2
  74. /* Per Path Usage Data */
  75. #define CAM_ISP_TFE_USAGE_INVALID 0
  76. #define CAM_ISP_TFE_USAGE_LEFT_PX 1
  77. #define CAM_ISP_TFE_USAGE_RIGHT_PX 2
  78. #define CAM_ISP_TFE_USAGE_RDI 3
  79. /* Bus write master modes */
  80. #define CAM_ISP_TFE_WM_FRAME_BASED_MODE 0
  81. #define CAM_ISP_TFE_WM_LINE_BASED_MODE 1
  82. #define CAM_ISP_TFE_WM_INDEX_BASED_MODE 2
  83. #define CAM_ISP_TFE_VC_DT_CFG 2
  84. /* Feature Flag indicators */
  85. #define CAM_ISP_TFE_FLAG_QCFA_BIN BIT(0)
  86. #define CAM_ISP_TFE_FLAG_BAYER_BIN BIT(1)
  87. #define CAM_ISP_TFE_FLAG_SHDR_MASTER_EN BIT(2)
  88. #define CAM_ISP_TFE_FLAG_SHDR_SLAVE_EN BIT(3)
  89. /* Query devices */
  90. /**
  91. * struct cam_isp_tfe_dev_cap_info - A cap info for particular hw type
  92. *
  93. * @hw_type: Hardware type for the cap info
  94. * @reserved: reserved field for alignment
  95. * @hw_version: Hardware version
  96. *
  97. */
  98. struct cam_isp_tfe_dev_cap_info {
  99. __u32 hw_type;
  100. __u32 reserved;
  101. struct cam_hw_version hw_version;
  102. };
  103. /**
  104. * struct cam_isp_tfe_query_cap_cmd - ISP TFE query device
  105. * capability payload
  106. *
  107. * @device_iommu: returned iommu handles for device
  108. * @cdm_iommu: returned iommu handles for cdm
  109. * @num_dev: returned number of device capabilities
  110. * @reserved: reserved field for alignment
  111. * @dev_caps: returned device capability array
  112. *
  113. */
  114. struct cam_isp_tfe_query_cap_cmd {
  115. struct cam_iommu_handle device_iommu;
  116. struct cam_iommu_handle cdm_iommu;
  117. __s32 num_dev;
  118. __u32 reserved;
  119. struct cam_isp_tfe_dev_cap_info dev_caps[CAM_ISP_TFE_HW_MAX];
  120. };
  121. /**
  122. * struct cam_isp_tfe_query_cap_cmd_v2 - ISP TFE query device
  123. * capability payload
  124. *
  125. * @version returned query cap cmd api version
  126. * @num_dev: returned number of device capabilities
  127. * @device_iommu: returned iommu handles for device
  128. * @cdm_iommu: returned iommu handles for cdm
  129. * @dev_caps: returned device capability array
  130. *
  131. */
  132. struct cam_isp_tfe_query_cap_cmd_v2 {
  133. __u32 version;
  134. __s32 num_dev;
  135. struct cam_iommu_handle device_iommu;
  136. struct cam_iommu_handle cdm_iommu;
  137. struct cam_isp_tfe_dev_cap_info dev_caps[1];
  138. };
  139. /* Acquire Device */
  140. /**
  141. * struct cam_isp_tfe_out_port_info - An output port resource info
  142. *
  143. * @res_id: output resource id defined in file
  144. * cam_isp_tfe.h
  145. * @format: output format of the resource
  146. * @width: output width in pixels
  147. * @height: output height in lines
  148. * @stride: output stride
  149. * @comp_grp_id: composite group id for the resource.
  150. * @secure_mode: flag to tell if output should be run in secure
  151. * mode or not. See cam_defs.h for definition
  152. * @wm_mode: wm mode
  153. * @reserved: reserved field for alignment
  154. *
  155. */
  156. struct cam_isp_tfe_out_port_info {
  157. __u32 res_id;
  158. __u32 format;
  159. __u32 width;
  160. __u32 height;
  161. __u32 stride;
  162. __u32 comp_grp_id;
  163. __u32 secure_mode;
  164. __u32 wm_mode;
  165. __u32 reserved;
  166. };
  167. /**
  168. * struct cam_isp_tfe_in_port_info - An input port resource info
  169. *
  170. * @res_id: input resource id CAM_ISP_TFE_IN_RES_XXX
  171. * @lane_type: lane type: c-phy or d-phy.
  172. * @lane_num: active lane number
  173. * @lane_cfg: lane configurations: 4 bits per lane
  174. * @vc: input virtual channel number
  175. * @dt: input data type number
  176. * @format: input format
  177. * @pix_pattern: pixel pattern
  178. * @usage_type: whether dual tfe is required
  179. * @left_start: left input start offset in pixels
  180. * @left_end: left input stop offset in pixels
  181. * @left_width: left input width in pixels
  182. * @right_start: right input start offset in pixels.
  183. * Only for Dual TFE
  184. * @right_end: right input stop offset in
  185. * pixels. Only for Dual TFE
  186. * @right_width: right input width in pixels.
  187. * Only for dual TFE
  188. * @line_start: top of the line number
  189. * @line_stop: bottome of the line number
  190. * @height: input height in lines
  191. * @batch_size: batch size for HFR mode
  192. * @dsp_mode: DSP stream mode(Defines as
  193. * CAM_ISP_TFE_DSP_MODE_*)
  194. * @sensor_width: sensor width
  195. * @sensor_height: sensor height
  196. * @hbi_value: sensor HBI value
  197. * @vbi_value: sensor VBI value
  198. * @sensor_fps: sensor fps
  199. * @init_frame_drop init frame drop value.
  200. * @num_out_res: number of the output resource associated
  201. * @data: payload that contains the output resources,
  202. * array of cam_isp_tfe_out_port_info data
  203. *
  204. */
  205. struct cam_isp_tfe_in_port_info {
  206. __u32 res_id;
  207. __u32 lane_type;
  208. __u32 lane_num;
  209. __u32 lane_cfg;
  210. __u32 vc;
  211. __u32 dt;
  212. __u32 format;
  213. __u32 pix_pattern;
  214. __u32 usage_type;
  215. __u32 left_start;
  216. __u32 left_end;
  217. __u32 left_width;
  218. __u32 right_start;
  219. __u32 right_end;
  220. __u32 right_width;
  221. __u32 line_start;
  222. __u32 line_end;
  223. __u32 height;
  224. __u32 batch_size;
  225. __u32 dsp_mode;
  226. __u32 sensor_width;
  227. __u32 sensor_height;
  228. __u32 sensor_hbi;
  229. __u32 sensor_vbi;
  230. __u32 sensor_fps;
  231. __u32 init_frame_drop;
  232. __u32 num_out_res;
  233. struct cam_isp_tfe_out_port_info data[1];
  234. };
  235. /**
  236. * struct cam_isp_tfe_in_port_info_v2 - An input port resource info
  237. *
  238. * @res_id: input resource id CAM_ISP_TFE_IN_RES_XXX
  239. * @lane_type: lane type: c-phy or d-phy.
  240. * @lane_num: active lane number
  241. * @lane_cfg: lane configurations: 4 bits per lane
  242. * @vc: input virtual channel number
  243. * @dt: input data type number
  244. * @format: input format
  245. * @pix_pattern: pixel pattern
  246. * @usage_type: whether dual tfe is required
  247. * @left_start: left input start offset in pixels
  248. * @left_end: left input stop offset in pixels
  249. * @left_width: left input width in pixels
  250. * @right_start: right input start offset in pixels.
  251. * Only for Dual TFE
  252. * @right_end: right input stop offset in
  253. * pixels. Only for Dual TFE
  254. * @right_width: right input width in pixels.
  255. * Only for dual TFE
  256. * @line_start: top of the line number
  257. * @line_stop: bottome of the line number
  258. * @height: input height in lines
  259. * @batch_size: batch size for HFR mode
  260. * @dsp_mode: DSP stream mode(Defines as
  261. * CAM_ISP_TFE_DSP_MODE_*)
  262. * @sensor_width: sensor width
  263. * @sensor_height: sensor height
  264. * @sensor_hbi: sensor HBI value
  265. * @sensor_vbi: sensor VBI value
  266. * @sensor_fps: sensor fps
  267. * @init_frame_drop init frame drop value.
  268. * @num_out_res: number of the output resource associated
  269. * @feature_flag: Feature flags for indicating QCFA, Bayer bin
  270. * @core_cfg: Core configuration
  271. * @reserve_field_1: Reserve field 1
  272. * @reserve_field_2: Reserve field 2
  273. * @reserve_field_3: Reserve field 3
  274. * @reserve_field_4: Reserve field 4
  275. * @reserve_field_5: Reserve field 5
  276. * @reserve_field_6: Reserve filed 6
  277. * @data: payload that contains the output resources,
  278. * array of cam_isp_tfe_out_port_info data
  279. *
  280. */
  281. struct cam_isp_tfe_in_port_info_v2 {
  282. __u32 res_id;
  283. __u32 lane_type;
  284. __u32 lane_num;
  285. __u32 lane_cfg;
  286. __u32 vc[CAM_ISP_TFE_VC_DT_CFG];
  287. __u32 dt[CAM_ISP_TFE_VC_DT_CFG];
  288. __u32 num_valid_vc_dt;
  289. __u32 format;
  290. __u32 pix_pattern;
  291. __u32 usage_type;
  292. __u32 left_start;
  293. __u32 left_end;
  294. __u32 left_width;
  295. __u32 right_start;
  296. __u32 right_end;
  297. __u32 right_width;
  298. __u32 line_start;
  299. __u32 line_end;
  300. __u32 height;
  301. __u32 batch_size;
  302. __u32 dsp_mode;
  303. __u32 sensor_width;
  304. __u32 sensor_height;
  305. __u32 sensor_hbi;
  306. __u32 sensor_vbi;
  307. __u32 sensor_fps;
  308. __u32 init_frame_drop;
  309. __u32 num_out_res;
  310. __u32 feature_flag;
  311. __u32 core_cfg;
  312. __u32 reserve_field_1;
  313. __u32 reserve_field_2;
  314. __u32 reserve_field_3;
  315. __u32 reserve_field_4;
  316. __u32 reserve_field_5;
  317. __u32 reserve_field_6;
  318. struct cam_isp_tfe_out_port_info data[1];
  319. };
  320. /**
  321. * struct cam_isp_tfe_resource - A resource bundle
  322. *
  323. * @resoruce_id: resource id for the resource bundle
  324. * @length: length of the while resource blob
  325. * @handle_type: type of the resource handle
  326. * @reserved: reserved field for alignment
  327. * @res_hdl: resource handle that points to the
  328. * resource array
  329. *
  330. */
  331. struct cam_isp_tfe_resource {
  332. __u32 resource_id;
  333. __u32 length;
  334. __u32 handle_type;
  335. __u32 reserved;
  336. __u64 res_hdl;
  337. };
  338. /**
  339. * struct cam_isp_tfe_port_hfr_config - HFR configuration for
  340. * this port
  341. *
  342. * @resource_type: Resource type
  343. * @subsample_pattern: Subsample pattern. Used in HFR mode. It
  344. * should be consistent with batchSize and
  345. * CAMIF programming.
  346. * @subsample_period: Subsample period. Used in HFR mode. It
  347. * should be consistent with batchSize and
  348. * CAMIF programming.
  349. * @framedrop_pattern: Framedrop pattern
  350. * @framedrop_period: Framedrop period
  351. * @reserved: Reserved for alignment
  352. */
  353. struct cam_isp_tfe_port_hfr_config {
  354. __u32 resource_type;
  355. __u32 subsample_pattern;
  356. __u32 subsample_period;
  357. __u32 framedrop_pattern;
  358. __u32 framedrop_period;
  359. __u32 reserved;
  360. } __attribute__((packed));
  361. /**
  362. * struct cam_isp_tfe_resource_hfr_config - Resource HFR
  363. * configuration
  364. *
  365. * @num_ports: Number of ports
  366. * @reserved: Reserved for alignment
  367. * @port_hfr_config: HFR configuration for each IO port
  368. */
  369. struct cam_isp_tfe_resource_hfr_config {
  370. __u32 num_ports;
  371. __u32 reserved;
  372. struct cam_isp_tfe_port_hfr_config port_hfr_config[1];
  373. } __attribute__((packed));
  374. /**
  375. * struct cam_isp_tfe_dual_stripe_config - stripe config per bus
  376. * client
  377. *
  378. * @offset: Start horizontal offset relative to
  379. * output buffer
  380. * @width: Width of the stripe in pixels
  381. * @port_id: Port id of ISP TFE output
  382. * @reserved: Reserved for alignment
  383. *
  384. */
  385. struct cam_isp_tfe_dual_stripe_config {
  386. __u32 offset;
  387. __u32 width;
  388. __u32 port_id;
  389. __u32 reserved;
  390. };
  391. /**
  392. * struct cam_isp_tfe_dual_config - dual isp configuration
  393. *
  394. * @num_ports Number of isp output ports
  395. * @reserved Reserved field for alignment
  396. * @stripes: Stripe information
  397. *
  398. */
  399. struct cam_isp_tfe_dual_config {
  400. __u32 num_ports;
  401. __u32 reserved;
  402. struct cam_isp_tfe_dual_stripe_config stripes[1];
  403. } __attribute__((packed));
  404. /**
  405. * struct cam_isp_tfe_clock_config - Clock configuration
  406. *
  407. * @usage_type: Usage type (Single/Dual)
  408. * @num_rdi: Number of RDI votes
  409. * @left_pix_hz: Pixel Clock for Left ISP
  410. * @right_pix_hz: Pixel Clock for Right ISP
  411. * valid only if Dual
  412. * @rdi_hz: RDI Clock. ISP TFE clock will be
  413. * max of RDI and PIX clocks. For a
  414. * particular context which ISP TFE
  415. * HW the RDI is allocated to is
  416. * not known to UMD. Hence pass the
  417. * clock and let KMD decide.
  418. */
  419. struct cam_isp_tfe_clock_config {
  420. __u32 usage_type;
  421. __u32 num_rdi;
  422. __u64 left_pix_hz;
  423. __u64 right_pix_hz;
  424. __u64 rdi_hz[1];
  425. } __attribute__((packed));
  426. /**
  427. * struct cam_isp_tfe_csid_clock_config - CSID clock
  428. * configuration
  429. *
  430. * @csid_clock CSID clock
  431. * @csi_phy_clock Phy clock valid if tpg is selected
  432. */
  433. struct cam_isp_tfe_csid_clock_config {
  434. __u64 csid_clock;
  435. __u64 phy_clock;
  436. } __attribute__((packed));
  437. /**
  438. * struct cam_isp_tfe_bw_config_v2 - Bandwidth configuration
  439. *
  440. * @usage_type: Usage type (Single/Dual)
  441. * @num_paths: Number of axi data paths
  442. * @axi_path Per path vote info
  443. */
  444. struct cam_isp_tfe_bw_config_v2 {
  445. __u32 usage_type;
  446. __u32 num_paths;
  447. struct cam_axi_per_path_bw_vote axi_path[1];
  448. } __attribute__((packed));
  449. /**
  450. * struct cam_isp_acquire_hw_info - ISP TFE acquire HW params
  451. *
  452. * @common_info_version : Version of common info struct used
  453. * @common_info_size : Size of common info struct used
  454. * @common_info_offset : Offset of common info from start of data
  455. * @num_inputs : Number of inputs
  456. * @input_info_version : Version of input info struct used
  457. * @input_info_size : Size of input info struct used
  458. * @input_info_offset : Offset of input info from start of data
  459. * @data : Data pointer to point the cam_isp_tfe_in_port_info
  460. * structure
  461. */
  462. struct cam_isp_tfe_acquire_hw_info {
  463. __u16 common_info_version;
  464. __u16 common_info_size;
  465. __u32 common_info_offset;
  466. __u32 num_inputs;
  467. __u32 input_info_version;
  468. __u32 input_info_size;
  469. __u32 input_info_offset;
  470. __u64 data;
  471. };
  472. /**
  473. * struct cam_isp_tfe_wm_bw_limiter_config - ISP TFE write master
  474. * BW limter config
  475. *
  476. *
  477. * @res_type : output resource type defined in file cam_isp_tfe.h
  478. * @enable_limiter : 0 for disable else enabled
  479. * @counter_limit : Max counter value
  480. */
  481. struct cam_isp_tfe_wm_bw_limiter_config {
  482. __u32 res_type;
  483. __u32 enable_limiter;
  484. __u32 counter_limit[CAM_PACKET_MAX_PLANES];
  485. };
  486. /**
  487. * struct cam_isp_tfe_out_rsrc_bw_limiter_config - ISP TFE out rsrc BW limiter config
  488. *
  489. * Configure BW limiter for ISP TFE WMs
  490. *
  491. * @version : Version field
  492. * @num_ports : Number of ports
  493. * @bw_limit_config : WM BW limiter config
  494. */
  495. struct cam_isp_tfe_out_rsrc_bw_limiter_config {
  496. __u32 version;
  497. __u32 num_ports;
  498. struct cam_isp_tfe_wm_bw_limiter_config bw_limiter_config[1];
  499. };
  500. /**
  501. * struct cam_isp_tfe_alignment_offset_config - ISP TFE buffer alignment config
  502. *
  503. * @resource_type: Resourse type
  504. * @x_offset: Offset of the buffer from x-axies
  505. * @y_offset: Offset of the buffer from y-axies
  506. * @width: Width of out resource
  507. * @height: Height of out resource
  508. * @stride: Stride of out resource
  509. *
  510. */
  511. struct cam_isp_tfe_alignment_offset_config {
  512. __u32 resource_type;
  513. __u32 x_offset;
  514. __u32 y_offset;
  515. __u32 width;
  516. __u32 height;
  517. __u32 stride;
  518. } __attribute__((packed));
  519. /**
  520. * struct cam_isp_tfe_alignment_resource_info - ISP TFE Resource Alignment
  521. *
  522. * @version: Alignment api version
  523. * @num_ports: Number of ports
  524. * @port_alignment_cfg: Buffer alignment for each IO port
  525. */
  526. struct cam_isp_tfe_alignment_resource_info {
  527. __u32 version;
  528. __u32 num_ports;
  529. struct cam_isp_tfe_alignment_offset_config port_alignment_cfg[1];
  530. } __attribute__((packed));
  531. /**
  532. * struct cam_isp_tfe_wm_dimension_config - ISP TFE res Dimension config
  533. *
  534. * @res_id : Resource id
  535. * @mode : Mode of out resource
  536. * @height : Out resource height
  537. * @width : Out resource width
  538. *
  539. */
  540. struct cam_isp_tfe_wm_dimension_config {
  541. __u32 res_id;
  542. __u32 mode;
  543. __u32 height;
  544. __u32 width;
  545. };
  546. /**
  547. * struct cam_isp_tfe_out_resource_config - ISP TFE out config
  548. *
  549. * @num_ports : Num of out res
  550. * @reserved : Reserved field
  551. * @dimention_config : Out resource dimension config
  552. */
  553. struct cam_isp_tfe_out_resource_config {
  554. __u32 num_ports;
  555. __u32 reserved;
  556. struct cam_isp_tfe_wm_dimension_config dimension_config[1];
  557. };
  558. /**
  559. * struct cam_isp_tfe_discard_initial_frames - Discard init frames
  560. *
  561. * Some sensors require discarding the initial frames
  562. * after the sensor is streamed on. The discard would be
  563. * applied on all paths [IPP/PPP/RDIx] for the given
  564. * pipeline.
  565. *
  566. * @version : Version field
  567. * @num_frames : Number of frames to be discarded
  568. */
  569. struct cam_isp_tfe_discard_initial_frames {
  570. __u32 version;
  571. __u32 num_frames;
  572. } __attribute__((packed));
  573. #define CAM_TFE_ACQUIRE_COMMON_VER0 0x1000
  574. #define CAM_TFE_ACQUIRE_COMMON_SIZE_VER0 0x0
  575. #define CAM_TFE_ACQUIRE_INPUT_VER0 0x2000
  576. #define CAM_TFE_ACQUIRE_INPUT_SIZE_VER0 sizeof(struct cam_isp_tfe_in_port_info)
  577. #define CAM_TFE_ACQUIRE_OUT_VER0 0x3000
  578. #define CAM_TFE_ACQUIRE_OUT_SIZE_VER0 sizeof(struct cam_isp_tfe_out_port_info)
  579. #endif /* __UAPI_CAM_TFE_H__ */