diff options
author | Matt Coffin <mcoffin13@gmail.com> | 2020-01-25 21:04:05 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-02-04 18:37:51 +0300 |
commit | 93c5f1f66c6ad4a3b180c1644f74e1b3b4be7864 (patch) | |
tree | 7ccec5f412eb3458e3b24665afe55465fa979d3b /drivers/gpu/drm/amd/powerplay/navi10_ppt.c | |
parent | ee23a518fdc2c1dd1aaaf3a2c7ffdd6c83b396ec (diff) | |
download | linux-93c5f1f66c6ad4a3b180c1644f74e1b3b4be7864.tar.xz |
drm/amdgpu/smu_v11_0: Correct behavior of restoring default tables (v2)
Previously, the syfs functionality for restoring the default powerplay
table was sourcing it's information from the currently-staged powerplay
table.
This patch adds a step to cache the first overdrive table that we see on
boot, so that it can be used later to "restore" the powerplay table
v2: sqaush my original with Matt's fix
Bug: https://gitlab.freedesktop.org/drm/amd/issues/1020
Signed-off-by: Matt Coffin <mcoffin13@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 5.5.x
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/navi10_ppt.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c index a0a6dc2c190a..272e58510d0d 100644 --- a/drivers/gpu/drm/amd/powerplay/navi10_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/navi10_ppt.c @@ -2065,6 +2065,13 @@ static int navi10_od_edit_dpm_table(struct smu_context *smu, enum PP_OD_DPM_TABL return ret; od_table->UclkFmax = input[1]; break; + case PP_OD_RESTORE_DEFAULT_TABLE: + if (!(table_context->overdrive_table && table_context->boot_overdrive_table)) { + pr_err("Overdrive table was not initialized!\n"); + return -EINVAL; + } + memcpy(table_context->overdrive_table, table_context->boot_overdrive_table, sizeof(OverDriveTable_t)); + break; case PP_OD_COMMIT_DPM_TABLE: navi10_dump_od_table(od_table); ret = smu_update_table(smu, SMU_TABLE_OVERDRIVE, 0, (void *)od_table, true); |