dce_calcs.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. /*
  2. * Copyright 2015-2017 Advanced Micro Devices, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  17. * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
  18. * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  19. * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  20. * OTHER DEALINGS IN THE SOFTWARE.
  21. *
  22. * Authors: AMD
  23. *
  24. */
  25. /**
  26. * Bandwidth and Watermark calculations interface.
  27. * (Refer to "DCEx_mode_support.xlsm" from Perforce.)
  28. */
  29. #ifndef __DCE_CALCS_H__
  30. #define __DCE_CALCS_H__
  31. #include "bw_fixed.h"
  32. struct pipe_ctx;
  33. struct dc;
  34. struct dc_state;
  35. struct dce_bw_output;
  36. enum bw_calcs_version {
  37. BW_CALCS_VERSION_INVALID,
  38. BW_CALCS_VERSION_CARRIZO,
  39. BW_CALCS_VERSION_POLARIS10,
  40. BW_CALCS_VERSION_POLARIS11,
  41. BW_CALCS_VERSION_POLARIS12,
  42. BW_CALCS_VERSION_VEGAM,
  43. BW_CALCS_VERSION_STONEY,
  44. BW_CALCS_VERSION_VEGA10
  45. };
  46. /*******************************************************************************
  47. * There are three types of input into Calculations:
  48. * 1. per-DCE static values - these are "hardcoded" properties of the DCEIP
  49. * 2. board-level values - these are generally coming from VBIOS parser
  50. * 3. mode/configuration values - depending Mode, Scaling number of Displays etc.
  51. ******************************************************************************/
  52. enum bw_defines {
  53. //Common
  54. bw_def_no = 0,
  55. bw_def_none = 0,
  56. bw_def_yes = 1,
  57. bw_def_ok = 1,
  58. bw_def_high = 2,
  59. bw_def_mid = 1,
  60. bw_def_low = 0,
  61. //Internal
  62. bw_defs_start = 255,
  63. bw_def_underlay422,
  64. bw_def_underlay420_luma,
  65. bw_def_underlay420_chroma,
  66. bw_def_underlay444,
  67. bw_def_graphics,
  68. bw_def_display_write_back420_luma,
  69. bw_def_display_write_back420_chroma,
  70. bw_def_portrait,
  71. bw_def_hsr_mtn_4,
  72. bw_def_hsr_mtn_h_taps,
  73. bw_def_ceiling__h_taps_div_4___meq_hsr,
  74. bw_def_invalid_linear_or_stereo_mode,
  75. bw_def_invalid_rotation_or_bpp_or_stereo,
  76. bw_def_vsr_mtn_v_taps,
  77. bw_def_vsr_mtn_4,
  78. bw_def_auto,
  79. bw_def_manual,
  80. bw_def_exceeded_allowed_maximum_sclk,
  81. bw_def_exceeded_allowed_page_close_open,
  82. bw_def_exceeded_allowed_outstanding_pte_req_queue_size,
  83. bw_def_exceeded_allowed_maximum_bw,
  84. bw_def_landscape,
  85. //Panning and bezel
  86. bw_def_any_lines,
  87. //Underlay mode
  88. bw_def_underlay_only,
  89. bw_def_blended,
  90. bw_def_blend,
  91. //Stereo mode
  92. bw_def_mono,
  93. bw_def_side_by_side,
  94. bw_def_top_bottom,
  95. //Underlay surface type
  96. bw_def_420,
  97. bw_def_422,
  98. bw_def_444,
  99. //Tiling mode
  100. bw_def_linear,
  101. bw_def_tiled,
  102. bw_def_array_linear_general,
  103. bw_def_array_linear_aligned,
  104. bw_def_rotated_micro_tiling,
  105. bw_def_display_micro_tiling,
  106. //Memory type
  107. bw_def_gddr5,
  108. bw_def_hbm,
  109. //Voltage
  110. bw_def_high_no_nbp_state_change,
  111. bw_def_0_72,
  112. bw_def_0_8,
  113. bw_def_0_9,
  114. bw_def_notok = -1,
  115. bw_def_na = -1
  116. };
  117. struct bw_calcs_dceip {
  118. enum bw_calcs_version version;
  119. uint32_t percent_of_ideal_port_bw_received_after_urgent_latency;
  120. uint32_t max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation;
  121. uint32_t max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation;
  122. bool large_cursor;
  123. uint32_t cursor_max_outstanding_group_num;
  124. bool dmif_pipe_en_fbc_chunk_tracker;
  125. struct bw_fixed dmif_request_buffer_size;
  126. uint32_t lines_interleaved_into_lb;
  127. uint32_t low_power_tiling_mode;
  128. uint32_t chunk_width;
  129. uint32_t number_of_graphics_pipes;
  130. uint32_t number_of_underlay_pipes;
  131. bool display_write_back_supported;
  132. bool argb_compression_support;
  133. struct bw_fixed underlay_vscaler_efficiency6_bit_per_component;
  134. struct bw_fixed underlay_vscaler_efficiency8_bit_per_component;
  135. struct bw_fixed underlay_vscaler_efficiency10_bit_per_component;
  136. struct bw_fixed underlay_vscaler_efficiency12_bit_per_component;
  137. struct bw_fixed graphics_vscaler_efficiency6_bit_per_component;
  138. struct bw_fixed graphics_vscaler_efficiency8_bit_per_component;
  139. struct bw_fixed graphics_vscaler_efficiency10_bit_per_component;
  140. struct bw_fixed graphics_vscaler_efficiency12_bit_per_component;
  141. struct bw_fixed alpha_vscaler_efficiency;
  142. uint32_t max_dmif_buffer_allocated;
  143. uint32_t graphics_dmif_size;
  144. uint32_t underlay_luma_dmif_size;
  145. uint32_t underlay_chroma_dmif_size;
  146. bool pre_downscaler_enabled;
  147. bool underlay_downscale_prefetch_enabled;
  148. struct bw_fixed lb_write_pixels_per_dispclk;
  149. struct bw_fixed lb_size_per_component444;
  150. bool graphics_lb_nodownscaling_multi_line_prefetching;
  151. struct bw_fixed stutter_and_dram_clock_state_change_gated_before_cursor;
  152. struct bw_fixed underlay420_luma_lb_size_per_component;
  153. struct bw_fixed underlay420_chroma_lb_size_per_component;
  154. struct bw_fixed underlay422_lb_size_per_component;
  155. struct bw_fixed cursor_chunk_width;
  156. struct bw_fixed cursor_dcp_buffer_lines;
  157. struct bw_fixed underlay_maximum_width_efficient_for_tiling;
  158. struct bw_fixed underlay_maximum_height_efficient_for_tiling;
  159. struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display;
  160. struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation;
  161. struct bw_fixed minimum_outstanding_pte_request_limit;
  162. struct bw_fixed maximum_total_outstanding_pte_requests_allowed_by_saw;
  163. bool limit_excessive_outstanding_dmif_requests;
  164. struct bw_fixed linear_mode_line_request_alternation_slice;
  165. uint32_t scatter_gather_lines_of_pte_prefetching_in_linear_mode;
  166. uint32_t display_write_back420_luma_mcifwr_buffer_size;
  167. uint32_t display_write_back420_chroma_mcifwr_buffer_size;
  168. struct bw_fixed request_efficiency;
  169. struct bw_fixed dispclk_per_request;
  170. struct bw_fixed dispclk_ramping_factor;
  171. struct bw_fixed display_pipe_throughput_factor;
  172. uint32_t scatter_gather_pte_request_rows_in_tiling_mode;
  173. struct bw_fixed mcifwr_all_surfaces_burst_time;
  174. };
  175. struct bw_calcs_vbios {
  176. enum bw_defines memory_type;
  177. uint32_t dram_channel_width_in_bits;
  178. uint32_t number_of_dram_channels;
  179. uint32_t number_of_dram_banks;
  180. struct bw_fixed low_yclk; /*m_hz*/
  181. struct bw_fixed mid_yclk; /*m_hz*/
  182. struct bw_fixed high_yclk; /*m_hz*/
  183. struct bw_fixed low_sclk; /*m_hz*/
  184. struct bw_fixed mid1_sclk; /*m_hz*/
  185. struct bw_fixed mid2_sclk; /*m_hz*/
  186. struct bw_fixed mid3_sclk; /*m_hz*/
  187. struct bw_fixed mid4_sclk; /*m_hz*/
  188. struct bw_fixed mid5_sclk; /*m_hz*/
  189. struct bw_fixed mid6_sclk; /*m_hz*/
  190. struct bw_fixed high_sclk; /*m_hz*/
  191. struct bw_fixed low_voltage_max_dispclk; /*m_hz*/
  192. struct bw_fixed mid_voltage_max_dispclk; /*m_hz*/
  193. struct bw_fixed high_voltage_max_dispclk; /*m_hz*/
  194. struct bw_fixed low_voltage_max_phyclk;
  195. struct bw_fixed mid_voltage_max_phyclk;
  196. struct bw_fixed high_voltage_max_phyclk;
  197. struct bw_fixed data_return_bus_width;
  198. struct bw_fixed trc;
  199. struct bw_fixed dmifmc_urgent_latency;
  200. struct bw_fixed stutter_self_refresh_exit_latency;
  201. struct bw_fixed stutter_self_refresh_entry_latency;
  202. struct bw_fixed nbp_state_change_latency;
  203. struct bw_fixed mcifwrmc_urgent_latency;
  204. bool scatter_gather_enable;
  205. struct bw_fixed down_spread_percentage;
  206. uint32_t cursor_width;
  207. uint32_t average_compression_rate;
  208. uint32_t number_of_request_slots_gmc_reserves_for_dmif_per_channel;
  209. struct bw_fixed blackout_duration;
  210. struct bw_fixed maximum_blackout_recovery_time;
  211. };
  212. /*******************************************************************************
  213. * Temporary data structure(s).
  214. ******************************************************************************/
  215. #define maximum_number_of_surfaces 12
  216. /*Units : MHz, us */
  217. struct bw_calcs_data {
  218. /* data for all displays */
  219. bool display_synchronization_enabled;
  220. uint32_t number_of_displays;
  221. enum bw_defines underlay_surface_type;
  222. enum bw_defines panning_and_bezel_adjustment;
  223. enum bw_defines graphics_tiling_mode;
  224. uint32_t graphics_lb_bpc;
  225. uint32_t underlay_lb_bpc;
  226. enum bw_defines underlay_tiling_mode;
  227. enum bw_defines d0_underlay_mode;
  228. bool d1_display_write_back_dwb_enable;
  229. enum bw_defines d1_underlay_mode;
  230. bool increase_voltage_to_support_mclk_switch;
  231. bool cpup_state_change_enable;
  232. bool cpuc_state_change_enable;
  233. bool nbp_state_change_enable;
  234. bool stutter_mode_enable;
  235. uint32_t y_clk_level;
  236. uint32_t sclk_level;
  237. uint32_t number_of_underlay_surfaces;
  238. uint32_t number_of_dram_wrchannels;
  239. uint32_t chunk_request_delay;
  240. uint32_t number_of_dram_channels;
  241. enum bw_defines underlay_micro_tile_mode;
  242. enum bw_defines graphics_micro_tile_mode;
  243. struct bw_fixed max_phyclk;
  244. struct bw_fixed dram_efficiency;
  245. struct bw_fixed src_width_after_surface_type;
  246. struct bw_fixed src_height_after_surface_type;
  247. struct bw_fixed hsr_after_surface_type;
  248. struct bw_fixed vsr_after_surface_type;
  249. struct bw_fixed src_width_after_rotation;
  250. struct bw_fixed src_height_after_rotation;
  251. struct bw_fixed hsr_after_rotation;
  252. struct bw_fixed vsr_after_rotation;
  253. struct bw_fixed source_height_pixels;
  254. struct bw_fixed hsr_after_stereo;
  255. struct bw_fixed vsr_after_stereo;
  256. struct bw_fixed source_width_in_lb;
  257. struct bw_fixed lb_line_pitch;
  258. struct bw_fixed underlay_maximum_source_efficient_for_tiling;
  259. struct bw_fixed num_lines_at_frame_start;
  260. struct bw_fixed min_dmif_size_in_time;
  261. struct bw_fixed min_mcifwr_size_in_time;
  262. struct bw_fixed total_requests_for_dmif_size;
  263. struct bw_fixed peak_pte_request_to_eviction_ratio_limiting;
  264. struct bw_fixed useful_pte_per_pte_request;
  265. struct bw_fixed scatter_gather_pte_request_rows;
  266. struct bw_fixed scatter_gather_row_height;
  267. struct bw_fixed scatter_gather_pte_requests_in_vblank;
  268. struct bw_fixed inefficient_linear_pitch_in_bytes;
  269. struct bw_fixed cursor_total_data;
  270. struct bw_fixed cursor_total_request_groups;
  271. struct bw_fixed scatter_gather_total_pte_requests;
  272. struct bw_fixed scatter_gather_total_pte_request_groups;
  273. struct bw_fixed tile_width_in_pixels;
  274. struct bw_fixed dmif_total_number_of_data_request_page_close_open;
  275. struct bw_fixed mcifwr_total_number_of_data_request_page_close_open;
  276. struct bw_fixed bytes_per_page_close_open;
  277. struct bw_fixed mcifwr_total_page_close_open_time;
  278. struct bw_fixed total_requests_for_adjusted_dmif_size;
  279. struct bw_fixed total_dmifmc_urgent_trips;
  280. struct bw_fixed total_dmifmc_urgent_latency;
  281. struct bw_fixed total_display_reads_required_data;
  282. struct bw_fixed total_display_reads_required_dram_access_data;
  283. struct bw_fixed total_display_writes_required_data;
  284. struct bw_fixed total_display_writes_required_dram_access_data;
  285. struct bw_fixed display_reads_required_data;
  286. struct bw_fixed display_reads_required_dram_access_data;
  287. struct bw_fixed dmif_total_page_close_open_time;
  288. struct bw_fixed min_cursor_memory_interface_buffer_size_in_time;
  289. struct bw_fixed min_read_buffer_size_in_time;
  290. struct bw_fixed display_reads_time_for_data_transfer;
  291. struct bw_fixed display_writes_time_for_data_transfer;
  292. struct bw_fixed dmif_required_dram_bandwidth;
  293. struct bw_fixed mcifwr_required_dram_bandwidth;
  294. struct bw_fixed required_dmifmc_urgent_latency_for_page_close_open;
  295. struct bw_fixed required_mcifmcwr_urgent_latency;
  296. struct bw_fixed required_dram_bandwidth_gbyte_per_second;
  297. struct bw_fixed dram_bandwidth;
  298. struct bw_fixed dmif_required_sclk;
  299. struct bw_fixed mcifwr_required_sclk;
  300. struct bw_fixed required_sclk;
  301. struct bw_fixed downspread_factor;
  302. struct bw_fixed v_scaler_efficiency;
  303. struct bw_fixed scaler_limits_factor;
  304. struct bw_fixed display_pipe_pixel_throughput;
  305. struct bw_fixed total_dispclk_required_with_ramping;
  306. struct bw_fixed total_dispclk_required_without_ramping;
  307. struct bw_fixed total_read_request_bandwidth;
  308. struct bw_fixed total_write_request_bandwidth;
  309. struct bw_fixed dispclk_required_for_total_read_request_bandwidth;
  310. struct bw_fixed total_dispclk_required_with_ramping_with_request_bandwidth;
  311. struct bw_fixed total_dispclk_required_without_ramping_with_request_bandwidth;
  312. struct bw_fixed dispclk;
  313. struct bw_fixed blackout_recovery_time;
  314. struct bw_fixed min_pixels_per_data_fifo_entry;
  315. struct bw_fixed sclk_deep_sleep;
  316. struct bw_fixed chunk_request_time;
  317. struct bw_fixed cursor_request_time;
  318. struct bw_fixed line_source_pixels_transfer_time;
  319. struct bw_fixed dmifdram_access_efficiency;
  320. struct bw_fixed mcifwrdram_access_efficiency;
  321. struct bw_fixed total_average_bandwidth_no_compression;
  322. struct bw_fixed total_average_bandwidth;
  323. struct bw_fixed total_stutter_cycle_duration;
  324. struct bw_fixed stutter_burst_time;
  325. struct bw_fixed time_in_self_refresh;
  326. struct bw_fixed stutter_efficiency;
  327. struct bw_fixed worst_number_of_trips_to_memory;
  328. struct bw_fixed immediate_flip_time;
  329. struct bw_fixed latency_for_non_dmif_clients;
  330. struct bw_fixed latency_for_non_mcifwr_clients;
  331. struct bw_fixed dmifmc_urgent_latency_supported_in_high_sclk_and_yclk;
  332. struct bw_fixed nbp_state_dram_speed_change_margin;
  333. struct bw_fixed display_reads_time_for_data_transfer_and_urgent_latency;
  334. struct bw_fixed dram_speed_change_margin;
  335. struct bw_fixed min_vblank_dram_speed_change_margin;
  336. struct bw_fixed min_stutter_refresh_duration;
  337. uint32_t total_stutter_dmif_buffer_size;
  338. uint32_t total_bytes_requested;
  339. uint32_t min_stutter_dmif_buffer_size;
  340. uint32_t num_stutter_bursts;
  341. struct bw_fixed v_blank_nbp_state_dram_speed_change_latency_supported;
  342. struct bw_fixed nbp_state_dram_speed_change_latency_supported;
  343. bool fbc_en[maximum_number_of_surfaces];
  344. bool lpt_en[maximum_number_of_surfaces];
  345. bool displays_match_flag[maximum_number_of_surfaces];
  346. bool use_alpha[maximum_number_of_surfaces];
  347. bool orthogonal_rotation[maximum_number_of_surfaces];
  348. bool enable[maximum_number_of_surfaces];
  349. bool access_one_channel_only[maximum_number_of_surfaces];
  350. bool scatter_gather_enable_for_pipe[maximum_number_of_surfaces];
  351. bool interlace_mode[maximum_number_of_surfaces];
  352. bool display_pstate_change_enable[maximum_number_of_surfaces];
  353. bool line_buffer_prefetch[maximum_number_of_surfaces];
  354. uint32_t bytes_per_pixel[maximum_number_of_surfaces];
  355. uint32_t max_chunks_non_fbc_mode[maximum_number_of_surfaces];
  356. uint32_t lb_bpc[maximum_number_of_surfaces];
  357. uint32_t output_bpphdmi[maximum_number_of_surfaces];
  358. uint32_t output_bppdp4_lane_hbr[maximum_number_of_surfaces];
  359. uint32_t output_bppdp4_lane_hbr2[maximum_number_of_surfaces];
  360. uint32_t output_bppdp4_lane_hbr3[maximum_number_of_surfaces];
  361. enum bw_defines stereo_mode[maximum_number_of_surfaces];
  362. struct bw_fixed dmif_buffer_transfer_time[maximum_number_of_surfaces];
  363. struct bw_fixed displays_with_same_mode[maximum_number_of_surfaces];
  364. struct bw_fixed stutter_dmif_buffer_size[maximum_number_of_surfaces];
  365. struct bw_fixed stutter_refresh_duration[maximum_number_of_surfaces];
  366. struct bw_fixed stutter_exit_watermark[maximum_number_of_surfaces];
  367. struct bw_fixed stutter_entry_watermark[maximum_number_of_surfaces];
  368. struct bw_fixed h_total[maximum_number_of_surfaces];
  369. struct bw_fixed v_total[maximum_number_of_surfaces];
  370. struct bw_fixed pixel_rate[maximum_number_of_surfaces];
  371. struct bw_fixed src_width[maximum_number_of_surfaces];
  372. struct bw_fixed pitch_in_pixels[maximum_number_of_surfaces];
  373. struct bw_fixed pitch_in_pixels_after_surface_type[maximum_number_of_surfaces];
  374. struct bw_fixed src_height[maximum_number_of_surfaces];
  375. struct bw_fixed scale_ratio[maximum_number_of_surfaces];
  376. struct bw_fixed h_taps[maximum_number_of_surfaces];
  377. struct bw_fixed v_taps[maximum_number_of_surfaces];
  378. struct bw_fixed h_scale_ratio[maximum_number_of_surfaces];
  379. struct bw_fixed v_scale_ratio[maximum_number_of_surfaces];
  380. struct bw_fixed rotation_angle[maximum_number_of_surfaces];
  381. struct bw_fixed compression_rate[maximum_number_of_surfaces];
  382. struct bw_fixed hsr[maximum_number_of_surfaces];
  383. struct bw_fixed vsr[maximum_number_of_surfaces];
  384. struct bw_fixed source_width_rounded_up_to_chunks[maximum_number_of_surfaces];
  385. struct bw_fixed source_width_pixels[maximum_number_of_surfaces];
  386. struct bw_fixed source_height_rounded_up_to_chunks[maximum_number_of_surfaces];
  387. struct bw_fixed display_bandwidth[maximum_number_of_surfaces];
  388. struct bw_fixed request_bandwidth[maximum_number_of_surfaces];
  389. struct bw_fixed bytes_per_request[maximum_number_of_surfaces];
  390. struct bw_fixed useful_bytes_per_request[maximum_number_of_surfaces];
  391. struct bw_fixed lines_interleaved_in_mem_access[maximum_number_of_surfaces];
  392. struct bw_fixed latency_hiding_lines[maximum_number_of_surfaces];
  393. struct bw_fixed lb_partitions[maximum_number_of_surfaces];
  394. struct bw_fixed lb_partitions_max[maximum_number_of_surfaces];
  395. struct bw_fixed dispclk_required_with_ramping[maximum_number_of_surfaces];
  396. struct bw_fixed dispclk_required_without_ramping[maximum_number_of_surfaces];
  397. struct bw_fixed data_buffer_size[maximum_number_of_surfaces];
  398. struct bw_fixed outstanding_chunk_request_limit[maximum_number_of_surfaces];
  399. struct bw_fixed urgent_watermark[maximum_number_of_surfaces];
  400. struct bw_fixed nbp_state_change_watermark[maximum_number_of_surfaces];
  401. struct bw_fixed v_filter_init[maximum_number_of_surfaces];
  402. struct bw_fixed stutter_cycle_duration[maximum_number_of_surfaces];
  403. struct bw_fixed average_bandwidth[maximum_number_of_surfaces];
  404. struct bw_fixed average_bandwidth_no_compression[maximum_number_of_surfaces];
  405. struct bw_fixed scatter_gather_pte_request_limit[maximum_number_of_surfaces];
  406. struct bw_fixed lb_size_per_component[maximum_number_of_surfaces];
  407. struct bw_fixed memory_chunk_size_in_bytes[maximum_number_of_surfaces];
  408. struct bw_fixed pipe_chunk_size_in_bytes[maximum_number_of_surfaces];
  409. struct bw_fixed number_of_trips_to_memory_for_getting_apte_row[maximum_number_of_surfaces];
  410. struct bw_fixed adjusted_data_buffer_size[maximum_number_of_surfaces];
  411. struct bw_fixed adjusted_data_buffer_size_in_memory[maximum_number_of_surfaces];
  412. struct bw_fixed pixels_per_data_fifo_entry[maximum_number_of_surfaces];
  413. struct bw_fixed scatter_gather_pte_requests_in_row[maximum_number_of_surfaces];
  414. struct bw_fixed pte_request_per_chunk[maximum_number_of_surfaces];
  415. struct bw_fixed scatter_gather_page_width[maximum_number_of_surfaces];
  416. struct bw_fixed scatter_gather_page_height[maximum_number_of_surfaces];
  417. struct bw_fixed lb_lines_in_per_line_out_in_beginning_of_frame[maximum_number_of_surfaces];
  418. struct bw_fixed lb_lines_in_per_line_out_in_middle_of_frame[maximum_number_of_surfaces];
  419. struct bw_fixed cursor_width_pixels[maximum_number_of_surfaces];
  420. struct bw_fixed minimum_latency_hiding[maximum_number_of_surfaces];
  421. struct bw_fixed maximum_latency_hiding[maximum_number_of_surfaces];
  422. struct bw_fixed minimum_latency_hiding_with_cursor[maximum_number_of_surfaces];
  423. struct bw_fixed maximum_latency_hiding_with_cursor[maximum_number_of_surfaces];
  424. struct bw_fixed src_pixels_for_first_output_pixel[maximum_number_of_surfaces];
  425. struct bw_fixed src_pixels_for_last_output_pixel[maximum_number_of_surfaces];
  426. struct bw_fixed src_data_for_first_output_pixel[maximum_number_of_surfaces];
  427. struct bw_fixed src_data_for_last_output_pixel[maximum_number_of_surfaces];
  428. struct bw_fixed active_time[maximum_number_of_surfaces];
  429. struct bw_fixed horizontal_blank_and_chunk_granularity_factor[maximum_number_of_surfaces];
  430. struct bw_fixed cursor_latency_hiding[maximum_number_of_surfaces];
  431. struct bw_fixed v_blank_dram_speed_change_margin[maximum_number_of_surfaces];
  432. uint32_t num_displays_with_margin[3][8];
  433. struct bw_fixed dmif_burst_time[3][8];
  434. struct bw_fixed mcifwr_burst_time[3][8];
  435. struct bw_fixed line_source_transfer_time[maximum_number_of_surfaces][3][8];
  436. struct bw_fixed dram_speed_change_line_source_transfer_time[maximum_number_of_surfaces][3][8];
  437. struct bw_fixed min_dram_speed_change_margin[3][8];
  438. struct bw_fixed dispclk_required_for_dram_speed_change[3][8];
  439. struct bw_fixed dispclk_required_for_dram_speed_change_pipe[3][8];
  440. struct bw_fixed blackout_duration_margin[3][8];
  441. struct bw_fixed dispclk_required_for_blackout_duration[3][8];
  442. struct bw_fixed dispclk_required_for_blackout_recovery[3][8];
  443. struct bw_fixed dmif_required_sclk_for_urgent_latency[6];
  444. };
  445. /**
  446. * Initialize structures with data which will NOT change at runtime.
  447. */
  448. void bw_calcs_init(
  449. struct bw_calcs_dceip *bw_dceip,
  450. struct bw_calcs_vbios *bw_vbios,
  451. struct hw_asic_id asic_id);
  452. /**
  453. * Return:
  454. * true - Display(s) configuration supported.
  455. * In this case 'calcs_output' contains data for HW programming
  456. * false - Display(s) configuration not supported (not enough bandwidth).
  457. */
  458. bool bw_calcs(
  459. struct dc_context *ctx,
  460. const struct bw_calcs_dceip *dceip,
  461. const struct bw_calcs_vbios *vbios,
  462. const struct pipe_ctx *pipe,
  463. int pipe_count,
  464. struct dce_bw_output *calcs_output);
  465. #endif /* __BANDWIDTH_CALCS_H__ */