<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Harry Wentland <harry.wentland@amd.com><br>
<b>Sent:</b> Thursday, March 22, 2018 2:39:57 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Laktyushkin, Dmytro; Wentland, Harry<br>
<b>Subject:</b> [PATCH v2] drm/amd/display: fix Polaris 12 bw bounding box</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">From: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com><br>
<br>
Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com><br>
Signed-off-by: Harry Wentland <harry.wentland@amd.com><br>
Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com><br>
Acked-by: Harry Wentland <harry.wentland@amd.com><br>
---<br>
 drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 121 ++++++++++++++++++++++-<br>
 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h   |   1 +<br>
 2 files changed, 120 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c<br>
index 0cbab81ab304..821502b1acba 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c<br>
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c<br>
@@ -52,10 +52,11 @@ static enum bw_calcs_version bw_calcs_version_from_asic_id(struct hw_asic_id asi<br>
                 return BW_CALCS_VERSION_CARRIZO;<br>
 <br>
         case FAMILY_VI:<br>
+               if (ASIC_REV_IS_POLARIS12_V(asic_id.hw_internal_rev))<br>
+                       return BW_CALCS_VERSION_POLARIS12;<br>
                 if (ASIC_REV_IS_POLARIS10_P(asic_id.hw_internal_rev))<br>
                         return BW_CALCS_VERSION_POLARIS10;<br>
-               if (ASIC_REV_IS_POLARIS11_M(asic_id.hw_internal_rev) ||<br>
-                               ASIC_REV_IS_POLARIS12_V(asic_id.hw_internal_rev))<br>
+               if (ASIC_REV_IS_POLARIS11_M(asic_id.hw_internal_rev))<br>
                         return BW_CALCS_VERSION_POLARIS11;<br>
                 return BW_CALCS_VERSION_INVALID;<br>
 <br>
@@ -2373,6 +2374,122 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,<br>
                 dceip.scatter_gather_pte_request_rows_in_tiling_mode = 2;<br>
                 dceip.mcifwr_all_surfaces_burst_time = bw_int_to_fixed(0);<br>
                 break;<br>
+       case BW_CALCS_VERSION_POLARIS12:<br>
+               vbios.memory_type = bw_def_gddr5;<br>
+               vbios.dram_channel_width_in_bits = 32;<br>
+               vbios.number_of_dram_channels = asic_id.vram_width / vbios.dram_channel_width_in_bits;<br>
+               vbios.number_of_dram_banks = 8;<br>
+               vbios.high_yclk = bw_int_to_fixed(6000);<br>
+               vbios.mid_yclk = bw_int_to_fixed(3200);<br>
+               vbios.low_yclk = bw_int_to_fixed(1000);<br>
+               vbios.low_sclk = bw_int_to_fixed(678);<br>
+               vbios.mid1_sclk = bw_int_to_fixed(864);<br>
+               vbios.mid2_sclk = bw_int_to_fixed(900);<br>
+               vbios.mid3_sclk = bw_int_to_fixed(920);<br>
+               vbios.mid4_sclk = bw_int_to_fixed(940);<br>
+               vbios.mid5_sclk = bw_int_to_fixed(960);<br>
+               vbios.mid6_sclk = bw_int_to_fixed(980);<br>
+               vbios.high_sclk = bw_int_to_fixed(1049);<br>
+               vbios.low_voltage_max_dispclk = bw_int_to_fixed(459);<br>
+               vbios.mid_voltage_max_dispclk = bw_int_to_fixed(654);<br>
+               vbios.high_voltage_max_dispclk = bw_int_to_fixed(1108);<br>
+               vbios.low_voltage_max_phyclk = bw_int_to_fixed(540);<br>
+               vbios.mid_voltage_max_phyclk = bw_int_to_fixed(810);<br>
+               vbios.high_voltage_max_phyclk = bw_int_to_fixed(810);<br>
+               vbios.data_return_bus_width = bw_int_to_fixed(32);<br>
+               vbios.trc = bw_int_to_fixed(48);<br>
+               if (vbios.number_of_dram_channels == 2) // 64-bit<br>
+                       vbios.dmifmc_urgent_latency = bw_int_to_fixed(4);<br>
+               else<br>
+                       vbios.dmifmc_urgent_latency = bw_int_to_fixed(3);<br>
+               vbios.stutter_self_refresh_exit_latency = bw_int_to_fixed(5);<br>
+               vbios.stutter_self_refresh_entry_latency = bw_int_to_fixed(0);<br>
+               vbios.nbp_state_change_latency = bw_int_to_fixed(250);<br>
+               vbios.mcifwrmc_urgent_latency = bw_int_to_fixed(10);<br>
+               vbios.scatter_gather_enable = false;<br>
+               vbios.down_spread_percentage = bw_frc_to_fixed(5, 10);<br>
+               vbios.cursor_width = 32;<br>
+               vbios.average_compression_rate = 4;<br>
+               vbios.number_of_request_slots_gmc_reserves_for_dmif_per_channel = 256;<br>
+               vbios.blackout_duration = bw_int_to_fixed(0); /* us */<br>
+               vbios.maximum_blackout_recovery_time = bw_int_to_fixed(0);<br>
+<br>
+               dceip.max_average_percent_of_ideal_port_bw_display_can_use_in_normal_system_operation = 100;<br>
+               dceip.max_average_percent_of_ideal_drambw_display_can_use_in_normal_system_operation = 100;<br>
+               dceip.percent_of_ideal_port_bw_received_after_urgent_latency = 100;<br>
+               dceip.large_cursor = false;<br>
+               dceip.dmif_request_buffer_size = bw_int_to_fixed(768);<br>
+               dceip.dmif_pipe_en_fbc_chunk_tracker = false;<br>
+               dceip.cursor_max_outstanding_group_num = 1;<br>
+               dceip.lines_interleaved_into_lb = 2;<br>
+               dceip.chunk_width = 256;<br>
+               dceip.number_of_graphics_pipes = 5;<br>
+               dceip.number_of_underlay_pipes = 0;<br>
+               dceip.low_power_tiling_mode = 0;<br>
+               dceip.display_write_back_supported = true;<br>
+               dceip.argb_compression_support = true;<br>
+               dceip.underlay_vscaler_efficiency6_bit_per_component =<br>
+                       bw_frc_to_fixed(35556, 10000);<br>
+               dceip.underlay_vscaler_efficiency8_bit_per_component =<br>
+                       bw_frc_to_fixed(34286, 10000);<br>
+               dceip.underlay_vscaler_efficiency10_bit_per_component =<br>
+                       bw_frc_to_fixed(32, 10);<br>
+               dceip.underlay_vscaler_efficiency12_bit_per_component =<br>
+                       bw_int_to_fixed(3);<br>
+               dceip.graphics_vscaler_efficiency6_bit_per_component =<br>
+                       bw_frc_to_fixed(35, 10);<br>
+               dceip.graphics_vscaler_efficiency8_bit_per_component =<br>
+                       bw_frc_to_fixed(34286, 10000);<br>
+               dceip.graphics_vscaler_efficiency10_bit_per_component =<br>
+                       bw_frc_to_fixed(32, 10);<br>
+               dceip.graphics_vscaler_efficiency12_bit_per_component =<br>
+                       bw_int_to_fixed(3);<br>
+               dceip.alpha_vscaler_efficiency = bw_int_to_fixed(3);<br>
+               dceip.max_dmif_buffer_allocated = 4;<br>
+               dceip.graphics_dmif_size = 12288;<br>
+               dceip.underlay_luma_dmif_size = 19456;<br>
+               dceip.underlay_chroma_dmif_size = 23552;<br>
+               dceip.pre_downscaler_enabled = true;<br>
+               dceip.underlay_downscale_prefetch_enabled = true;<br>
+               dceip.lb_write_pixels_per_dispclk = bw_int_to_fixed(1);<br>
+               dceip.lb_size_per_component444 = bw_int_to_fixed(245952);<br>
+               dceip.graphics_lb_nodownscaling_multi_line_prefetching = true;<br>
+               dceip.stutter_and_dram_clock_state_change_gated_before_cursor =<br>
+                       bw_int_to_fixed(1);<br>
+               dceip.underlay420_luma_lb_size_per_component = bw_int_to_fixed(<br>
+                       82176);<br>
+               dceip.underlay420_chroma_lb_size_per_component =<br>
+                       bw_int_to_fixed(164352);<br>
+               dceip.underlay422_lb_size_per_component = bw_int_to_fixed(<br>
+                       82176);<br>
+               dceip.cursor_chunk_width = bw_int_to_fixed(64);<br>
+               dceip.cursor_dcp_buffer_lines = bw_int_to_fixed(4);<br>
+               dceip.underlay_maximum_width_efficient_for_tiling =<br>
+                       bw_int_to_fixed(1920);<br>
+               dceip.underlay_maximum_height_efficient_for_tiling =<br>
+                       bw_int_to_fixed(1080);<br>
+               dceip.peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display =<br>
+                       bw_frc_to_fixed(3, 10);<br>
+               dceip.peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation =<br>
+                       bw_int_to_fixed(25);<br>
+               dceip.minimum_outstanding_pte_request_limit = bw_int_to_fixed(<br>
+                       2);<br>
+               dceip.maximum_total_outstanding_pte_requests_allowed_by_saw =<br>
+                       bw_int_to_fixed(128);<br>
+               dceip.limit_excessive_outstanding_dmif_requests = true;<br>
+               dceip.linear_mode_line_request_alternation_slice =<br>
+                       bw_int_to_fixed(64);<br>
+               dceip.scatter_gather_lines_of_pte_prefetching_in_linear_mode =<br>
+                       32;<br>
+               dceip.display_write_back420_luma_mcifwr_buffer_size = 12288;<br>
+               dceip.display_write_back420_chroma_mcifwr_buffer_size = 8192;<br>
+               dceip.request_efficiency = bw_frc_to_fixed(8, 10);<br>
+               dceip.dispclk_per_request = bw_int_to_fixed(2);<br>
+               dceip.dispclk_ramping_factor = bw_frc_to_fixed(105, 100);<br>
+               dceip.display_pipe_throughput_factor = bw_frc_to_fixed(105, 100);<br>
+               dceip.scatter_gather_pte_request_rows_in_tiling_mode = 2;<br>
+               dceip.mcifwr_all_surfaces_burst_time = bw_int_to_fixed(0);<br>
+               break;<br>
         case BW_CALCS_VERSION_STONEY:<br>
                 vbios.memory_type = bw_def_gddr5;<br>
                 vbios.dram_channel_width_in_bits = 64;<br>
diff --git a/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h b/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h<br>
index a9bfe9ff8ce6..0bd87f24fc06 100644<br>
--- a/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h<br>
+++ b/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h<br>
@@ -42,6 +42,7 @@ enum bw_calcs_version {<br>
         BW_CALCS_VERSION_CARRIZO,<br>
         BW_CALCS_VERSION_POLARIS10,<br>
         BW_CALCS_VERSION_POLARIS11,<br>
+       BW_CALCS_VERSION_POLARIS12,<br>
         BW_CALCS_VERSION_STONEY,<br>
         BW_CALCS_VERSION_VEGA10<br>
 };<br>
-- <br>
2.14.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>