Skip to content

Commit

Permalink
drm/amdgpu/swSMU: set AC/DC mode based on the current system state (v2)
Browse files Browse the repository at this point in the history
Check of the pointer exists and we are actually on AC power.

v2: fix error message to reflect AC/DC mode.

Bug: https://gitlab.freedesktop.org/drm/amd/issues/1043
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Deucher committed Mar 25, 2020
1 parent 66c2f5d commit 75610fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/gpu/drm/amd/powerplay/amdgpu_smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1155,17 +1155,17 @@ 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");
pr_err("Failed to switch to %s mode!\n", adev->pm.ac_power ? "AC" : "DC");
return ret;
}
}
Expand Down

0 comments on commit 75610fd

Please sign in to comment.