aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/si_dpm.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2018-06-04 04:39:38 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-06-15 13:20:45 -0400
commit600ae890be59910e65b75fe25a1b900d83c0329c (patch)
tree5e7472260ca37f77c496304b36e36eb929f41006 /drivers/gpu/drm/amd/amdgpu/si_dpm.c
parentc5792d7776e61737af200bf6f0d15354b5a3d205 (diff)
drm/amdgpu: Use real power source in powerplay instand of hardcode
1. move ac_power to struct pm from dpm, so can be shared with powerplay 2. remove power_source in powerplay, use adev->pm.ac_power instand. 3. update ac_power before dispatch power task. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/si_dpm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/si_dpm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/si_dpm.c b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
index b12d7c9d42a0..9567dd0a01bc 100644
--- a/drivers/gpu/drm/amd/amdgpu/si_dpm.c
+++ b/drivers/gpu/drm/amd/amdgpu/si_dpm.c
@@ -3480,7 +3480,7 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
3480 disable_sclk_switching = true; 3480 disable_sclk_switching = true;
3481 } 3481 }
3482 3482
3483 if (adev->pm.dpm.ac_power) 3483 if (adev->pm.ac_power)
3484 max_limits = &adev->pm.dpm.dyn_state.max_clock_voltage_on_ac; 3484 max_limits = &adev->pm.dpm.dyn_state.max_clock_voltage_on_ac;
3485 else 3485 else
3486 max_limits = &adev->pm.dpm.dyn_state.max_clock_voltage_on_dc; 3486 max_limits = &adev->pm.dpm.dyn_state.max_clock_voltage_on_dc;
@@ -3489,7 +3489,7 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev,
3489 if (ps->performance_levels[i].vddc > ps->performance_levels[i+1].vddc) 3489 if (ps->performance_levels[i].vddc > ps->performance_levels[i+1].vddc)
3490 ps->performance_levels[i].vddc = ps->performance_levels[i+1].vddc; 3490 ps->performance_levels[i].vddc = ps->performance_levels[i+1].vddc;
3491 } 3491 }
3492 if (adev->pm.dpm.ac_power == false) { 3492 if (adev->pm.ac_power == false) {
3493 for (i = 0; i < ps->performance_level_count; i++) { 3493 for (i = 0; i < ps->performance_level_count; i++) {
3494 if (ps->performance_levels[i].mclk > max_limits->mclk) 3494 if (ps->performance_levels[i].mclk > max_limits->mclk)
3495 ps->performance_levels[i].mclk = max_limits->mclk; 3495 ps->performance_levels[i].mclk = max_limits->mclk;