Skip to content

Commit 7047593

Browse files
Evan Quanalexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2132672 commit 7047593

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1914,8 +1914,14 @@ int smu_od_edit_dpm_table(struct smu_context *smu,
19141914

19151915
mutex_lock(&smu->mutex);
19161916

1917-
if (smu->ppt_funcs->od_edit_dpm_table)
1917+
if (smu->ppt_funcs->od_edit_dpm_table) {
19181918
ret = smu->ppt_funcs->od_edit_dpm_table(smu, type, input, size);
1919+
if (!ret && (type == PP_OD_COMMIT_DPM_TABLE))
1920+
ret = smu_handle_task(smu,
1921+
smu->smu_dpm.dpm_level,
1922+
AMD_PP_TASK_READJUST_POWER_STATE,
1923+
false);
1924+
}
19191925

19201926
mutex_unlock(&smu->mutex);
19211927

drivers/gpu/drm/amd/powerplay/navi10_ppt.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2109,13 +2109,6 @@ static int navi10_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABL
21092109
dev_err(smu->adev->dev, "Failed to import overdrive table!\n");
21102110
return ret;
21112111
}
2112-
// no lock needed because smu_od_edit_dpm_table has it
2113-
ret = smu_handle_task(smu, smu->smu_dpm.dpm_level,
2114-
AMD_PP_TASK_READJUST_POWER_STATE,
2115-
false);
2116-
if (ret) {
2117-
return ret;
2118-
}
21192112
break;
21202113
case PP_OD_EDIT_VDDC_CURVE:
21212114
if (!navi10_od_feature_is_supported(od_settings, SMU_11_0_ODCAP_GFXCLK_CURVE)) {

0 commit comments

Comments
 (0)