<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<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:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi Felix,</p>
<p style="margin-top:0;margin-bottom:0"><br>
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">>That would make sense. But switching to manual mode would disable</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">>profiles and automatic profile selection. That was one reason why I</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
<span style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">>objected to your plan to control profile clock limits using these files.</span><br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
<br style="color: rgb(33, 33, 33); font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif, serif, EmojiFont; font-size: 14.6667px;">
</p>
<p style="margin-top:0;margin-bottom:0">Rex:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I am not very clear the old logic of gfx/compute power profile switch.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">But with new sysfs,</p>
<p style="margin-top:0;margin-bottom:0"> </p>
<p style="margin-top:0;margin-bottom:0">The logic is(those sysfs are independent) </p>
<p style="margin-top:0;margin-bottom:0"></p>
<ol style="margin-bottom: 0px; margin-top: 0px;">
<li><span style="font-size: 12pt;"></span><span style="font-size: 12pt;">configure uphyst/downhyst/min_ativity through power_profile_mode,</span><br>
</li></ol>
<p></p>
<p style="margin-top:0;margin-bottom:0">      2. adjust clock range through pp_dpm_sclk/mclk/pcie.(once this sysffs was called, set the dpm level mode to unknown)</p>
<p style="margin-top:0;margin-bottom:0">      3. adjust power limit through pp_od_power_limit(maybe equal to disable power containment).</p>
<p style="margin-top:0;margin-bottom:0">      </p>
<p style="margin-top:0;margin-bottom:0">In those functions, driver do not check the dpm level mode. </p>
<p style="margin-top:0;margin-bottom:0">the dpm level mode just used by <span style="font-family: Calibri, sans-serif; font-size: 14.6667px;">power_dpm_force_performance_level functions.</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, sans-serif; font-size: 14.6667px;"><br>
</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, sans-serif; font-size: 14.6667px;">Best Regards</span></p>
<p style="margin-top:0;margin-bottom:0"><span style="font-family: Calibri, sans-serif; font-size: 14.6667px;">Rex</span></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<br>
<div style="color: rgb(0, 0, 0);">
<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> Kuehling, Felix<br>
<b>Sent:</b> Friday, January 26, 2018 8:26 AM<br>
<b>To:</b> Zhu, Rex; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH 1/2] drm/amd/pp: Remove manual mode for power_dpm_force_performance_level</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On 2018-01-25 07:07 PM, Zhu, Rex wrote:<br>
> I also think about this problem.<br>
> just think user should unforced clk level through pp dpm<br>
> sclk/mclk/pcie if they change the clock logic through those sysfs.<br>
><br>
> The logic seems weird, As we supply many sysfs for adjust clock range.<br>
><br>
> We can fix this problem by change current mode to manual mode after<br>
> user call pp dpm sclk/mclk/pcie.<br>
><br>
> But another think,if user change back the clk range through pp dpm clk.<br>
><br>
> we are in manual mode, and user set auto mode, in fact, driver change<br>
> nothing.<br>
<br>
With profiles, switching back to auto mode would select the appropriate<br>
profile, which may have a different clock mask. For example for compute<br>
we enable only the highest two sclk levels.<br>
<br>
><br>
> Comparatively speaking, better set manual mode after user call pp dpm clk.<br>
<br>
That would make sense. But switching to manual mode would disable<br>
profiles and automatic profile selection. That was one reason why I<br>
objected to your plan to control profile clock limits using these files.<br>
<br>
Regards,<br>
  Felix<br>
<br>
> Thanks very much.<br>
><br>
> Best Regards<br>
> Rex<br>
> ------------------------------------------------------------------------<br>
> *From:* Kuehling, Felix<br>
> *Sent:* Friday, January 26, 2018 12:55:19 AM<br>
> *To:* amd-gfx@lists.freedesktop.org; Zhu, Rex<br>
> *Subject:* Re: [PATCH 1/2] drm/amd/pp: Remove manual mode for<br>
> power_dpm_force_performance_level<br>
>  <br>
> This patch breaks unforcing of clocks, which is currently done by<br>
> switching back from "manual" to "auto". By removing "manual" mode, you<br>
> remove the ability to unset forced clocks.<br>
><br>
> Regards,<br>
>   Felix<br>
><br>
><br>
> On 2018-01-25 06:26 AM, Rex Zhu wrote:<br>
> > Driver do not maintain manual mode for dpm_force_performance_level,<br>
> > User can set sclk/mclk/pcie range through<br>
> pp_dpm_sclk/pp_dpm_mclk/pp_dpm_pcie<br>
> > directly.<br>
> ><br>
> > In order to not break currently tools,<br>
> > when set "manual" to power_dpm_force_performance_level<br>
> > driver will do nothing and just return successful.<br>
> ><br>
> > Change-Id: Iaf672b9abc7fa57b765ceb7fa2fba6ad3e80c50b<br>
> > Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
> > ---<br>
> >  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c             |  3 +--<br>
> >  drivers/gpu/drm/amd/amdgpu/ci_dpm.c                |  5 -----<br>
> >  drivers/gpu/drm/amd/include/kgd_pp_interface.h     | 15 +++++++--------<br>
> >  drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c     |  4 ----<br>
> >  drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c     |  1 -<br>
> >  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c   |  6 ------<br>
> >  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c |  6 ------<br>
> >  7 files changed, 8 insertions(+), 32 deletions(-)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > index 1812009..66b4df0 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
> > @@ -152,7 +152,6 @@ static ssize_t<br>
> amdgpu_get_dpm_forced_performance_level(struct device *dev,<br>
> >                        (level == AMD_DPM_FORCED_LEVEL_AUTO) ? "auto" :<br>
> >                        (level == AMD_DPM_FORCED_LEVEL_LOW) ? "low" :<br>
> >                        (level == AMD_DPM_FORCED_LEVEL_HIGH) ? "high" :<br>
> > -                     (level == AMD_DPM_FORCED_LEVEL_MANUAL) ?<br>
> "manual" :<br>
> >                        (level ==<br>
> AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD) ? "profile_standard" :<br>
> >                        (level ==<br>
> AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK) ? "profile_min_sclk" :<br>
> >                        (level ==<br>
> AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK) ? "profile_min_mclk" :<br>
> > @@ -186,7 +185,7 @@ static ssize_t<br>
> amdgpu_set_dpm_forced_performance_level(struct device *dev,<br>
> >        } else if (strncmp("auto", buf, strlen("auto")) == 0) {<br>
> >                level = AMD_DPM_FORCED_LEVEL_AUTO;<br>
> >        } else if (strncmp("manual", buf, strlen("manual")) == 0) {<br>
> > -             level = AMD_DPM_FORCED_LEVEL_MANUAL;<br>
> > +             pr_info("No need to set manual mode, Just go ahead\n");<br>
> >        } else if (strncmp("profile_exit", buf,<br>
> strlen("profile_exit")) == 0) {<br>
> >                level = AMD_DPM_FORCED_LEVEL_PROFILE_EXIT;<br>
> >        } else if (strncmp("profile_standard", buf,<br>
> strlen("profile_standard")) == 0) {<br>
> > diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
> b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
> > index ab45232..8ddc978 100644<br>
> > --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
> > +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
> > @@ -6639,11 +6639,6 @@ static int ci_dpm_force_clock_level(void *handle,<br>
> >        struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
> >        struct ci_power_info *pi = ci_get_pi(adev);<br>
> > <br>
> > -     if (adev->pm.dpm.forced_level & (AMD_DPM_FORCED_LEVEL_AUTO |<br>
> > -                             AMD_DPM_FORCED_LEVEL_LOW |<br>
> > -                             AMD_DPM_FORCED_LEVEL_HIGH))<br>
> > -             return -EINVAL;<br>
> > -<br>
> >        switch (type) {<br>
> >        case PP_SCLK:<br>
> >                if (!pi->sclk_dpm_key_disabled)<br>
> > diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
> b/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
> > index b9aa9f4..3fab686 100644<br>
> > --- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
> > +++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
> > @@ -41,14 +41,13 @@ struct amd_vce_state {<br>
> > <br>
> >  enum amd_dpm_forced_level {<br>
> >        AMD_DPM_FORCED_LEVEL_AUTO = 0x1,<br>
> > -     AMD_DPM_FORCED_LEVEL_MANUAL = 0x2,<br>
> > -     AMD_DPM_FORCED_LEVEL_LOW = 0x4,<br>
> > -     AMD_DPM_FORCED_LEVEL_HIGH = 0x8,<br>
> > -     AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD = 0x10,<br>
> > -     AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK = 0x20,<br>
> > -     AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK = 0x40,<br>
> > -     AMD_DPM_FORCED_LEVEL_PROFILE_PEAK = 0x80,<br>
> > -     AMD_DPM_FORCED_LEVEL_PROFILE_EXIT = 0x100,<br>
> > +     AMD_DPM_FORCED_LEVEL_LOW = 0x2,<br>
> > +     AMD_DPM_FORCED_LEVEL_HIGH = 0x4,<br>
> > +     AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD = 0x8,<br>
> > +     AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK = 0x10,<br>
> > +     AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK = 0x20,<br>
> > +     AMD_DPM_FORCED_LEVEL_PROFILE_PEAK = 0x40,<br>
> > +     AMD_DPM_FORCED_LEVEL_PROFILE_EXIT = 0x80,<br>
> >  };<br>
> > <br>
> >  enum amd_pm_state_type {<br>
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
> b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
> > index dec8dd9..60d280c 100644<br>
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c<br>
> > @@ -1250,7 +1250,6 @@ static int cz_dpm_force_dpm_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >        case AMD_DPM_FORCED_LEVEL_AUTO:<br>
> >                ret = cz_phm_unforce_dpm_levels(hwmgr);<br>
> >                break;<br>
> > -     case AMD_DPM_FORCED_LEVEL_MANUAL:<br>
> >        case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:<br>
> >        default:<br>
> >                break;<br>
> > @@ -1558,9 +1557,6 @@ static int cz_get_dal_power_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >  static int cz_force_clock_level(struct pp_hwmgr *hwmgr,<br>
> >                enum pp_clock_type type, uint32_t mask)<br>
> >  {<br>
> > -     if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)<br>
> > -             return -EINVAL;<br>
> > -<br>
> >        switch (type) {<br>
> >        case PP_SCLK:<br>
> >                smum_send_msg_to_smc_with_parameter(hwmgr,<br>
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
> b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
> > index 409a56b..eddcbcd 100644<br>
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c<br>
> > @@ -605,7 +605,6 @@ static int rv_dpm_force_dpm_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >                                               <br>
> PPSMC_MSG_SetSoftMaxFclkByFreq,<br>
> >                                               <br>
> RAVEN_UMD_PSTATE_MIN_FCLK);<br>
> >                break;<br>
> > -     case AMD_DPM_FORCED_LEVEL_MANUAL:<br>
> >        case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:<br>
> >        default:<br>
> >                break;<br>
> > diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> > index 13db75c..e3a8374 100644<br>
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
> > @@ -2798,7 +2798,6 @@ static int smu7_force_dpm_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >                smu7_force_clock_level(hwmgr, PP_MCLK, 1<<mclk_mask);<br>
> >                smu7_force_clock_level(hwmgr, PP_PCIE, 1<<pcie_mask);<br>
> >                break;<br>
> > -     case AMD_DPM_FORCED_LEVEL_MANUAL:<br>
> >        case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:<br>
> >        default:<br>
> >                break;<br>
> > @@ -4311,11 +4310,6 @@ static int smu7_force_clock_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >  {<br>
> >        struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
> > <br>
> > -     if (hwmgr->request_dpm_level & (AMD_DPM_FORCED_LEVEL_AUTO |<br>
> > -                                     AMD_DPM_FORCED_LEVEL_LOW |<br>
> > -                                     AMD_DPM_FORCED_LEVEL_HIGH))<br>
> > -             return -EINVAL;<br>
> > -<br>
> >        switch (type) {<br>
> >        case PP_SCLK:<br>
> >                if (!data->sclk_dpm_key_disabled)<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 6b28896..828677e 100644<br>
> > --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> > +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
> > @@ -4241,7 +4241,6 @@ static int vega10_dpm_force_dpm_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >                vega10_force_clock_level(hwmgr, PP_SCLK, 1<<sclk_mask);<br>
> >                vega10_force_clock_level(hwmgr, PP_MCLK, 1<<mclk_mask);<br>
> >                break;<br>
> > -     case AMD_DPM_FORCED_LEVEL_MANUAL:<br>
> >        case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:<br>
> >        default:<br>
> >                break;<br>
> > @@ -4500,11 +4499,6 @@ static int vega10_force_clock_level(struct<br>
> pp_hwmgr *hwmgr,<br>
> >  {<br>
> >        struct vega10_hwmgr *data = (struct vega10_hwmgr<br>
> *)(hwmgr->backend);<br>
> > <br>
> > -     if (hwmgr->request_dpm_level & (AMD_DPM_FORCED_LEVEL_AUTO |<br>
> > -                             AMD_DPM_FORCED_LEVEL_LOW |<br>
> > -                             AMD_DPM_FORCED_LEVEL_HIGH))<br>
> > -             return -EINVAL;<br>
> > -<br>
> >        switch (type) {<br>
> >        case PP_SCLK:<br>
> >                data->smc_state_table.gfx_boot_level = mask ?<br>
> (ffs(mask) - 1) : 0;<br>
><br>
<br>
</div>
</span></font></div>
</div>
</div>
</body>
</html>