<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
Am I mistaken in thinking that activity monitor gets the existing CUSTOM profile from the SMU? When I tested it, the CUSTOM profile was saved and could be retrieved through this method. I specifically set the profile to something ridiculous (1 2 3 4 5 6 7 8
 9 10) and these values were retained when switching to VR and back to CUSTOM, so I was under the impression that it was saved to the SMU when we submit it to the SMU.<br>
<br>
Kent<br>
<br>
KENT RUSSELL<br>
Sr. Software Engineer | Linux Compute Kernel<br>
1 Commerce Valley Drive East<br>
Markham, ON L3T 7X6<br>
O +(1) 289-695-2122 | Ext 72122<br>
<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> Quan, Evan<br>
<b>Sent:</b> Wednesday, March 27, 2019 9:36:02 PM<br>
<b>To:</b> Russell, Kent; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Russell, Kent<br>
<b>Subject:</b> RE: [PATCH 1/2] drm/amdgpu: Allow switching to CUSTOM profile on Vega10/20 v2</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For vega20, activity_monitor is also a temporary structure and you should not rely on that for judging existence of custom profile.<br>
<br>
Regards<br>
Evan<br>
> -----Original Message-----<br>
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of<br>
> Russell, Kent<br>
> Sent: Wednesday, March 27, 2019 9:59 PM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Russell, Kent <Kent.Russell@amd.com><br>
> Subject: [PATCH 1/2] drm/amdgpu: Allow switching to CUSTOM profile on<br>
> Vega10/20 v2<br>
> <br>
> Don't return an error if the CUSTOM profile is selected, just apply it with the<br>
> values saved to the GPU<br>
> <br>
> v2: Remove reference to fixed bug, check that CUSTOM profile was set<br>
> <br>
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20<br>
> Signed-off-by: Kent Russell <kent.russell@amd.com><br>
> ---<br>
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 14<br>
> +++++++++++++-<br>
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 14<br>
> +++++++++++++-<br>
>  2 files changed, 26 insertions(+), 2 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> index 85a536924571..7e9e7e254a0d 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> @@ -4910,9 +4910,20 @@ static int vega10_set_power_profile_mode(struct<br>
> pp_hwmgr *hwmgr, long *input, ui<br>
>                                                1 << power_profile_mode);<br>
> <br>
>        if (power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {<br>
> -             if (size == 0 || size > 4)<br>
> +             if (size != 0 && size != 4)<br>
>                        return -EINVAL;<br>
> <br>
> +             /* If size = 0 and the CUSTOM profile has been set already<br>
> +              * (check BUSY_SET_POINT since that is always >0 for a valid<br>
> +              * profile) then just apply the profile.<br>
> +              */<br>
> +             if (size == 0) {<br>
> +                     if (data->custom_profile_mode[0] != 0)<br>
> +                             goto out;<br>
> +                     else<br>
> +                             return -EINVAL;<br>
> +             }<br>
> +<br>
>                data->custom_profile_mode[0] = busy_set_point = input[0];<br>
>                data->custom_profile_mode[1] = FPS = input[1];<br>
>                data->custom_profile_mode[2] = use_rlc_busy = input[2];<br>
> @@ -4923,6 +4934,7 @@ static int vega10_set_power_profile_mode(struct<br>
> pp_hwmgr *hwmgr, long *input, ui<br>
>                                        use_rlc_busy << 16 |<br>
> min_active_level<<24);<br>
>        }<br>
> <br>
> +out:<br>
>        hwmgr->power_profile_mode = power_profile_mode;<br>
> <br>
>        return 0;<br>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
> index 70dc641bf94d..6dc16a9e766b 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c<br>
> @@ -3843,7 +3843,7 @@ static int vega20_set_power_profile_mode(struct<br>
> pp_hwmgr *hwmgr, long *input, ui<br>
>        }<br>
> <br>
>        if (power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {<br>
> -             if (size < 10)<br>
> +             if (size < 10 && size != 0)<br>
>                        return -EINVAL;<br>
> <br>
>                result = vega20_get_activity_monitor_coeff(hwmgr,<br>
> @@ -3853,6 +3853,17 @@ static int vega20_set_power_profile_mode(struct<br>
> pp_hwmgr *hwmgr, long *input, ui<br>
>                                "[SetPowerProfile] Failed to get activity<br>
> monitor!",<br>
>                                return result);<br>
> <br>
> +             /* If size = 0 and the CUSTOM profile has been set already<br>
> +              * (check BoosterFreqType since that is always >0 for a valid<br>
> +              * profile) then just apply the profile.<br>
> +              */<br>
> +             if (size == 0) {<br>
> +                     if (activity_monitor.Soc_BoosterFreqType != 0)<br>
> +                             goto out;<br>
> +                     else<br>
> +                             return -EINVAL;<br>
> +             }<br>
> +<br>
>                switch (input[0]) {<br>
>                case 0: /* Gfxclk */<br>
>                        activity_monitor.Gfx_FPS = input[1]; @@ -3908,6<br>
> +3919,7 @@ static int vega20_set_power_profile_mode(struct pp_hwmgr<br>
> *hwmgr, long *input, ui<br>
>                                return result);<br>
>        }<br>
> <br>
> +out:<br>
>        /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */<br>
>        workload_type =<br>
> <br>
>        conv_power_profile_to_pplib_workload(power_profile_mode);<br>
> --<br>
> 2.17.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>