<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">Series is:</p>
<p style="margin-top:0;margin-bottom:0">Reviewed-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 Rex Zhu <Rex.Zhu@amd.com><br>
<b>Sent:</b> Tuesday, September 18, 2018 9:11:13 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH 1/2] drm/amd/pp: Honour DC's clock limits on Rv</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Honour display's request for min engine clock/memory clock.<br>
<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 25 +++++++++++++++--------<br>
1 file changed, 17 insertions(+), 8 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
index 9808bd4..5d1dae2 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c<br>
@@ -552,6 +552,8 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
{<br>
struct smu10_hwmgr *data = hwmgr->backend;<br>
struct amdgpu_device *adev = hwmgr->adev;<br>
+ uint32_t min_sclk = hwmgr->display_config->min_core_set_clock;<br>
+ uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;<br>
<br>
if (hwmgr->smu_version < 0x1E3700) {<br>
pr_info("smu firmware version too old, can not set dpm level\n");<br>
@@ -563,6 +565,13 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
(adev->rev_id >= 8))<br>
return 0;<br>
<br>
+ if (min_sclk < data->gfx_min_freq_limit)<br>
+ min_sclk = data->gfx_min_freq_limit;<br>
+<br>
+ min_sclk /= 100; /* transfer 10KHz to MHz */<br>
+ if (min_mclk < data->clock_table.FClocks[0].Freq)<br>
+ min_mclk = data->clock_table.FClocks[0].Freq;<br>
+<br>
switch (level) {<br>
case AMD_DPM_FORCED_LEVEL_HIGH:<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_PEAK:<br>
@@ -595,18 +604,18 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinGfxClk,<br>
- data->gfx_min_freq_limit/100);<br>
+ min_sclk);<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetSoftMaxGfxClk,<br>
- data->gfx_min_freq_limit/100);<br>
+ min_sclk);<br>
break;<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK:<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinFclkByFreq,<br>
- SMU10_UMD_PSTATE_MIN_FCLK);<br>
+ min_mclk);<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetSoftMaxFclkByFreq,<br>
- SMU10_UMD_PSTATE_MIN_FCLK);<br>
+ min_mclk);<br>
break;<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
@@ -638,12 +647,12 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
case AMD_DPM_FORCED_LEVEL_AUTO:<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinGfxClk,<br>
- data->gfx_min_freq_limit/100);<br>
+ min_sclk);<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinFclkByFreq,<br>
hwmgr->display_config->num_display > 3 ?<br>
SMU10_UMD_PSTATE_PEAK_FCLK :<br>
- SMU10_UMD_PSTATE_MIN_FCLK);<br>
+ min_mclk);<br>
<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinSocclkByFreq,<br>
@@ -674,10 +683,10 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
data->gfx_min_freq_limit/100);<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetHardMinFclkByFreq,<br>
- SMU10_UMD_PSTATE_MIN_FCLK);<br>
+ min_mclk);<br>
smum_send_msg_to_smc_with_parameter(hwmgr,<br>
PPSMC_MSG_SetSoftMaxFclkByFreq,<br>
- SMU10_UMD_PSTATE_MIN_FCLK);<br>
+ min_mclk);<br>
break;<br>
case AMD_DPM_FORCED_LEVEL_MANUAL:<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:<br>
-- <br>
1.9.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>