summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
diff options
context:
space:
mode:
authorFelix Kuehling2017-05-15 10:08:28 +0200
committerAlex Deucher2017-05-25 00:09:48 +0200
commite0ec45063609b4a583e7f4d843275888f2480321 (patch)
tree884b1e0f41d825d32d4dd8dbc1a2d6f0ad9a5446 /drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
parentdrm/amdgpu: add raven gpu_info support (diff)
downloadkernel-qcow2-linux-e0ec45063609b4a583e7f4d843275888f2480321.tar.gz
kernel-qcow2-linux-e0ec45063609b4a583e7f4d843275888f2480321.tar.xz
kernel-qcow2-linux-e0ec45063609b4a583e7f4d843275888f2480321.zip
drm/amd/powerplay: Fix Vega10 power profile switching
Clock index 0 is a valid index that is needed to restore the default graphics power profile. Use ~0 to indicate a failure to find a clock index. This fixes the clocks getting stuck in the compute power profile after running a compute application on Vega10. Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Eric Huang <JinHuiEric.Huang@amd.com> Reviewed-by: Tom St Denis <tom.stdenis@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index 825178b5c284..f0c3a8bc1e11 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4583,7 +4583,7 @@ static int vega10_set_power_profile_state(struct pp_hwmgr *hwmgr,
struct amd_pp_profile *request)
{
struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend);
- uint32_t sclk_idx = 0, mclk_idx = 0;
+ uint32_t sclk_idx = ~0, mclk_idx = ~0;
if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_AUTO)
return -EINVAL;
@@ -4591,7 +4591,7 @@ static int vega10_set_power_profile_state(struct pp_hwmgr *hwmgr,
vega10_find_min_clock_index(hwmgr, &sclk_idx, &mclk_idx,
request->min_sclk, request->min_mclk);
- if (sclk_idx) {
+ if (sclk_idx != ~0) {
if (!data->registry_data.sclk_dpm_key_disabled)
PP_ASSERT_WITH_CODE(
!smum_send_msg_to_smc_with_parameter(
@@ -4602,7 +4602,7 @@ static int vega10_set_power_profile_state(struct pp_hwmgr *hwmgr,
return -EINVAL);
}
- if (mclk_idx) {
+ if (mclk_idx != ~0) {
if (!data->registry_data.mclk_dpm_key_disabled)
PP_ASSERT_WITH_CODE(
!smum_send_msg_to_smc_with_parameter(