drm/amd/powerplay: correct power limit retrieving based on current power source
Instead of hard coding it as SMU_POWER_SOURCE_AC. Signed-off-by: Evan Quan <evan.quan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4cb738ab78
commit
e10d1ecf9d
@ -1065,7 +1065,10 @@ int smu_v11_0_get_current_power_limit(struct smu_context *smu,
|
||||
if (!smu_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT))
|
||||
return -EINVAL;
|
||||
|
||||
power_src = smu_power_get_index(smu, SMU_POWER_SOURCE_AC);
|
||||
power_src = smu_power_get_index(smu,
|
||||
smu->adev->pm.ac_power ?
|
||||
SMU_POWER_SOURCE_AC :
|
||||
SMU_POWER_SOURCE_DC);
|
||||
if (power_src < 0)
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user