<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">Patch is<span> Reviewed-by: <span>Rex Zhu <Rex.Zhu@amd.com></span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Thanks.</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Best Regards</span></p>
<p style="margin-top:0;margin-bottom:0"><span>Rex</span><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 Alex Deucher <alexdeucher@gmail.com><br>
<b>Sent:</b> Friday, August 10, 2018 4:16:23 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Deucher, Alexander<br>
<b>Subject:</b> [PATCH] drm/amdgpu/powerplay: check vrefresh when when changing displays</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Compare the current vrefresh in addition to the number of displays<br>
when determining whether or not the smu needs updates when changing<br>
modes. The SMU needs to be updated if the vbi timeout changes due<br>
to a different refresh rate. Fixes flickering around mode changes<br>
in some cases on polaris parts.<br>
<br>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 +++<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 3 ++-<br>
drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 1 +<br>
drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c | 1 +<br>
8 files changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
index 380f282a64ba..ab759e38e4ea 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
@@ -4132,6 +4132,9 @@ smu7_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)<br>
if (data->display_timing.num_existing_displays != hwmgr->display_config->num_display)<br>
is_update_required = true;<br>
<br>
+ if (data->display_timing.vrefresh != hwmgr->display_config->vrefresh)<br>
+ is_update_required = true;<br>
+<br>
if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_SclkDeepSleep)) {<br>
if (data->display_timing.min_clock_in_sr != hwmgr->display_config->min_core_set_clock_in_sr &&<br>
(data->display_timing.min_clock_in_sr >= SMU7_MINIMUM_ENGINE_CLOCK ||<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
index 3784ce6e50ab..69d361f8dfca 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.h<br>
@@ -156,6 +156,7 @@ struct smu7_vbios_boot_state {<br>
struct smu7_display_timing {<br>
uint32_t min_clock_in_sr;<br>
uint32_t num_existing_displays;<br>
+ uint32_t vrefresh;<br>
};<br>
<br>
struct smu7_dpmlevel_enable_mask {<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
index fbe3ef4ee45c..18643e06bc6f 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
@@ -1231,6 +1231,7 @@ static int ci_populate_single_memory_level(<br>
memory_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;<br>
<br>
data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
/* stutter mode not support on ci */<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
index 18048f8e2f13..ec14798e87b6 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
@@ -1210,7 +1210,8 @@ static int fiji_populate_single_memory_level(struct pp_hwmgr *hwmgr,<br>
* PECI_GetNumberOfActiveDisplays(hwmgr->pPECI,<br>
* &(data->DisplayTiming.numExistingDisplays));<br>
*/<br>
- data->display_timing.num_existing_displays = 1;<br>
+ data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
if (mclk_stutter_mode_threshold &&<br>
(clock <= mclk_stutter_mode_threshold) &&<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
index 9299b93aa09a..73aa368a454e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/iceland_smumgr.c<br>
@@ -1280,6 +1280,7 @@ static int iceland_populate_single_memory_level(<br>
memory_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;<br>
<br>
data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
/* stutter mode not support on iceland */<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
index 1276f168ff68..872d3824337b 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
@@ -1103,6 +1103,7 @@ static int polaris10_populate_single_memory_level(struct pp_hwmgr *hwmgr,<br>
mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;<br>
<br>
data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
if (mclk_stutter_mode_threshold &&<br>
(clock <= mclk_stutter_mode_threshold) &&<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
index 7dabc6c456e1..ae8378ed32ee 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
@@ -1004,6 +1004,7 @@ static int tonga_populate_single_memory_level(<br>
memory_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;<br>
<br>
data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
if ((mclk_stutter_mode_threshold != 0) &&<br>
(memory_clock <= mclk_stutter_mode_threshold) &&<br>
diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
index 57420d7caa4e..3d415fabbd93 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/smumgr/vegam_smumgr.c<br>
@@ -1009,6 +1009,7 @@ static int vegam_populate_single_memory_level(struct pp_hwmgr *hwmgr,<br>
mem_level->DisplayWatermark = PPSMC_DISPLAY_WATERMARK_LOW;<br>
<br>
data->display_timing.num_existing_displays = hwmgr->display_config->num_display;<br>
+ data->display_timing.vrefresh = hwmgr->display_config->vrefresh;<br>
<br>
if (mclk_stutter_mode_threshold &&<br>
(clock <= mclk_stutter_mode_threshold) &&<br>
-- <br>
2.13.6<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>