<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<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"></p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
Hi Felix,</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
<br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
First, thanks very much for taking so much time to review this interface.</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
In fact, we just hope and want to support power profiling feature better.</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
<br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
Sclk level 7 i mean the highest sclk level, we get used to start from level 0. sorry for makeing you confuse. </p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
<br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
Best Regards</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">
Rex</p>
<p></p>
</div>
<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> Thursday, March 1, 2018 1:13:58 AM<br>
<b>To:</b> Zhu, Rex; Alex Deucher; Huang, JinHuiEric<br>
<b>Cc:</b> Russell, Kent; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: [PATCH] drm/amd/pp: Revert gfx/compute profile switch sysfs</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Hi Rex,<br>
<br>
The purpose of the compute power profile for us is to optimize<br>
performance. Compute workloads tend to be "bursty". The default<br>
heuristics of the SMU don't work well for such work loads. They aren't<br>
able to raise clocks quickly enough to accelerate short bursts of<br>
compute work.<br>
<br>
We need to quickly raise clocks when needed. That's why we change<br>
hysteresis parameters, and set a minimum clock. This minimizes the<br>
latency of reaching maximum clocks.<br>
<br>
The goal is not to set a fixed frequency, but to minimize the time<br>
needed to reach the highest frequency. Setting fixed DPM level 7 will<br>
not allow us to reach level 8. That will hurt our performance.<br>
<br>
Regards,<br>
Felix<br>
<br>
<br>
On 2018-02-28 06:08 AM, Zhu, Rex wrote:<br>
> I went through the power profiling feature in windows - Auto Wattman supported on Polaris and Vega. Initially apply to Polaris.<br>
><br>
> The Goal is to maximize performance/watt without impacting performance and no visual impact per system/use case<br>
><br>
> On smu7, 3 parameters control how SMU responds to sclk/mclk activity, up/down hysteresis and activity threshold.<br>
><br>
> My understanding is:<br>
> When sclk_activity large than threshold, adjust uphyst/downhyst/activity threshold to go higher dpm level more faster or stay in higher dpm level longer for boost performance.<br>
> Otherwise, for power saving.<br>
><br>
> Those parameters were used to change the behavior of dpm switching for performance in watt. So we wish to add an independent sysfs to configure them.<br>
><br>
> When this feature enabled, the performance in watt is improved in most case(low activity and Multimedia) from pplib's test. I do not find compute test result.<br>
><br>
> So there is a question: <br>
><br>
> When compute ring begin, if we just fix sclk in level7 directly, , <br>
> Is there any difference in performance or performance in watt, compared to set compute profile mode (include apply min sclk to level6)?<br>
><br>
><br>
> Best Regards<br>
> Rex<br>
><br>
><br>
><br>
><br>
><br>
> -----Original Message-----<br>
> From: Kuehling, Felix <br>
> Sent: Wednesday, February 28, 2018 2:55 AM<br>
> To: Alex Deucher; Huang, JinHuiEric<br>
> Cc: Zhu, Rex; Russell, Kent; amd-gfx list<br>
> Subject: Re: [PATCH] drm/amd/pp: Revert gfx/compute profile switch sysfs<br>
><br>
> On 2018-02-27 11:27 AM, Alex Deucher wrote:<br>
>> On Tue, Feb 27, 2018 at 11:22 AM, Eric Huang <jinhuieric.huang@amd.com> wrote:<br>
>>> As I mentioned in code review for new power profile, old gfx/compute power<br>
>>> profile have two scenarios for auto switching. One is<br>
>>> gfx->compute(default)->gfx and other is gfx->compute(custom)->gfx. New power<br>
>>> profile only satisfies first one, but in second one for user debugging, user<br>
>>> setting of power profile will be over-written when switching to compute<br>
>>> profile.<br>
>> For debugging, the idea would be to select manual mode via<br>
>> force_performance_level and then force a profile via sysfs. If manual<br>
>> mode was selected, none of the automatic profile changing would<br>
>> happen. Is that adequate or do you need the automatic switching even<br>
>> with a custom profile?<br>
> It would result in higher power consumption while no compute work is<br>
> running by applying minimum clocks (if that's still part of the<br>
> profile). If minimum clock is not part of the profile, then that's<br>
> another major regression for us.<br>
><br>
> I would prefer to add the ability to tweak all the power profiles so we<br>
> can have workload-specific customization, not just for compute. Maybe<br>
> that's something we can add later.<br>
><br>
> Regards,<br>
> Felix<br>
><br>
>> Alex<br>
>><br>
>><br>
>>> Regards,<br>
>>> Eric<br>
>>><br>
>>> On 2018-02-27 10:52 AM, Felix Kuehling wrote:<br>
>>>> [+Eric]<br>
>>>><br>
>>>> Compute profile switching code as well as KFD compute support for most<br>
>>>> GPUs is not upstream yet. As such, there is probably no requirement<br>
>>>> (yet) to keep the compute profile API stable, that we added specifically<br>
>>>> for KFD. Once we are upstream that will change.<br>
>>>><br>
>>>> If you change it now, we'll have to adapt, like we have often done.<br>
>>>><br>
>>>> I'll let Eric comment on whether the new power profile code and API is<br>
>>>> an adequate replacement from a functionality perspective. Eric, Kent,<br>
>>>> have we done any testing with Rex's new profile code?<br>
>>>><br>
>>>> Regards,<br>
>>>> Felix<br>
>>>><br>
>>>><br>
>>>> On 2018-02-27 10:41 AM, Alex Deucher wrote:<br>
>>>>> + Kent and Felix for comment<br>
>>>>><br>
>>>>> On Tue, Feb 27, 2018 at 6:21 AM, Rex Zhu <Rex.Zhu@amd.com> wrote:<br>
>>>>>> The gfx/compute profiling mode switch is only for internally<br>
>>>>>> test. Not a complete solution and unexpectly upstream.<br>
>>>>>> so revert it.<br>
>>>>>><br>
>>>>>> Change-Id: I1af1b64a63b6fc12c24cf73df03b083b3661ca02<br>
>>>>>> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com><br>
>>>>>> ---<br>
>>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 8 -<br>
>>>>>> drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 180<br>
>>>>>> ---------------<br>
>>>>>> drivers/gpu/drm/amd/amdgpu/ci_dpm.c | 256<br>
>>>>>> ---------------------<br>
>>>>>> drivers/gpu/drm/amd/amdgpu/ci_dpm.h | 7 -<br>
>>>>>> drivers/gpu/drm/amd/include/kgd_pp_interface.h | 7 -<br>
>>>>>> drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 114 ---------<br>
>>>>>> .../gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | 17 --<br>
>>>>>> drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c | 2 -<br>
>>>>>> drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 84 -------<br>
>>>>>> drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 86 -------<br>
>>>>>> .../gpu/drm/amd/powerplay/inc/hardwaremanager.h | 1 -<br>
>>>>>> drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 9 -<br>
>>>>>> drivers/gpu/drm/amd/powerplay/inc/smumgr.h | 3 -<br>
>>>>>> drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c | 27 ---<br>
>>>>>> drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c | 66 ------<br>
>>>>>> .../drm/amd/powerplay/smumgr/polaris10_smumgr.c | 64 ------<br>
>>>>>> drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c | 10 -<br>
>>>>>> .../gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c | 64 ------<br>
>>>>>> 18 files changed, 1005 deletions(-)<br>
>>>>>><br>
>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h<br>
>>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h<br>
>>>>>> index bd745a4..9c373f8f 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h<br>
>>>>>> @@ -341,14 +341,6 @@ enum amdgpu_pcie_gen {<br>
>>>>>><br>
>>>>>> ((adev)->powerplay.pp_funcs->reset_power_profile_state(\<br>
>>>>>> (adev)->powerplay.pp_handle, request))<br>
>>>>>><br>
>>>>>> -#define amdgpu_dpm_get_power_profile_state(adev, query) \<br>
>>>>>> - ((adev)->powerplay.pp_funcs->get_power_profile_state(\<br>
>>>>>> - (adev)->powerplay.pp_handle, query))<br>
>>>>>> -<br>
>>>>>> -#define amdgpu_dpm_set_power_profile_state(adev, request) \<br>
>>>>>> - ((adev)->powerplay.pp_funcs->set_power_profile_state(\<br>
>>>>>> - (adev)->powerplay.pp_handle, request))<br>
>>>>>> -<br>
>>>>>> #define amdgpu_dpm_switch_power_profile(adev, type) \<br>
>>>>>> ((adev)->powerplay.pp_funcs->switch_power_profile(\<br>
>>>>>> (adev)->powerplay.pp_handle, type))<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
>>>>>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
>>>>>> index 9e73cbc..632b186 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c<br>
>>>>>> @@ -734,161 +734,6 @@ static ssize_t<br>
>>>>>> amdgpu_set_pp_power_profile_mode(struct device *dev,<br>
>>>>>> return -EINVAL;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static ssize_t amdgpu_get_pp_power_profile(struct device *dev,<br>
>>>>>> - char *buf, struct amd_pp_profile *query)<br>
>>>>>> -{<br>
>>>>>> - struct drm_device *ddev = dev_get_drvdata(dev);<br>
>>>>>> - struct amdgpu_device *adev = ddev->dev_private;<br>
>>>>>> - int ret = 0xff;<br>
>>>>>> -<br>
>>>>>> - if (adev->powerplay.pp_funcs->get_power_profile_state)<br>
>>>>>> - ret = amdgpu_dpm_get_power_profile_state(<br>
>>>>>> - adev, query);<br>
>>>>>> -<br>
>>>>>> - if (ret)<br>
>>>>>> - return ret;<br>
>>>>>> -<br>
>>>>>> - return snprintf(buf, PAGE_SIZE,<br>
>>>>>> - "%d %d %d %d %d\n",<br>
>>>>>> - query->min_sclk / 100,<br>
>>>>>> - query->min_mclk / 100,<br>
>>>>>> - query->activity_threshold,<br>
>>>>>> - query->up_hyst,<br>
>>>>>> - query->down_hyst);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static ssize_t amdgpu_get_pp_gfx_power_profile(struct device *dev,<br>
>>>>>> - struct device_attribute *attr,<br>
>>>>>> - char *buf)<br>
>>>>>> -{<br>
>>>>>> - struct amd_pp_profile query = {0};<br>
>>>>>> -<br>
>>>>>> - query.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - return amdgpu_get_pp_power_profile(dev, buf, &query);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static ssize_t amdgpu_get_pp_compute_power_profile(struct device *dev,<br>
>>>>>> - struct device_attribute *attr,<br>
>>>>>> - char *buf)<br>
>>>>>> -{<br>
>>>>>> - struct amd_pp_profile query = {0};<br>
>>>>>> -<br>
>>>>>> - query.type = AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - return amdgpu_get_pp_power_profile(dev, buf, &query);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static ssize_t amdgpu_set_pp_power_profile(struct device *dev,<br>
>>>>>> - const char *buf,<br>
>>>>>> - size_t count,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct drm_device *ddev = dev_get_drvdata(dev);<br>
>>>>>> - struct amdgpu_device *adev = ddev->dev_private;<br>
>>>>>> - uint32_t loop = 0;<br>
>>>>>> - char *sub_str, buf_cpy[128], *tmp_str;<br>
>>>>>> - const char delimiter[3] = {' ', '\n', '\0'};<br>
>>>>>> - long int value;<br>
>>>>>> - int ret = 0xff;<br>
>>>>>> -<br>
>>>>>> - if (strncmp("reset", buf, strlen("reset")) == 0) {<br>
>>>>>> - if (adev->powerplay.pp_funcs->reset_power_profile_state)<br>
>>>>>> - ret = amdgpu_dpm_reset_power_profile_state(<br>
>>>>>> - adev, request);<br>
>>>>>> - if (ret) {<br>
>>>>>> - count = -EINVAL;<br>
>>>>>> - goto fail;<br>
>>>>>> - }<br>
>>>>>> - return count;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (strncmp("set", buf, strlen("set")) == 0) {<br>
>>>>>> - if (adev->powerplay.pp_funcs->set_power_profile_state)<br>
>>>>>> - ret = amdgpu_dpm_set_power_profile_state(<br>
>>>>>> - adev, request);<br>
>>>>>> -<br>
>>>>>> - if (ret) {<br>
>>>>>> - count = -EINVAL;<br>
>>>>>> - goto fail;<br>
>>>>>> - }<br>
>>>>>> - return count;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (count + 1 >= 128) {<br>
>>>>>> - count = -EINVAL;<br>
>>>>>> - goto fail;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - memcpy(buf_cpy, buf, count + 1);<br>
>>>>>> - tmp_str = buf_cpy;<br>
>>>>>> -<br>
>>>>>> - while (tmp_str[0]) {<br>
>>>>>> - sub_str = strsep(&tmp_str, delimiter);<br>
>>>>>> - ret = kstrtol(sub_str, 0, &value);<br>
>>>>>> - if (ret) {<br>
>>>>>> - count = -EINVAL;<br>
>>>>>> - goto fail;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - switch (loop) {<br>
>>>>>> - case 0:<br>
>>>>>> - /* input unit MHz convert to dpm table unit<br>
>>>>>> 10KHz*/<br>
>>>>>> - request->min_sclk = (uint32_t)value * 100;<br>
>>>>>> - break;<br>
>>>>>> - case 1:<br>
>>>>>> - /* input unit MHz convert to dpm table unit<br>
>>>>>> 10KHz*/<br>
>>>>>> - request->min_mclk = (uint32_t)value * 100;<br>
>>>>>> - break;<br>
>>>>>> - case 2:<br>
>>>>>> - request->activity_threshold = (uint16_t)value;<br>
>>>>>> - break;<br>
>>>>>> - case 3:<br>
>>>>>> - request->up_hyst = (uint8_t)value;<br>
>>>>>> - break;<br>
>>>>>> - case 4:<br>
>>>>>> - request->down_hyst = (uint8_t)value;<br>
>>>>>> - break;<br>
>>>>>> - default:<br>
>>>>>> - break;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - loop++;<br>
>>>>>> - }<br>
>>>>>> - if (adev->powerplay.pp_funcs->set_power_profile_state)<br>
>>>>>> - ret = amdgpu_dpm_set_power_profile_state(adev, request);<br>
>>>>>> -<br>
>>>>>> - if (ret)<br>
>>>>>> - count = -EINVAL;<br>
>>>>>> -<br>
>>>>>> -fail:<br>
>>>>>> - return count;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static ssize_t amdgpu_set_pp_gfx_power_profile(struct device *dev,<br>
>>>>>> - struct device_attribute *attr,<br>
>>>>>> - const char *buf,<br>
>>>>>> - size_t count)<br>
>>>>>> -{<br>
>>>>>> - struct amd_pp_profile request = {0};<br>
>>>>>> -<br>
>>>>>> - request.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - return amdgpu_set_pp_power_profile(dev, buf, count, &request);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static ssize_t amdgpu_set_pp_compute_power_profile(struct device *dev,<br>
>>>>>> - struct device_attribute *attr,<br>
>>>>>> - const char *buf,<br>
>>>>>> - size_t count)<br>
>>>>>> -{<br>
>>>>>> - struct amd_pp_profile request = {0};<br>
>>>>>> -<br>
>>>>>> - request.type = AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - return amdgpu_set_pp_power_profile(dev, buf, count, &request);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static DEVICE_ATTR(power_dpm_state, S_IRUGO | S_IWUSR,<br>
>>>>>> amdgpu_get_dpm_state, amdgpu_set_dpm_state);<br>
>>>>>> static DEVICE_ATTR(power_dpm_force_performance_level, S_IRUGO |<br>
>>>>>> S_IWUSR,<br>
>>>>>> amdgpu_get_dpm_forced_performance_level,<br>
>>>>>> @@ -916,12 +761,6 @@ static DEVICE_ATTR(pp_sclk_od, S_IRUGO | S_IWUSR,<br>
>>>>>> static DEVICE_ATTR(pp_mclk_od, S_IRUGO | S_IWUSR,<br>
>>>>>> amdgpu_get_pp_mclk_od,<br>
>>>>>> amdgpu_set_pp_mclk_od);<br>
>>>>>> -static DEVICE_ATTR(pp_gfx_power_profile, S_IRUGO | S_IWUSR,<br>
>>>>>> - amdgpu_get_pp_gfx_power_profile,<br>
>>>>>> - amdgpu_set_pp_gfx_power_profile);<br>
>>>>>> -static DEVICE_ATTR(pp_compute_power_profile, S_IRUGO | S_IWUSR,<br>
>>>>>> - amdgpu_get_pp_compute_power_profile,<br>
>>>>>> - amdgpu_set_pp_compute_power_profile);<br>
>>>>>> static DEVICE_ATTR(pp_power_profile_mode, S_IRUGO | S_IWUSR,<br>
>>>>>> amdgpu_get_pp_power_profile_mode,<br>
>>>>>> amdgpu_set_pp_power_profile_mode);<br>
>>>>>> @@ -1767,21 +1606,6 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device<br>
>>>>>> *adev)<br>
>>>>>> return ret;<br>
>>>>>> }<br>
>>>>>> ret = device_create_file(adev->dev,<br>
>>>>>> - &dev_attr_pp_gfx_power_profile);<br>
>>>>>> - if (ret) {<br>
>>>>>> - DRM_ERROR("failed to create device file "<br>
>>>>>> - "pp_gfx_power_profile\n");<br>
>>>>>> - return ret;<br>
>>>>>> - }<br>
>>>>>> - ret = device_create_file(adev->dev,<br>
>>>>>> - &dev_attr_pp_compute_power_profile);<br>
>>>>>> - if (ret) {<br>
>>>>>> - DRM_ERROR("failed to create device file "<br>
>>>>>> - "pp_compute_power_profile\n");<br>
>>>>>> - return ret;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - ret = device_create_file(adev->dev,<br>
>>>>>> &dev_attr_pp_power_profile_mode);<br>
>>>>>> if (ret) {<br>
>>>>>> DRM_ERROR("failed to create device file "<br>
>>>>>> @@ -1827,10 +1651,6 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device<br>
>>>>>> *adev)<br>
>>>>>> device_remove_file(adev->dev, &dev_attr_pp_sclk_od);<br>
>>>>>> device_remove_file(adev->dev, &dev_attr_pp_mclk_od);<br>
>>>>>> device_remove_file(adev->dev,<br>
>>>>>> - &dev_attr_pp_gfx_power_profile);<br>
>>>>>> - device_remove_file(adev->dev,<br>
>>>>>> - &dev_attr_pp_compute_power_profile);<br>
>>>>>> - device_remove_file(adev->dev,<br>
>>>>>> &dev_attr_pp_power_profile_mode);<br>
>>>>>> device_remove_file(adev->dev,<br>
>>>>>> &dev_attr_pp_od_clk_voltage);<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
>>>>>> b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
>>>>>> index f82f40f..ddb814f 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.c<br>
>>>>>> @@ -3695,40 +3695,6 @@ static int ci_find_boot_level(struct<br>
>>>>>> ci_single_dpm_table *table,<br>
>>>>>> return ret;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static void ci_save_default_power_profile(struct amdgpu_device *adev)<br>
>>>>>> -{<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - struct SMU7_Discrete_GraphicsLevel *levels =<br>
>>>>>> - pi->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t min_level = 0;<br>
>>>>>> -<br>
>>>>>> - pi->default_gfx_power_profile.activity_threshold =<br>
>>>>>> - be16_to_cpu(levels[0].ActivityLevel);<br>
>>>>>> - pi->default_gfx_power_profile.up_hyst = levels[0].UpH;<br>
>>>>>> - pi->default_gfx_power_profile.down_hyst = levels[0].DownH;<br>
>>>>>> - pi->default_gfx_power_profile.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - pi->default_compute_power_profile =<br>
>>>>>> pi->default_gfx_power_profile;<br>
>>>>>> - pi->default_compute_power_profile.type = AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - /* Optimize compute power profile: Use only highest<br>
>>>>>> - * 2 power levels (if more than 2 are available), Hysteresis:<br>
>>>>>> - * 0ms up, 5ms down<br>
>>>>>> - */<br>
>>>>>> - if (pi->smc_state_table.GraphicsDpmLevelCount > 2)<br>
>>>>>> - min_level = pi->smc_state_table.GraphicsDpmLevelCount -<br>
>>>>>> 2;<br>
>>>>>> - else if (pi->smc_state_table.GraphicsDpmLevelCount == 2)<br>
>>>>>> - min_level = 1;<br>
>>>>>> - pi->default_compute_power_profile.min_sclk =<br>
>>>>>> - be32_to_cpu(levels[min_level].SclkFrequency);<br>
>>>>>> -<br>
>>>>>> - pi->default_compute_power_profile.up_hyst = 0;<br>
>>>>>> - pi->default_compute_power_profile.down_hyst = 5;<br>
>>>>>> -<br>
>>>>>> - pi->gfx_power_profile = pi->default_gfx_power_profile;<br>
>>>>>> - pi->compute_power_profile = pi->default_compute_power_profile;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int ci_init_smc_table(struct amdgpu_device *adev)<br>
>>>>>> {<br>
>>>>>> struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> @@ -3874,8 +3840,6 @@ static int ci_init_smc_table(struct amdgpu_device<br>
>>>>>> *adev)<br>
>>>>>> if (ret)<br>
>>>>>> return ret;<br>
>>>>>><br>
>>>>>> - ci_save_default_power_profile(adev);<br>
>>>>>> -<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> @@ -6753,222 +6717,6 @@ static int ci_dpm_set_mclk_od(void *handle,<br>
>>>>>> uint32_t value)<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int ci_dpm_get_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *query)<br>
>>>>>> -{<br>
>>>>>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> -<br>
>>>>>> - if (!pi || !query)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (query->type == AMD_PP_GFX_PROFILE)<br>
>>>>>> - memcpy(query, &pi->gfx_power_profile,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else if (query->type == AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - memcpy(query, &pi->compute_power_profile,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int ci_populate_requested_graphic_levels(struct amdgpu_device<br>
>>>>>> *adev,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - struct ci_dpm_table *dpm_table = &(pi->dpm_table);<br>
>>>>>> - struct SMU7_Discrete_GraphicsLevel *levels =<br>
>>>>>> - pi->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t array = pi->dpm_table_start +<br>
>>>>>> - offsetof(SMU7_Discrete_DpmTable, GraphicsLevel);<br>
>>>>>> - uint32_t array_size = sizeof(struct SMU7_Discrete_GraphicsLevel)<br>
>>>>>> *<br>
>>>>>> - SMU7_MAX_LEVELS_GRAPHICS;<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->sclk_table.count; i++) {<br>
>>>>>> - levels[i].ActivityLevel =<br>
>>>>>> -<br>
>>>>>> cpu_to_be16(request->activity_threshold);<br>
>>>>>> - levels[i].EnabledForActivity = 1;<br>
>>>>>> - levels[i].UpH = request->up_hyst;<br>
>>>>>> - levels[i].DownH = request->down_hyst;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return amdgpu_ci_copy_bytes_to_smc(adev, array, (uint8_t<br>
>>>>>> *)levels,<br>
>>>>>> - array_size, pi->sram_end);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static void ci_find_min_clock_masks(struct amdgpu_device *adev,<br>
>>>>>> - uint32_t *sclk_mask, uint32_t *mclk_mask,<br>
>>>>>> - uint32_t min_sclk, uint32_t min_mclk)<br>
>>>>>> -{<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - struct ci_dpm_table *dpm_table = &(pi->dpm_table);<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->sclk_table.count; i++) {<br>
>>>>>> - if (dpm_table->sclk_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->sclk_table.dpm_levels[i].value >=<br>
>>>>>> min_sclk)<br>
>>>>>> - *sclk_mask |= 1 << i;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->mclk_table.count; i++) {<br>
>>>>>> - if (dpm_table->mclk_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->mclk_table.dpm_levels[i].value >=<br>
>>>>>> min_mclk)<br>
>>>>>> - *mclk_mask |= 1 << i;<br>
>>>>>> - }<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int ci_set_power_profile_state(struct amdgpu_device *adev,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - int tmp_result, result = 0;<br>
>>>>>> - uint32_t sclk_mask = 0, mclk_mask = 0;<br>
>>>>>> -<br>
>>>>>> - tmp_result = ci_freeze_sclk_mclk_dpm(adev);<br>
>>>>>> - if (tmp_result) {<br>
>>>>>> - DRM_ERROR("Failed to freeze SCLK MCLK DPM!");<br>
>>>>>> - result = tmp_result;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - tmp_result = ci_populate_requested_graphic_levels(adev,<br>
>>>>>> - request);<br>
>>>>>> - if (tmp_result) {<br>
>>>>>> - DRM_ERROR("Failed to populate requested graphic<br>
>>>>>> levels!");<br>
>>>>>> - result = tmp_result;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - tmp_result = ci_unfreeze_sclk_mclk_dpm(adev);<br>
>>>>>> - if (tmp_result) {<br>
>>>>>> - DRM_ERROR("Failed to unfreeze SCLK MCLK DPM!");<br>
>>>>>> - result = tmp_result;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - ci_find_min_clock_masks(adev, &sclk_mask, &mclk_mask,<br>
>>>>>> - request->min_sclk, request->min_mclk);<br>
>>>>>> -<br>
>>>>>> - if (sclk_mask) {<br>
>>>>>> - if (!pi->sclk_dpm_key_disabled)<br>
>>>>>> - amdgpu_ci_send_msg_to_smc_with_parameter(<br>
>>>>>> - adev,<br>
>>>>>> - PPSMC_MSG_SCLKDPM_SetEnabledMask,<br>
>>>>>> - pi->dpm_level_enable_mask.<br>
>>>>>> - sclk_dpm_enable_mask &<br>
>>>>>> - sclk_mask);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (mclk_mask) {<br>
>>>>>> - if (!pi->mclk_dpm_key_disabled)<br>
>>>>>> - amdgpu_ci_send_msg_to_smc_with_parameter(<br>
>>>>>> - adev,<br>
>>>>>> - PPSMC_MSG_MCLKDPM_SetEnabledMask,<br>
>>>>>> - pi->dpm_level_enable_mask.<br>
>>>>>> - mclk_dpm_enable_mask &<br>
>>>>>> - mclk_mask);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> -<br>
>>>>>> - return result;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int ci_dpm_set_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - int ret = -1;<br>
>>>>>> -<br>
>>>>>> - if (!pi || !request)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (adev->pm.dpm.forced_level !=<br>
>>>>>> - AMD_DPM_FORCED_LEVEL_AUTO)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (request->min_sclk ||<br>
>>>>>> - request->min_mclk ||<br>
>>>>>> - request->activity_threshold ||<br>
>>>>>> - request->up_hyst ||<br>
>>>>>> - request->down_hyst) {<br>
>>>>>> - if (request->type == AMD_PP_GFX_PROFILE)<br>
>>>>>> - memcpy(&pi->gfx_power_profile, request,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else if (request->type == AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - memcpy(&pi->compute_power_profile, request,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (request->type == pi->current_power_profile)<br>
>>>>>> - ret = ci_set_power_profile_state(<br>
>>>>>> - adev,<br>
>>>>>> - request);<br>
>>>>>> - } else {<br>
>>>>>> - /* set power profile if it exists */<br>
>>>>>> - switch (request->type) {<br>
>>>>>> - case AMD_PP_GFX_PROFILE:<br>
>>>>>> - ret = ci_set_power_profile_state(<br>
>>>>>> - adev,<br>
>>>>>> - &pi->gfx_power_profile);<br>
>>>>>> - break;<br>
>>>>>> - case AMD_PP_COMPUTE_PROFILE:<br>
>>>>>> - ret = ci_set_power_profile_state(<br>
>>>>>> - adev,<br>
>>>>>> - &pi->compute_power_profile);<br>
>>>>>> - break;<br>
>>>>>> - default:<br>
>>>>>> - return -EINVAL;<br>
>>>>>> - }<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (!ret)<br>
>>>>>> - pi->current_power_profile = request->type;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int ci_dpm_reset_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> -<br>
>>>>>> - if (!pi || !request)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (request->type == AMD_PP_GFX_PROFILE) {<br>
>>>>>> - pi->gfx_power_profile = pi->default_gfx_power_profile;<br>
>>>>>> - return ci_dpm_set_power_profile_state(adev,<br>
>>>>>> - &pi->gfx_power_profile);<br>
>>>>>> - } else if (request->type == AMD_PP_COMPUTE_PROFILE) {<br>
>>>>>> - pi->compute_power_profile =<br>
>>>>>> - pi->default_compute_power_profile;<br>
>>>>>> - return ci_dpm_set_power_profile_state(adev,<br>
>>>>>> - &pi->compute_power_profile);<br>
>>>>>> - } else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int ci_dpm_switch_power_profile(void *handle,<br>
>>>>>> - enum amd_pp_profile_type type)<br>
>>>>>> -{<br>
>>>>>> - struct amdgpu_device *adev = (struct amdgpu_device *)handle;<br>
>>>>>> - struct ci_power_info *pi = ci_get_pi(adev);<br>
>>>>>> - struct amd_pp_profile request = {0};<br>
>>>>>> -<br>
>>>>>> - if (!pi)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (pi->current_power_profile != type) {<br>
>>>>>> - request.type = type;<br>
>>>>>> - return ci_dpm_set_power_profile_state(adev, &request);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int ci_dpm_read_sensor(void *handle, int idx,<br>
>>>>>> void *value, int *size)<br>
>>>>>> {<br>
>>>>>> @@ -7053,10 +6801,6 @@ static int ci_dpm_read_sensor(void *handle, int<br>
>>>>>> idx,<br>
>>>>>> .set_mclk_od = ci_dpm_set_mclk_od,<br>
>>>>>> .check_state_equal = ci_check_state_equal,<br>
>>>>>> .get_vce_clock_state = amdgpu_get_vce_clock_state,<br>
>>>>>> - .get_power_profile_state = ci_dpm_get_power_profile_state,<br>
>>>>>> - .set_power_profile_state = ci_dpm_set_power_profile_state,<br>
>>>>>> - .reset_power_profile_state = ci_dpm_reset_power_profile_state,<br>
>>>>>> - .switch_power_profile = ci_dpm_switch_power_profile,<br>
>>>>>> .read_sensor = ci_dpm_read_sensor,<br>
>>>>>> };<br>
>>>>>><br>
>>>>>> diff --git a/drivers/gpu/drm/amd/amdgpu/ci_dpm.h<br>
>>>>>> b/drivers/gpu/drm/amd/amdgpu/ci_dpm.h<br>
>>>>>> index 84cbc9c..91be299 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/amdgpu/ci_dpm.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/amdgpu/ci_dpm.h<br>
>>>>>> @@ -295,13 +295,6 @@ struct ci_power_info {<br>
>>>>>> bool fan_is_controlled_by_smc;<br>
>>>>>> u32 t_min;<br>
>>>>>> u32 fan_ctrl_default_mode;<br>
>>>>>> -<br>
>>>>>> - /* power profile */<br>
>>>>>> - struct amd_pp_profile gfx_power_profile;<br>
>>>>>> - struct amd_pp_profile compute_power_profile;<br>
>>>>>> - struct amd_pp_profile default_gfx_power_profile;<br>
>>>>>> - struct amd_pp_profile default_compute_power_profile;<br>
>>>>>> - enum amd_pp_profile_type current_power_profile;<br>
>>>>>> };<br>
>>>>>><br>
>>>>>> #define CISLANDS_VOLTAGE_CONTROL_NONE 0x0<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 22c2fa3..7dfba2d 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h<br>
>>>>>> @@ -260,13 +260,6 @@ struct amd_pm_funcs {<br>
>>>>>> int (*get_pp_table)(void *handle, char **table);<br>
>>>>>> int (*set_pp_table)(void *handle, const char *buf, size_t<br>
>>>>>> size);<br>
>>>>>> void (*debugfs_print_current_performance_level)(void *handle,<br>
>>>>>> struct seq_file *m);<br>
>>>>>> -<br>
>>>>>> - int (*reset_power_profile_state)(void *handle,<br>
>>>>>> - struct amd_pp_profile *request);<br>
>>>>>> - int (*get_power_profile_state)(void *handle,<br>
>>>>>> - struct amd_pp_profile *query);<br>
>>>>>> - int (*set_power_profile_state)(void *handle,<br>
>>>>>> - struct amd_pp_profile *request);<br>
>>>>>> int (*switch_power_profile)(void *handle,<br>
>>>>>> enum amd_pp_profile_type type);<br>
>>>>>> /* export to amdgpu */<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
>>>>>> index 5feb91b..5f5fbb6 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c<br>
>>>>>> @@ -1014,58 +1014,6 @@ static int pp_dpm_read_sensor(void *handle, int<br>
>>>>>> idx,<br>
>>>>>> return NULL;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int pp_dpm_reset_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct pp_hwmgr *hwmgr;<br>
>>>>>> - struct pp_instance *pp_handle = (struct pp_instance *)handle;<br>
>>>>>> -<br>
>>>>>> - if (!request || pp_check(pp_handle))<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - hwmgr = pp_handle->hwmgr;<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->hwmgr_func->set_power_profile_state == NULL) {<br>
>>>>>> - pr_info("%s was not implemented.\n", __func__);<br>
>>>>>> - return 0;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (request->type == AMD_PP_GFX_PROFILE) {<br>
>>>>>> - hwmgr->gfx_power_profile =<br>
>>>>>> hwmgr->default_gfx_power_profile;<br>
>>>>>> - return hwmgr->hwmgr_func->set_power_profile_state(hwmgr,<br>
>>>>>> - &hwmgr->gfx_power_profile);<br>
>>>>>> - } else if (request->type == AMD_PP_COMPUTE_PROFILE) {<br>
>>>>>> - hwmgr->compute_power_profile =<br>
>>>>>> - hwmgr->default_compute_power_profile;<br>
>>>>>> - return hwmgr->hwmgr_func->set_power_profile_state(hwmgr,<br>
>>>>>> - &hwmgr->compute_power_profile);<br>
>>>>>> - } else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int pp_dpm_get_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *query)<br>
>>>>>> -{<br>
>>>>>> - struct pp_hwmgr *hwmgr;<br>
>>>>>> - struct pp_instance *pp_handle = (struct pp_instance *)handle;<br>
>>>>>> -<br>
>>>>>> - if (!query || pp_check(pp_handle))<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - hwmgr = pp_handle->hwmgr;<br>
>>>>>> -<br>
>>>>>> - if (query->type == AMD_PP_GFX_PROFILE)<br>
>>>>>> - memcpy(query, &hwmgr->gfx_power_profile,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else if (query->type == AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - memcpy(query, &hwmgr->compute_power_profile,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int pp_get_power_profile_mode(void *handle, char *buf)<br>
>>>>>> {<br>
>>>>>> struct pp_hwmgr *hwmgr;<br>
>>>>>> @@ -1124,65 +1072,6 @@ static int pp_odn_edit_dpm_table(void *handle,<br>
>>>>>> uint32_t type, long *input, uint3<br>
>>>>>> return hwmgr->hwmgr_func->odn_edit_dpm_table(hwmgr, type,<br>
>>>>>> input, size);<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int pp_dpm_set_power_profile_state(void *handle,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct pp_hwmgr *hwmgr;<br>
>>>>>> - struct pp_instance *pp_handle = (struct pp_instance *)handle;<br>
>>>>>> - int ret = -1;<br>
>>>>>> -<br>
>>>>>> - if (!request || pp_check(pp_handle))<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - hwmgr = pp_handle->hwmgr;<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->hwmgr_func->set_power_profile_state == NULL) {<br>
>>>>>> - pr_info("%s was not implemented.\n", __func__);<br>
>>>>>> - return 0;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (request->min_sclk ||<br>
>>>>>> - request->min_mclk ||<br>
>>>>>> - request->activity_threshold ||<br>
>>>>>> - request->up_hyst ||<br>
>>>>>> - request->down_hyst) {<br>
>>>>>> - if (request->type == AMD_PP_GFX_PROFILE)<br>
>>>>>> - memcpy(&hwmgr->gfx_power_profile, request,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else if (request->type == AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - memcpy(&hwmgr->compute_power_profile, request,<br>
>>>>>> - sizeof(struct amd_pp_profile));<br>
>>>>>> - else<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (request->type == hwmgr->current_power_profile)<br>
>>>>>> - ret =<br>
>>>>>> hwmgr->hwmgr_func->set_power_profile_state(<br>
>>>>>> - hwmgr,<br>
>>>>>> - request);<br>
>>>>>> - } else {<br>
>>>>>> - /* set power profile if it exists */<br>
>>>>>> - switch (request->type) {<br>
>>>>>> - case AMD_PP_GFX_PROFILE:<br>
>>>>>> - ret =<br>
>>>>>> hwmgr->hwmgr_func->set_power_profile_state(<br>
>>>>>> - hwmgr,<br>
>>>>>> - &hwmgr->gfx_power_profile);<br>
>>>>>> - break;<br>
>>>>>> - case AMD_PP_COMPUTE_PROFILE:<br>
>>>>>> - ret =<br>
>>>>>> hwmgr->hwmgr_func->set_power_profile_state(<br>
>>>>>> - hwmgr,<br>
>>>>>> - &hwmgr->compute_power_profile);<br>
>>>>>> - break;<br>
>>>>>> - default:<br>
>>>>>> - return -EINVAL;<br>
>>>>>> - }<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (!ret)<br>
>>>>>> - hwmgr->current_power_profile = request->type;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int pp_dpm_switch_power_profile(void *handle,<br>
>>>>>> enum amd_pp_profile_type type)<br>
>>>>>> {<br>
>>>>>> @@ -1590,9 +1479,6 @@ static int pp_set_mmhub_powergating_by_smu(void<br>
>>>>>> *handle)<br>
>>>>>> .set_mclk_od = pp_dpm_set_mclk_od,<br>
>>>>>> .read_sensor = pp_dpm_read_sensor,<br>
>>>>>> .get_vce_clock_state = pp_dpm_get_vce_clock_state,<br>
>>>>>> - .reset_power_profile_state = pp_dpm_reset_power_profile_state,<br>
>>>>>> - .get_power_profile_state = pp_dpm_get_power_profile_state,<br>
>>>>>> - .set_power_profile_state = pp_dpm_set_power_profile_state,<br>
>>>>>> .switch_power_profile = pp_dpm_switch_power_profile,<br>
>>>>>> .set_clockgating_by_smu = pp_set_clockgating_by_smu,<br>
>>>>>> .notify_smu_memory_info = pp_dpm_notify_smu_memory_info,<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c<br>
>>>>>> index 33480de..f06f8f4 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c<br>
>>>>>> @@ -128,23 +128,6 @@ int phm_force_dpm_levels(struct pp_hwmgr *hwmgr,<br>
>>>>>> enum amd_dpm_forced_level level<br>
>>>>>> return ret;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -int phm_reset_power_profile_state(struct pp_hwmgr *hwmgr)<br>
>>>>>> -{<br>
>>>>>> - int ret = 0;<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->hwmgr_func->set_power_profile_state) {<br>
>>>>>> - if (hwmgr->current_power_profile == AMD_PP_GFX_PROFILE)<br>
>>>>>> - ret =<br>
>>>>>> hwmgr->hwmgr_func->set_power_profile_state(<br>
>>>>>> - hwmgr,<br>
>>>>>> - &hwmgr->gfx_power_profile);<br>
>>>>>> - else if (hwmgr->current_power_profile ==<br>
>>>>>> AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - ret =<br>
>>>>>> hwmgr->hwmgr_func->set_power_profile_state(<br>
>>>>>> - hwmgr,<br>
>>>>>> - &hwmgr->compute_power_profile);<br>
>>>>>> - }<br>
>>>>>> - return ret;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> int phm_apply_state_adjust_rules(struct pp_hwmgr *hwmgr,<br>
>>>>>> struct pp_power_state *adjusted_ps,<br>
>>>>>> const struct pp_power_state *current_ps)<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c<br>
>>>>>> index 95ab772..ed3bd15 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/pp_psm.c<br>
>>>>>> @@ -247,8 +247,6 @@ int psm_adjust_power_state_dynamic(struct pp_hwmgr<br>
>>>>>> *hwmgr, bool skip,<br>
>>>>>> if (!phm_force_dpm_levels(hwmgr, hwmgr->request_dpm_level))<br>
>>>>>> hwmgr->dpm_level = hwmgr->request_dpm_level;<br>
>>>>>><br>
>>>>>> - phm_reset_power_profile_state(hwmgr);<br>
>>>>>> -<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><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 f09c76a..cb75c4f 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c<br>
>>>>>> @@ -4622,89 +4622,6 @@ static int smu7_get_clock_by_type(struct pp_hwmgr<br>
>>>>>> *hwmgr, enum amd_pp_clock_type<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static void smu7_find_min_clock_masks(struct pp_hwmgr *hwmgr,<br>
>>>>>> - uint32_t *sclk_mask, uint32_t *mclk_mask,<br>
>>>>>> - uint32_t min_sclk, uint32_t min_mclk)<br>
>>>>>> -{<br>
>>>>>> - struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
>>>>>> - struct smu7_dpm_table *dpm_table = &(data->dpm_table);<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->sclk_table.count; i++) {<br>
>>>>>> - if (dpm_table->sclk_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->sclk_table.dpm_levels[i].value >=<br>
>>>>>> min_sclk)<br>
>>>>>> - *sclk_mask |= 1 << i;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->mclk_table.count; i++) {<br>
>>>>>> - if (dpm_table->mclk_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->mclk_table.dpm_levels[i].value >=<br>
>>>>>> min_mclk)<br>
>>>>>> - *mclk_mask |= 1 << i;<br>
>>>>>> - }<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int smu7_set_power_profile_state(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);<br>
>>>>>> - int tmp_result, result = 0;<br>
>>>>>> - uint32_t sclk_mask = 0, mclk_mask = 0;<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->chip_id == CHIP_FIJI) {<br>
>>>>>> - if (request->type == AMD_PP_GFX_PROFILE)<br>
>>>>>> - smu7_enable_power_containment(hwmgr);<br>
>>>>>> - else if (request->type == AMD_PP_COMPUTE_PROFILE)<br>
>>>>>> - smu7_disable_power_containment(hwmgr);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_AUTO)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - if (smum_is_dpm_running(hwmgr)) {<br>
>>>>>> - if (!data->sclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc(hwmgr,<br>
>>>>>> PPSMC_MSG_SCLKDPM_FreezeLevel);<br>
>>>>>> -<br>
>>>>>> - if (!data->mclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc(hwmgr,<br>
>>>>>> PPSMC_MSG_MCLKDPM_FreezeLevel);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - tmp_result = smum_populate_requested_graphic_levels(hwmgr,<br>
>>>>>> request);<br>
>>>>>> - PP_ASSERT_WITH_CODE(!tmp_result,<br>
>>>>>> - "Failed to populate requested graphic levels!",<br>
>>>>>> - result = tmp_result);<br>
>>>>>> -<br>
>>>>>> - if (smum_is_dpm_running(hwmgr)) {<br>
>>>>>> - if (!data->sclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc(hwmgr,<br>
>>>>>> PPSMC_MSG_SCLKDPM_UnfreezeLevel);<br>
>>>>>> -<br>
>>>>>> - if (!data->mclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc(hwmgr,<br>
>>>>>> PPSMC_MSG_MCLKDPM_UnfreezeLevel);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - smu7_find_min_clock_masks(hwmgr, &sclk_mask, &mclk_mask,<br>
>>>>>> - request->min_sclk, request->min_mclk);<br>
>>>>>> -<br>
>>>>>> - if (sclk_mask) {<br>
>>>>>> - if (!data->sclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc_with_parameter(hwmgr,<br>
>>>>>> - PPSMC_MSG_SCLKDPM_SetEnabledMask,<br>
>>>>>> - data->dpm_level_enable_mask.<br>
>>>>>> - sclk_dpm_enable_mask &<br>
>>>>>> - sclk_mask);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (mclk_mask) {<br>
>>>>>> - if (!data->mclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc_with_parameter(hwmgr,<br>
>>>>>> - PPSMC_MSG_MCLKDPM_SetEnabledMask,<br>
>>>>>> - data->dpm_level_enable_mask.<br>
>>>>>> - mclk_dpm_enable_mask &<br>
>>>>>> - mclk_mask);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return result;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int smu7_notify_cac_buffer_info(struct pp_hwmgr *hwmgr,<br>
>>>>>> uint32_t virtual_addr_low,<br>
>>>>>> uint32_t virtual_addr_hi,<br>
>>>>>> @@ -5154,7 +5071,6 @@ static int smu7_set_power_profile_mode(struct<br>
>>>>>> pp_hwmgr *hwmgr, long *input, uint<br>
>>>>>> .get_clock_by_type = smu7_get_clock_by_type,<br>
>>>>>> .read_sensor = smu7_read_sensor,<br>
>>>>>> .dynamic_state_management_disable = smu7_disable_dpm_tasks,<br>
>>>>>> - .set_power_profile_state = smu7_set_power_profile_state,<br>
>>>>>> .avfs_control = smu7_avfs_control,<br>
>>>>>> .disable_smc_firmware_ctf = smu7_thermal_disable_alert,<br>
>>>>>> .start_thermal_controller = smu7_start_thermal_controller,<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 f5df20a..1416d2a 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c<br>
>>>>>> @@ -2405,34 +2405,6 @@ static int<br>
>>>>>> vega10_populate_and_upload_avfs_fuse_override(struct pp_hwmgr *hwmgr)<br>
>>>>>> return result;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int vega10_save_default_power_profile(struct pp_hwmgr *hwmgr)<br>
>>>>>> -{<br>
>>>>>> - struct vega10_hwmgr *data = (struct vega10_hwmgr<br>
>>>>>> *)(hwmgr->backend);<br>
>>>>>> - struct vega10_single_dpm_table *dpm_table =<br>
>>>>>> &(data->dpm_table.gfx_table);<br>
>>>>>> - uint32_t min_level;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_gfx_power_profile.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> - hwmgr->default_compute_power_profile.type =<br>
>>>>>> AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - /* Optimize compute power profile: Use only highest<br>
>>>>>> - * 2 power levels (if more than 2 are available)<br>
>>>>>> - */<br>
>>>>>> - if (dpm_table->count > 2)<br>
>>>>>> - min_level = dpm_table->count - 2;<br>
>>>>>> - else if (dpm_table->count == 2)<br>
>>>>>> - min_level = 1;<br>
>>>>>> - else<br>
>>>>>> - min_level = 0;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_compute_power_profile.min_sclk =<br>
>>>>>> - dpm_table->dpm_levels[min_level].value;<br>
>>>>>> -<br>
>>>>>> - hwmgr->gfx_power_profile = hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->compute_power_profile =<br>
>>>>>> hwmgr->default_compute_power_profile;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> /**<br>
>>>>>> * Initializes the SMC table and uploads it<br>
>>>>>> *<br>
>>>>>> @@ -2576,7 +2548,6 @@ static int vega10_init_smc_table(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> PP_ASSERT_WITH_CODE(!result, "Attempt to enable AVFS feature<br>
>>>>>> Failed!",<br>
>>>>>> return result);<br>
>>>>>> vega10_acg_enable(hwmgr);<br>
>>>>>> - vega10_save_default_power_profile(hwmgr);<br>
>>>>>><br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>> @@ -4729,62 +4700,6 @@ static int vega10_power_off_asic(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> return result;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static void vega10_find_min_clock_index(struct pp_hwmgr *hwmgr,<br>
>>>>>> - uint32_t *sclk_idx, uint32_t *mclk_idx,<br>
>>>>>> - uint32_t min_sclk, uint32_t min_mclk)<br>
>>>>>> -{<br>
>>>>>> - struct vega10_hwmgr *data = (struct vega10_hwmgr<br>
>>>>>> *)(hwmgr->backend);<br>
>>>>>> - struct vega10_dpm_table *dpm_table = &(data->dpm_table);<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->gfx_table.count; i++) {<br>
>>>>>> - if (dpm_table->gfx_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->gfx_table.dpm_levels[i].value >=<br>
>>>>>> min_sclk) {<br>
>>>>>> - *sclk_idx = i;<br>
>>>>>> - break;<br>
>>>>>> - }<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < dpm_table->mem_table.count; i++) {<br>
>>>>>> - if (dpm_table->mem_table.dpm_levels[i].enabled &&<br>
>>>>>> - dpm_table->mem_table.dpm_levels[i].value >=<br>
>>>>>> min_mclk) {<br>
>>>>>> - *mclk_idx = i;<br>
>>>>>> - break;<br>
>>>>>> - }<br>
>>>>>> - }<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -static int vega10_set_power_profile_state(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct vega10_hwmgr *data = (struct vega10_hwmgr<br>
>>>>>> *)(hwmgr->backend);<br>
>>>>>> - uint32_t sclk_idx = ~0, mclk_idx = ~0;<br>
>>>>>> -<br>
>>>>>> - if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_AUTO)<br>
>>>>>> - return -EINVAL;<br>
>>>>>> -<br>
>>>>>> - vega10_find_min_clock_index(hwmgr, &sclk_idx, &mclk_idx,<br>
>>>>>> - request->min_sclk, request->min_mclk);<br>
>>>>>> -<br>
>>>>>> - if (sclk_idx != ~0) {<br>
>>>>>> - if (!data->registry_data.sclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc_with_parameter(<br>
>>>>>> - hwmgr,<br>
>>>>>> -<br>
>>>>>> PPSMC_MSG_SetSoftMinGfxclkByIndex,<br>
>>>>>> - sclk_idx);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - if (mclk_idx != ~0) {<br>
>>>>>> - if (!data->registry_data.mclk_dpm_key_disabled)<br>
>>>>>> - smum_send_msg_to_smc_with_parameter(<br>
>>>>>> - hwmgr,<br>
>>>>>> - PPSMC_MSG_SetSoftMinUclkByIndex,<br>
>>>>>> - mclk_idx);<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int vega10_get_sclk_od(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> struct vega10_hwmgr *data = (struct vega10_hwmgr<br>
>>>>>> *)(hwmgr->backend);<br>
>>>>>> @@ -5078,7 +4993,6 @@ static int vega10_set_power_profile_mode(struct<br>
>>>>>> pp_hwmgr *hwmgr, long *input, ui<br>
>>>>>><br>
>>>>>> vega10_check_smc_update_required_for_display_configuration,<br>
>>>>>> .power_off_asic = vega10_power_off_asic,<br>
>>>>>> .disable_smc_firmware_ctf = vega10_thermal_disable_alert,<br>
>>>>>> - .set_power_profile_state = vega10_set_power_profile_state,<br>
>>>>>> .get_sclk_od = vega10_get_sclk_od,<br>
>>>>>> .set_sclk_od = vega10_set_sclk_od,<br>
>>>>>> .get_mclk_od = vega10_get_mclk_od,<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h<br>
>>>>>> index 6f528e6..b366a5b 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h<br>
>>>>>> @@ -448,6 +448,5 @@ extern int phm_display_clock_voltage_request(struct<br>
>>>>>> pp_hwmgr *hwmgr,<br>
>>>>>><br>
>>>>>> extern int phm_get_max_high_clocks(struct pp_hwmgr *hwmgr, struct<br>
>>>>>> amd_pp_simple_clock_info *clocks);<br>
>>>>>> extern int phm_disable_smc_firmware_ctf(struct pp_hwmgr *hwmgr);<br>
>>>>>> -extern int phm_reset_power_profile_state(struct pp_hwmgr *hwmgr);<br>
>>>>>> #endif /* _HARDWARE_MANAGER_H_ */<br>
>>>>>><br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
>>>>>> index 7b19be4..a3beb31 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h<br>
>>>>>> @@ -236,8 +236,6 @@ struct pp_smumgr_func {<br>
>>>>>> uint32_t (*get_offsetof)(uint32_t type, uint32_t member);<br>
>>>>>> uint32_t (*get_mac_definition)(uint32_t value);<br>
>>>>>> bool (*is_dpm_running)(struct pp_hwmgr *hwmgr);<br>
>>>>>> - int (*populate_requested_graphic_levels)(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request);<br>
>>>>>> bool (*is_hw_avfs_present)(struct pp_hwmgr *hwmgr);<br>
>>>>>> int (*update_dpm_settings)(struct pp_hwmgr *hwmgr, void<br>
>>>>>> *profile_setting);<br>
>>>>>> };<br>
>>>>>> @@ -329,8 +327,6 @@ struct pp_hwmgr_func {<br>
>>>>>> int (*get_mclk_od)(struct pp_hwmgr *hwmgr);<br>
>>>>>> int (*set_mclk_od)(struct pp_hwmgr *hwmgr, uint32_t value);<br>
>>>>>> int (*read_sensor)(struct pp_hwmgr *hwmgr, int idx, void<br>
>>>>>> *value, int *size);<br>
>>>>>> - int (*set_power_profile_state)(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request);<br>
>>>>>> int (*avfs_control)(struct pp_hwmgr *hwmgr, bool enable);<br>
>>>>>> int (*disable_smc_firmware_ctf)(struct pp_hwmgr *hwmgr);<br>
>>>>>> int (*set_active_display_count)(struct pp_hwmgr *hwmgr,<br>
>>>>>> uint32_t count);<br>
>>>>>> @@ -752,11 +748,6 @@ struct pp_hwmgr {<br>
>>>>>> uint32_t feature_mask;<br>
>>>>>><br>
>>>>>> /* UMD Pstate */<br>
>>>>>> - struct amd_pp_profile gfx_power_profile;<br>
>>>>>> - struct amd_pp_profile compute_power_profile;<br>
>>>>>> - struct amd_pp_profile default_gfx_power_profile;<br>
>>>>>> - struct amd_pp_profile default_compute_power_profile;<br>
>>>>>> - enum amd_pp_profile_type current_power_profile;<br>
>>>>>> bool en_umd_pstate;<br>
>>>>>> uint32_t power_profile_mode;<br>
>>>>>> uint32_t default_power_profile_mode;<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
>>>>>> index e05a57e..e1f6e83 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/inc/smumgr.h<br>
>>>>>> @@ -129,9 +129,6 @@ extern uint32_t smum_get_offsetof(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>><br>
>>>>>> extern bool smum_is_dpm_running(struct pp_hwmgr *hwmgr);<br>
>>>>>><br>
>>>>>> -extern int smum_populate_requested_graphic_levels(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request);<br>
>>>>>> -<br>
>>>>>> extern bool smum_is_hw_avfs_present(struct pp_hwmgr *hwmgr);<br>
>>>>>><br>
>>>>>> extern int smum_update_dpm_settings(struct pp_hwmgr *hwmgr, void<br>
>>>>>> *profile_setting);<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
>>>>>> index 6dd10ef..6f4bf7e 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/ci_smumgr.c<br>
>>>>>> @@ -2772,32 +2772,6 @@ static bool ci_is_dpm_running(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> return ci_is_smc_ram_running(hwmgr);<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int ci_populate_requested_graphic_levels(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile<br>
>>>>>> *request)<br>
>>>>>> -{<br>
>>>>>> - struct ci_smumgr *smu_data = (struct ci_smumgr *)<br>
>>>>>> - (hwmgr->smu_backend);<br>
>>>>>> - struct SMU7_Discrete_GraphicsLevel *levels =<br>
>>>>>> - smu_data->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t array = smu_data->dpm_table_start +<br>
>>>>>> - offsetof(SMU7_Discrete_DpmTable, GraphicsLevel);<br>
>>>>>> - uint32_t array_size = sizeof(struct SMU7_Discrete_GraphicsLevel)<br>
>>>>>> *<br>
>>>>>> - SMU7_MAX_LEVELS_GRAPHICS;<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount;<br>
>>>>>> i++) {<br>
>>>>>> - levels[i].ActivityLevel =<br>
>>>>>> -<br>
>>>>>> cpu_to_be16(request->activity_threshold);<br>
>>>>>> - levels[i].EnabledForActivity = 1;<br>
>>>>>> - levels[i].UpH = request->up_hyst;<br>
>>>>>> - levels[i].DownH = request->down_hyst;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return ci_copy_bytes_to_smc(hwmgr, array, (uint8_t *)levels,<br>
>>>>>> - array_size, SMC_RAM_END);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> -<br>
>>>>>> static int ci_smu_init(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> struct ci_smumgr *ci_priv = NULL;<br>
>>>>>> @@ -2942,6 +2916,5 @@ static int ci_update_dpm_settings(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>> .get_mac_definition = ci_get_mac_definition,<br>
>>>>>> .initialize_mc_reg_table = ci_initialize_mc_reg_table,<br>
>>>>>> .is_dpm_running = ci_is_dpm_running,<br>
>>>>>> - .populate_requested_graphic_levels =<br>
>>>>>> ci_populate_requested_graphic_levels,<br>
>>>>>> .update_dpm_settings = ci_update_dpm_settings,<br>
>>>>>> };<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
>>>>>> index f7f58f77..220159f 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/fiji_smumgr.c<br>
>>>>>> @@ -1960,44 +1960,6 @@ static int fiji_init_arb_table_index(struct<br>
>>>>>> pp_hwmgr *hwmgr)<br>
>>>>>> smu_data->smu7_data.arb_table_start, tmp,<br>
>>>>>> SMC_RAM_END);<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int fiji_save_default_power_profile(struct pp_hwmgr *hwmgr)<br>
>>>>>> -{<br>
>>>>>> - struct fiji_smumgr *data = (struct fiji_smumgr<br>
>>>>>> *)(hwmgr->smu_backend);<br>
>>>>>> - struct SMU73_Discrete_GraphicsLevel *levels =<br>
>>>>>> - data->smc_state_table.GraphicsLevel;<br>
>>>>>> - unsigned min_level = 1;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_gfx_power_profile.activity_threshold =<br>
>>>>>> - be16_to_cpu(levels[0].ActivityLevel);<br>
>>>>>> - hwmgr->default_gfx_power_profile.up_hyst = levels[0].UpHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.down_hyst = levels[0].DownHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_compute_power_profile =<br>
>>>>>> hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->default_compute_power_profile.type =<br>
>>>>>> AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - /* Workaround compute SDMA instability: disable lowest SCLK<br>
>>>>>> - * DPM level. Optimize compute power profile: Use only highest<br>
>>>>>> - * 2 power levels (if more than 2 are available), Hysteresis:<br>
>>>>>> - * 0ms up, 5ms down<br>
>>>>>> - */<br>
>>>>>> - if (data->smc_state_table.GraphicsDpmLevelCount > 2)<br>
>>>>>> - min_level = data->smc_state_table.GraphicsDpmLevelCount<br>
>>>>>> - 2;<br>
>>>>>> - else if (data->smc_state_table.GraphicsDpmLevelCount == 2)<br>
>>>>>> - min_level = 1;<br>
>>>>>> - else<br>
>>>>>> - min_level = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.min_sclk =<br>
>>>>>> - be32_to_cpu(levels[min_level].SclkFrequency);<br>
>>>>>> - hwmgr->default_compute_power_profile.up_hyst = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.down_hyst = 5;<br>
>>>>>> -<br>
>>>>>> - hwmgr->gfx_power_profile = hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->compute_power_profile =<br>
>>>>>> hwmgr->default_compute_power_profile;<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int fiji_setup_dpm_led_config(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> pp_atomctrl_voltage_table param_led_dpm;<br>
>>>>>> @@ -2238,8 +2200,6 @@ static int fiji_init_smc_table(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> PP_ASSERT_WITH_CODE(0 == result,<br>
>>>>>> "Failed to setup dpm led config", return<br>
>>>>>> result);<br>
>>>>>><br>
>>>>>> - fiji_save_default_power_profile(hwmgr);<br>
>>>>>> -<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> @@ -2694,31 +2654,6 @@ static bool fiji_is_dpm_running(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> ? true : false;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int fiji_populate_requested_graphic_levels(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct fiji_smumgr *smu_data = (struct fiji_smumgr *)<br>
>>>>>> - (hwmgr->smu_backend);<br>
>>>>>> - struct SMU73_Discrete_GraphicsLevel *levels =<br>
>>>>>> - smu_data->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t array = smu_data->smu7_data.dpm_table_start +<br>
>>>>>> - offsetof(SMU73_Discrete_DpmTable,<br>
>>>>>> GraphicsLevel);<br>
>>>>>> - uint32_t array_size = sizeof(struct<br>
>>>>>> SMU73_Discrete_GraphicsLevel) *<br>
>>>>>> - SMU73_MAX_LEVELS_GRAPHICS;<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount;<br>
>>>>>> i++) {<br>
>>>>>> - levels[i].ActivityLevel =<br>
>>>>>> -<br>
>>>>>> cpu_to_be16(request->activity_threshold);<br>
>>>>>> - levels[i].EnabledForActivity = 1;<br>
>>>>>> - levels[i].UpHyst = request->up_hyst;<br>
>>>>>> - levels[i].DownHyst = request->down_hyst;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return smu7_copy_bytes_to_smc(hwmgr, array, (uint8_t *)levels,<br>
>>>>>> - array_size, SMC_RAM_END);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int fiji_update_dpm_settings(struct pp_hwmgr *hwmgr,<br>
>>>>>> void *profile_setting)<br>
>>>>>> {<br>
>>>>>> @@ -2838,7 +2773,6 @@ static int fiji_update_dpm_settings(struct<br>
>>>>>> pp_hwmgr *hwmgr,<br>
>>>>>> .get_mac_definition = fiji_get_mac_definition,<br>
>>>>>> .initialize_mc_reg_table = fiji_initialize_mc_reg_table,<br>
>>>>>> .is_dpm_running = fiji_is_dpm_running,<br>
>>>>>> - .populate_requested_graphic_levels =<br>
>>>>>> fiji_populate_requested_graphic_levels,<br>
>>>>>> .is_hw_avfs_present = fiji_is_hw_avfs_present,<br>
>>>>>> .update_dpm_settings = fiji_update_dpm_settings,<br>
>>>>>> };<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
>>>>>> index ae07b5d..75f46ed 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/polaris10_smumgr.c<br>
>>>>>> @@ -1840,42 +1840,6 @@ static void<br>
>>>>>> polaris10_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr)<br>
>>>>>><br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static void polaris10_save_default_power_profile(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> -{<br>
>>>>>> - struct polaris10_smumgr *data = (struct polaris10_smumgr<br>
>>>>>> *)(hwmgr->smu_backend);<br>
>>>>>> - struct SMU74_Discrete_GraphicsLevel *levels =<br>
>>>>>> - data->smc_state_table.GraphicsLevel;<br>
>>>>>> - unsigned min_level = 1;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_gfx_power_profile.activity_threshold =<br>
>>>>>> - be16_to_cpu(levels[0].ActivityLevel);<br>
>>>>>> - hwmgr->default_gfx_power_profile.up_hyst = levels[0].UpHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.down_hyst = levels[0].DownHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_compute_power_profile =<br>
>>>>>> hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->default_compute_power_profile.type =<br>
>>>>>> AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - /* Workaround compute SDMA instability: disable lowest SCLK<br>
>>>>>> - * DPM level. Optimize compute power profile: Use only highest<br>
>>>>>> - * 2 power levels (if more than 2 are available), Hysteresis:<br>
>>>>>> - * 0ms up, 5ms down<br>
>>>>>> - */<br>
>>>>>> - if (data->smc_state_table.GraphicsDpmLevelCount > 2)<br>
>>>>>> - min_level = data->smc_state_table.GraphicsDpmLevelCount<br>
>>>>>> - 2;<br>
>>>>>> - else if (data->smc_state_table.GraphicsDpmLevelCount == 2)<br>
>>>>>> - min_level = 1;<br>
>>>>>> - else<br>
>>>>>> - min_level = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.min_sclk =<br>
>>>>>> -<br>
>>>>>> be32_to_cpu(levels[min_level].SclkSetting.SclkFrequency);<br>
>>>>>> - hwmgr->default_compute_power_profile.up_hyst = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.down_hyst = 5;<br>
>>>>>> -<br>
>>>>>> - hwmgr->gfx_power_profile = hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->compute_power_profile =<br>
>>>>>> hwmgr->default_compute_power_profile;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int polaris10_init_smc_table(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> int result;<br>
>>>>>> @@ -2090,8 +2054,6 @@ static int polaris10_init_smc_table(struct<br>
>>>>>> pp_hwmgr *hwmgr)<br>
>>>>>> PP_ASSERT_WITH_CODE(0 == result,<br>
>>>>>> "Failed to populate PM fuses to SMC memory!",<br>
>>>>>> return result);<br>
>>>>>><br>
>>>>>> - polaris10_save_default_power_profile(hwmgr);<br>
>>>>>> -<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> @@ -2550,31 +2512,6 @@ static bool polaris10_is_dpm_running(struct<br>
>>>>>> pp_hwmgr *hwmgr)<br>
>>>>>> ? true : false;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int polaris10_populate_requested_graphic_levels(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct polaris10_smumgr *smu_data = (struct polaris10_smumgr *)<br>
>>>>>> - (hwmgr->smu_backend);<br>
>>>>>> - struct SMU74_Discrete_GraphicsLevel *levels =<br>
>>>>>> - smu_data->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t array = smu_data->smu7_data.dpm_table_start +<br>
>>>>>> - offsetof(SMU74_Discrete_DpmTable,<br>
>>>>>> GraphicsLevel);<br>
>>>>>> - uint32_t array_size = sizeof(struct<br>
>>>>>> SMU74_Discrete_GraphicsLevel) *<br>
>>>>>> - SMU74_MAX_LEVELS_GRAPHICS;<br>
>>>>>> - uint32_t i;<br>
>>>>>> -<br>
>>>>>> - for (i = 0; i < smu_data->smc_state_table.GraphicsDpmLevelCount;<br>
>>>>>> i++) {<br>
>>>>>> - levels[i].ActivityLevel =<br>
>>>>>> -<br>
>>>>>> cpu_to_be16(request->activity_threshold);<br>
>>>>>> - levels[i].EnabledForActivity = 1;<br>
>>>>>> - levels[i].UpHyst = request->up_hyst;<br>
>>>>>> - levels[i].DownHyst = request->down_hyst;<br>
>>>>>> - }<br>
>>>>>> -<br>
>>>>>> - return smu7_copy_bytes_to_smc(hwmgr, array, (uint8_t *)levels,<br>
>>>>>> - array_size, SMC_RAM_END);<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int polaris10_update_dpm_settings(struct pp_hwmgr *hwmgr,<br>
>>>>>> void *profile_setting)<br>
>>>>>> {<br>
>>>>>> @@ -2693,7 +2630,6 @@ static int polaris10_update_dpm_settings(struct<br>
>>>>>> pp_hwmgr *hwmgr,<br>
>>>>>> .populate_all_memory_levels =<br>
>>>>>> polaris10_populate_all_memory_levels,<br>
>>>>>> .get_mac_definition = polaris10_get_mac_definition,<br>
>>>>>> .is_dpm_running = polaris10_is_dpm_running,<br>
>>>>>> - .populate_requested_graphic_levels =<br>
>>>>>> polaris10_populate_requested_graphic_levels,<br>
>>>>>> .is_hw_avfs_present = polaris10_is_hw_avfs_present,<br>
>>>>>> .update_dpm_settings = polaris10_update_dpm_settings,<br>
>>>>>> };<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c<br>
>>>>>> index 1ce4959..43b1010 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/smumgr.c<br>
>>>>>> @@ -236,16 +236,6 @@ bool smum_is_dpm_running(struct pp_hwmgr *hwmgr)<br>
>>>>>> return true;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -int smum_populate_requested_graphic_levels(struct pp_hwmgr *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - if (hwmgr->smumgr_funcs->populate_requested_graphic_levels)<br>
>>>>>> - return<br>
>>>>>> hwmgr->smumgr_funcs->populate_requested_graphic_levels(<br>
>>>>>> - hwmgr, request);<br>
>>>>>> -<br>
>>>>>> - return 0;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> bool smum_is_hw_avfs_present(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> if (hwmgr->smumgr_funcs->is_hw_avfs_present)<br>
>>>>>> diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
>>>>>> b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
>>>>>> index 1fe5b77..8856cc1 100644<br>
>>>>>> --- a/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
>>>>>> +++ b/drivers/gpu/drm/amd/powerplay/smumgr/tonga_smumgr.c<br>
>>>>>> @@ -2263,42 +2263,6 @@ static void<br>
>>>>>> tonga_initialize_power_tune_defaults(struct pp_hwmgr *hwmgr)<br>
>>>>>> smu_data->power_tune_defaults =<br>
>>>>>> &tonga_power_tune_data_set_array[0];<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static void tonga_save_default_power_profile(struct pp_hwmgr *hwmgr)<br>
>>>>>> -{<br>
>>>>>> - struct tonga_smumgr *data = (struct tonga_smumgr<br>
>>>>>> *)(hwmgr->smu_backend);<br>
>>>>>> - struct SMU72_Discrete_GraphicsLevel *levels =<br>
>>>>>> - data->smc_state_table.GraphicsLevel;<br>
>>>>>> - unsigned min_level = 1;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_gfx_power_profile.activity_threshold =<br>
>>>>>> - be16_to_cpu(levels[0].ActivityLevel);<br>
>>>>>> - hwmgr->default_gfx_power_profile.up_hyst = levels[0].UpHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.down_hyst = levels[0].DownHyst;<br>
>>>>>> - hwmgr->default_gfx_power_profile.type = AMD_PP_GFX_PROFILE;<br>
>>>>>> -<br>
>>>>>> - hwmgr->default_compute_power_profile =<br>
>>>>>> hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->default_compute_power_profile.type =<br>
>>>>>> AMD_PP_COMPUTE_PROFILE;<br>
>>>>>> -<br>
>>>>>> - /* Workaround compute SDMA instability: disable lowest SCLK<br>
>>>>>> - * DPM level. Optimize compute power profile: Use only highest<br>
>>>>>> - * 2 power levels (if more than 2 are available), Hysteresis:<br>
>>>>>> - * 0ms up, 5ms down<br>
>>>>>> - */<br>
>>>>>> - if (data->smc_state_table.GraphicsDpmLevelCount > 2)<br>
>>>>>> - min_level = data->smc_state_table.GraphicsDpmLevelCount<br>
>>>>>> - 2;<br>
>>>>>> - else if (data->smc_state_table.GraphicsDpmLevelCount == 2)<br>
>>>>>> - min_level = 1;<br>
>>>>>> - else<br>
>>>>>> - min_level = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.min_sclk =<br>
>>>>>> - be32_to_cpu(levels[min_level].SclkFrequency);<br>
>>>>>> - hwmgr->default_compute_power_profile.up_hyst = 0;<br>
>>>>>> - hwmgr->default_compute_power_profile.down_hyst = 5;<br>
>>>>>> -<br>
>>>>>> - hwmgr->gfx_power_profile = hwmgr->default_gfx_power_profile;<br>
>>>>>> - hwmgr->compute_power_profile =<br>
>>>>>> hwmgr->default_compute_power_profile;<br>
>>>>>> -}<br>
>>>>>> -<br>
>>>>>> static int tonga_init_smc_table(struct pp_hwmgr *hwmgr)<br>
>>>>>> {<br>
>>>>>> int result;<br>
>>>>>> @@ -2540,8 +2504,6 @@ static int tonga_init_smc_table(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> PP_ASSERT_WITH_CODE((!result),<br>
>>>>>> "Failed to populate initialize MC Reg table !", return<br>
>>>>>> result);<br>
>>>>>><br>
>>>>>> - tonga_save_default_power_profile(hwmgr);<br>
>>>>>> -<br>
>>>>>> return 0;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> @@ -3259,31 +3221,6 @@ static bool tonga_is_dpm_running(struct pp_hwmgr<br>
>>>>>> *hwmgr)<br>
>>>>>> ? true : false;<br>
>>>>>> }<br>
>>>>>><br>
>>>>>> -static int tonga_populate_requested_graphic_levels(struct pp_hwmgr<br>
>>>>>> *hwmgr,<br>
>>>>>> - struct amd_pp_profile *request)<br>
>>>>>> -{<br>
>>>>>> - struct tonga_smumgr *smu_data = (struct tonga_smumgr *)<br>
>>>>>> - (hwmgr->smu_backend);<br>
>>>>>> - struct SMU72_Discrete_GraphicsLevel *levels =<br>
>>>>>> - smu_data->smc_state_table.GraphicsLevel;<br>
>>>>>> - uint32_t array = smu_data->smu7_data.dpm_table_start +<br>
>>>>>> - offsetof(SMU72_Discrete_DpmTable,<br>
>>>>>> GraphicsLevel);<br>
<br>
</div>
</span></font></div>
</body>
</html>