<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
Hi Eric,<br>
<br>
We have sysfs pp-dpm-sclk/mclk to set min dpm level<br>
<br>
Best Regards<br>
Rex
<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 Eric Huang <jinhuieric.huang@amd.com><br>
<b>Sent:</b> Thursday, January 25, 2018 12:04:55 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 4/4] drm/amd/pp: Implement set_power_profile_mode on smu7</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">We have min_sclk and min_mclk in previous power profile parameters for
<br>
VI, which are similar with min_active_level for Vega10. How to implement <br>
these parameters?<br>
<br>
Regards,<br>
Eric<br>
<br>
On 2018-01-24 04:37 AM, Rex Zhu wrote:<br>
> User can set smu7 profile pamameters through sysfs<br>
><br>
> echo "0/1/2/3/4">pp_power_profile_mode<br>
> to select 3D_FULL_SCREEN/POWER_SAVING/VIDEO/VR/COMPUTE<br>
> mode.<br>
> echo "5 * * * * * * * *">pp_power_profile_mode<br>
> to config custom mode.<br>
> "5 * * * * * * * *" mean "CUSTOM enable_sclk SCLK_UP_HYST<br>
> SCLK_DOWN_HYST SCLK_ACTIVE_LEVEL enable_mclk MCLK_UP_HYST<br>
> MCLK_DOWN_HYST MCLK_ACTIVE_LEVEL"<br>
><br>
> Change-Id: Ic6d6f37363bc81ab17051285f6ace847edf725de<br>
> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
> ---<br>
>   drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 49 +++++++++++++++++++++++-<br>
>   1 file changed, 48 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 9f6afd5..13db75c 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> @@ -5036,7 +5036,54 @@ static int smu7_get_power_profile_mode(struct pp_hwmgr *hwmgr, char *buf)<br>
>   <br>
>   static int smu7_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint32_t size)<br>
>   {<br>
> -     /* To Do */<br>
> +     struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
> +     struct profile_mode_setting tmp;<br>
> +<br>
> +     hwmgr->power_profile_mode = input[size];<br>
> +<br>
> +     switch (hwmgr->power_profile_mode) {<br>
> +     case PP_SMC_POWER_PROFILE_CUSTOM:<br>
> +             if (size < 8)<br>
> +                     return -EINVAL;<br>
> +<br>
> +             data->custom_profile_setting.bupdate_sclk = input[0];<br>
> +             data->custom_profile_setting.sclk_up_hyst = input[1];<br>
> +             data->custom_profile_setting.sclk_down_hyst = input[2];<br>
> +             data->custom_profile_setting.sclk_activity =  input[3];<br>
> +             data->custom_profile_setting.bupdate_mclk = input[4];<br>
> +             data->custom_profile_setting.mclk_up_hyst = input[5];<br>
> +             data->custom_profile_setting.mclk_down_hyst = input[6];<br>
> +             data->custom_profile_setting.mclk_activity =  input[7];<br>
> +             if (!smum_update_dpm_settings(hwmgr, &data->custom_profile_setting))<br>
> +                     memcpy(&data->current_profile_setting, &data->custom_profile_setting, sizeof(struct profile_mode_setting));<br>
> +             break;<br>
> +     case PP_SMC_POWER_PROFILE_FULLSCREEN3D:<br>
> +     case PP_SMC_POWER_PROFILE_POWERSAVING:<br>
> +     case PP_SMC_POWER_PROFILE_VIDEO:<br>
> +     case PP_SMC_POWER_PROFILE_VR:<br>
> +     case PP_SMC_POWER_PROFILE_COMPUTE:<br>
> +             memcpy(&tmp, &smu7_profiling[hwmgr->power_profile_mode], sizeof(struct profile_mode_setting));<br>
> +             if (!smum_update_dpm_settings(hwmgr, &tmp)) {<br>
> +                     if (tmp.bupdate_sclk) {<br>
> +                             data->current_profile_setting.bupdate_sclk = tmp.bupdate_sclk;<br>
> +                             data->current_profile_setting.sclk_up_hyst = tmp.sclk_up_hyst;<br>
> +                             data->current_profile_setting.sclk_down_hyst = tmp.sclk_down_hyst;<br>
> +                             data->current_profile_setting.sclk_activity = tmp.sclk_activity;<br>
> +                     }<br>
> +                     if (tmp.bupdate_mclk) {<br>
> +                             data->current_profile_setting.bupdate_mclk = tmp.bupdate_mclk;<br>
> +                             data->current_profile_setting.mclk_up_hyst = tmp.mclk_up_hyst;<br>
> +                             data->current_profile_setting.mclk_down_hyst = tmp.mclk_down_hyst;<br>
> +                             data->current_profile_setting.mclk_activity = tmp.mclk_activity;<br>
> +                     }<br>
> +             }<br>
> +             break;<br>
> +     case PP_SMC_POWER_PROFILE_AUTO: /* TO DO auto wattman feature not implement */<br>
> +             return 0;<br>
> +     default:<br>
> +             return -EINVAL;<br>
> +     }<br>
> +<br>
>        return 0;<br>
>   }<br>
>   <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>