<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" 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> Friday, February 2, 2018 4:17 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Zhu, Rex<br>
<b>Subject:</b> [PATCH] drm/amd/pp: Restore power profile mode in auto dpm level on Vega10</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">As auto power profile mode still not support on vega10, so<br>
just restore default profile mode in auto dpm level.<br>
<br>
Change-Id: I36359c1d11a48308bc9482f7aafe4c98767ac715<br>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
---<br>
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 10 +++++++---<br>
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 +<br>
2 files changed, 8 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
index dfaadab..9a9a24e 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
@@ -761,6 +761,7 @@ static int vega10_hwmgr_backend_init(struct pp_hwmgr *hwmgr)<br>
hwmgr->backend = data;<br>
<br>
hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;<br>
+ hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_VIDEO;<br>
<br>
vega10_set_default_registry_data(hwmgr);<br>
<br>
@@ -4228,6 +4229,11 @@ static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
break;<br>
case AMD_DPM_FORCED_LEVEL_AUTO:<br>
ret = vega10_unforce_dpm_levels(hwmgr);<br>
+ if (hwmgr->default_power_profile_mode != hwmgr->power_profile_mode) {<br>
+ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,<br>
+ 1 << hwmgr->default_power_profile_mode);<br>
+ hwmgr->power_profile_mode = hwmgr->default_power_profile_mode;<br>
+ }<br>
break;<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD:<br>
case AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK:<br>
@@ -4251,6 +4257,7 @@ static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,<br>
else if (level != AMD_DPM_FORCED_LEVEL_PROFILE_PEAK && hwmgr->dpm_level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)<br>
vega10_set_fan_control_mode(hwmgr, AMD_FAN_CTRL_AUTO);<br>
}<br>
+<br>
return ret;<br>
}<br>
<br>
@@ -5068,9 +5075,6 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui<br>
uint8_t use_rlc_busy;<br>
uint8_t min_active_level;<br>
<br>
- if (input[size] == PP_SMC_POWER_PROFILE_AUTO)<br>
- return 0; /* TO DO auto wattman feature not enabled */<br>
-<br>
hwmgr->power_profile_mode = input[size];<br>
<br>
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_SetWorkloadMask,<br>
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
index 376af67..231c9be 100644<br>
--- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
+++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
@@ -758,6 +758,7 @@ struct pp_hwmgr {<br>
enum amd_pp_profile_type current_power_profile;<br>
bool en_umd_pstate;<br>
uint32_t power_profile_mode;<br>
+ uint32_t default_power_profile_mode;<br>
uint32_t pstate_sclk;<br>
uint32_t pstate_mclk;<br>
bool od_enabled;<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" id="LPlnk661314" previewremoved="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>