cam_tfe.h 24 KB

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