From 704759315a7c906147c9aa5f2a9a7b6145226a98 Mon Sep 17 00:00:00 2001 From: Evan Quan Date: Wed, 8 Jul 2020 13:06:04 +0800 Subject: drm/amd/powerplay: revise the calling flow on OD table update This can eliminate the cross callings and maintain clear code layer. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 8 +++++++- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 7 ------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c index 9de6faa42171..0d90cd76d30f 100644 --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c @@ -1914,8 +1914,14 @@ int smu_od_edit_dpm_table(struct smu_context *smu, mutex_lock(&smu->mutex); - if (smu->ppt_funcs->od_edit_dpm_table) + if (smu->ppt_funcs->od_edit_dpm_table) { ret = smu->ppt_funcs->od_edit_dpm_table(smu, type, input, size); + if (!ret && (type == PP_OD_COMMIT_DPM_TABLE)) + ret = smu_handle_task(smu, + smu->smu_dpm.dpm_level, + AMD_PP_TASK_READJUST_POWER_STATE, + false); + } mutex_unlock(&smu->mutex); diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c index b39e7687c2f7..47aa497591ec 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c @@ -2109,13 +2109,6 @@ static int navi10_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABL dev_err(smu->adev->dev, "Failed to import overdrive table!\n"); return ret; } - // no lock needed because smu_od_edit_dpm_table has it - ret = smu_handle_task(smu, smu->smu_dpm.dpm_level, - AMD_PP_TASK_READJUST_POWER_STATE, - false); - if (ret) { - return ret; - } break; case PP_OD_EDIT_VDDC_CURVE: if (!navi10_od_feature_is_supported(od_settings, SMU_11_0_ODCAP_GFXCLK_CURVE)) { -- cgit v1.2.3