<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Sorry for all of the questions, Evan. I see that we store the CUSTOM profile for Vega10/Fiji, but is that a limitation of the HW not being able to store it via the SMU? It seems like a lot of extra work to store a local copy, when we can
 just get the copy from the GPU itself, especially if we don’t need to do that on future ASICs. I would assume that the CUSTOM profile that is kept on the GPU is valid, but would it be simpler to just initialize the CUSTOM profile to the same values as the
 BOOTUP values when we initialize the ASIC, then submit that to the GPU, thus ensuring that the CUSTOM profile always has some valid values? Or conversely, zeroing out the CUSTOM profile on initialization, so that the check is still valid.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I have no problem doing the work, I just want to make sure that it makes the most sense and that we’re not having to redo it later if the SMU standardizes things and actually allows all future ASICs to store the CUSTOM profile on the GPU.
 Thanks!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kent<o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Quan, Evan <br>
<b>Sent:</b> Thursday, March 28, 2019 10:47 AM<br>
<b>To:</b> Russell, Kent <Kent.Russell@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> RE: [PATCH 1/2] drm/amdgpu: Allow switching to CUSTOM profile on Vega10/20 v2<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">OK, I see. Yep, the new settings will be stored in SMU.<o:p></o:p></p>
<p class="MsoNormal">But as I know, the SMU comes with some default settings for CUSTOM profile.
<o:p></o:p></p>
<p class="MsoNormal">I suspect “activity_monitor.Soc_BoosterFreqType != 0” will be also true even without your first CUSTOM profile settings(with input parameters).<o:p></o:p></p>
<p class="MsoNormal">So, I would prefer to have a local copy of previous custom settigns(as what we do on vega10 and smu7).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Evan<o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Russell, Kent <<a href="mailto:Kent.Russell@amd.com">Kent.Russell@amd.com</a>>
<br>
<b>Sent:</b> Thursday, March 28, 2019 5:29 PM<br>
<b>To:</b> Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amdgpu: Allow switching to CUSTOM profile on Vega10/20 v2<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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<o:p></o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Quan, Evan<br>
<b>Sent:</b> Wednesday, March 27, 2019 9:36:02 PM<br>
<b>To:</b> Russell, Kent; <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><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</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">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 <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> On Behalf Of<br>
> Russell, Kent<br>
> Sent: Wednesday, March 27, 2019 9:59 PM<br>
> To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> Cc: Russell, Kent <<a href="mailto:Kent.Russell@amd.com">Kent.Russell@amd.com</a>><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 <<a href="mailto:kent.russell@amd.com">kent.russell@amd.com</a>><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>
> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>