[PATCH 5/8] drm/amdgpu/swSMU: set AC/DC mode based on the current system state
Alex Deucher
alexdeucher at gmail.com
Fri Mar 20 18:27:24 UTC 2020
Check of the pointer exists and we are actually on AC power.
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
index 2cfb911ab370..54d156bbc0f3 100644
--- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
+++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
@@ -1155,15 +1155,15 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
}
}
- if (adev->asic_type >= CHIP_NAVI10 &&
- adev->asic_type <= CHIP_NAVI12) {
+ if (smu->ppt_funcs->set_power_source) {
/*
* For Navi1X, manually switch it to AC mode as PMFW
* may boot it with DC mode.
- * TODO: should check whether we are indeed under AC
- * mode before doing this.
*/
- ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+ if (adev->pm.ac_power)
+ ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+ else
+ ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
if (ret) {
pr_err("Failed to switch to AC mode!\n");
return ret;
--
2.25.1
More information about the amd-gfx
mailing list