<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:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* 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.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
        {mso-style-name:x_msonormal;
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.xmsonormal0, li.xmsonormal0, div.xmsonormal0
        {mso-style-name:x_msonormal0;
        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;}
p.xmsochpdefault, li.xmsochpdefault, div.xmsochpdefault
        {mso-style-name:x_msochpdefault;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
span.xmsohyperlink
        {mso-style-name:x_msohyperlink;
        color:blue;
        text-decoration:underline;}
span.xmsohyperlinkfollowed
        {mso-style-name:x_msohyperlinkfollowed;
        color:purple;
        text-decoration:underline;}
span.xemailstyle18
        {mso-style-name:x_emailstyle18;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.xemailstyle20
        {mso-style-name:x_emailstyle20;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle27
        {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;}
/* List Definitions */
@list l0
        {mso-list-id:955671192;
        mso-list-type:hybrid;
        mso-list-template-ids:1930471800 -236696960 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:SimSun;
        mso-bidi-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></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">Alex is right. Vega10 can also track the CUSTOM profile internally actually.<o:p></o:p></p>
<p class="MsoNormal">>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?<o:p></o:p></p>
<p class="MsoNormal">To me, that sounds not so “CUSTOM”. It’s better to have these settings specified by user.<o:p></o:p></p>
<p class="MsoNormal">> Or conversely, zeroing out the CUSTOM profile on initialization, so that the check is still valid.<o:p></o:p></p>
<p class="MsoNormal">That should be fine. Or you can add a new flag(to indict whether there is already custom profile settings) in struct vega20_hwmgr and initialized as zero on bootup.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Evan<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> Deucher, Alexander <Alexander.Deucher@amd.com> <br>
<b>Sent:</b> Friday, March 29, 2019 10:29 PM<br>
<b>To:</b> Russell, Kent <Kent.Russell@amd.com>; Quan, Evan <Evan.Quan@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>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Only vega and newer have the concept of profiles in the SMU.  Vegas has a set of profiles that the SMU tracks directly.  SMU7 parts don't really have profiles per se; there just one "state" and
 the driver loads all the params into that state when you request a profile (custom or hardcoded).<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<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"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Russell, Kent <<a href="mailto:Kent.Russell@amd.com">Kent.Russell@amd.com</a>><br>
<b>Sent:</b> Friday, March 29, 2019 7:07 AM<br>
<b>To:</b> Quan, Evan; <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</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<p class="xmsonormal">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="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">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="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">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="xmsonormal"><b>From:</b> Quan, Evan <br>
<b>Sent:</b> Thursday, March 28, 2019 10:47 AM<br>
<b>To:</b> Russell, Kent <<a href="mailto:Kent.Russell@amd.com">Kent.Russell@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="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">OK, I see. Yep, the new settings will be stored in SMU.<o:p></o:p></p>
<p class="xmsonormal">But as I know, the SMU comes with some default settings for CUSTOM profile.
<o:p></o:p></p>
<p class="xmsonormal">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="xmsonormal">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="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Evan<o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xmsonormal"><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="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">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="x_divRplyFwdMsg">
<p class="xmsonormal"><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="xmsonormal"> <o:p></o:p></p>
</div>
</div>
<p class="xmsonormal">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>
</body>
</html>