diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-09-13 14:07:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-09-15 20:27:52 -0400 |
commit | 1cd8b21aa22c4fe8835abe614da5fa989c66dca9 (patch) | |
tree | 3244aadc48b955547d5f3df5a3d35367dff3f01e /drivers/gpu | |
parent | d592fca9407d065f0754ba29790c66ecbc0366ad (diff) |
drm/radeon/dpm: rework auto performance level enable
Calling force_performance_level() from set_power_state()
doesn't work on some asics because the current power
state pointer has not been properly updated at that point.
Move the calls to force_performance_level() out of the
asic specific set_power_state() functions and into
the main power state sequence.
Fixes dpm resume on SI.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/btc_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/ci_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/cypress_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/kv_dpm.c | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/ni_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 14 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv6xx_dpm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/rv770_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/si_dpm.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/sumo_dpm.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/trinity_dpm.c | 1 |
11 files changed, 9 insertions, 47 deletions
diff --git a/drivers/gpu/drm/radeon/btc_dpm.c b/drivers/gpu/drm/radeon/btc_dpm.c index 084e69414fd1..05ff315e8e9e 100644 --- a/drivers/gpu/drm/radeon/btc_dpm.c +++ b/drivers/gpu/drm/radeon/btc_dpm.c | |||
@@ -2340,12 +2340,6 @@ int btc_dpm_set_power_state(struct radeon_device *rdev) | |||
2340 | return ret; | 2340 | return ret; |
2341 | } | 2341 | } |
2342 | 2342 | ||
2343 | ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
2344 | if (ret) { | ||
2345 | DRM_ERROR("rv770_dpm_force_performance_level failed\n"); | ||
2346 | return ret; | ||
2347 | } | ||
2348 | |||
2349 | return 0; | 2343 | return 0; |
2350 | } | 2344 | } |
2351 | 2345 | ||
diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c index 3cce533397c6..899627443030 100644 --- a/drivers/gpu/drm/radeon/ci_dpm.c +++ b/drivers/gpu/drm/radeon/ci_dpm.c | |||
@@ -4748,12 +4748,6 @@ int ci_dpm_set_power_state(struct radeon_device *rdev) | |||
4748 | if (pi->pcie_performance_request) | 4748 | if (pi->pcie_performance_request) |
4749 | ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps); | 4749 | ci_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps); |
4750 | 4750 | ||
4751 | ret = ci_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
4752 | if (ret) { | ||
4753 | DRM_ERROR("ci_dpm_force_performance_level failed\n"); | ||
4754 | return ret; | ||
4755 | } | ||
4756 | |||
4757 | cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX | | 4751 | cik_update_cg(rdev, (RADEON_CG_BLOCK_GFX | |
4758 | RADEON_CG_BLOCK_MC | | 4752 | RADEON_CG_BLOCK_MC | |
4759 | RADEON_CG_BLOCK_SDMA | | 4753 | RADEON_CG_BLOCK_SDMA | |
diff --git a/drivers/gpu/drm/radeon/cypress_dpm.c b/drivers/gpu/drm/radeon/cypress_dpm.c index 95a66db08d9b..91bb470de0a3 100644 --- a/drivers/gpu/drm/radeon/cypress_dpm.c +++ b/drivers/gpu/drm/radeon/cypress_dpm.c | |||
@@ -2014,12 +2014,6 @@ int cypress_dpm_set_power_state(struct radeon_device *rdev) | |||
2014 | if (eg_pi->pcie_performance_request) | 2014 | if (eg_pi->pcie_performance_request) |
2015 | cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps); | 2015 | cypress_notify_link_speed_change_after_state_change(rdev, new_ps, old_ps); |
2016 | 2016 | ||
2017 | ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
2018 | if (ret) { | ||
2019 | DRM_ERROR("rv770_dpm_force_performance_level failed\n"); | ||
2020 | return ret; | ||
2021 | } | ||
2022 | |||
2023 | return 0; | 2017 | return 0; |
2024 | } | 2018 | } |
2025 | 2019 | ||
diff --git a/drivers/gpu/drm/radeon/kv_dpm.c b/drivers/gpu/drm/radeon/kv_dpm.c index b98b9c97b732..71399065db04 100644 --- a/drivers/gpu/drm/radeon/kv_dpm.c +++ b/drivers/gpu/drm/radeon/kv_dpm.c | |||
@@ -1854,7 +1854,6 @@ int kv_dpm_set_power_state(struct radeon_device *rdev) | |||
1854 | RADEON_CG_BLOCK_BIF | | 1854 | RADEON_CG_BLOCK_BIF | |
1855 | RADEON_CG_BLOCK_HDP), true); | 1855 | RADEON_CG_BLOCK_HDP), true); |
1856 | 1856 | ||
1857 | rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; | ||
1858 | return 0; | 1857 | return 0; |
1859 | } | 1858 | } |
1860 | 1859 | ||
diff --git a/drivers/gpu/drm/radeon/ni_dpm.c b/drivers/gpu/drm/radeon/ni_dpm.c index f7b625c9e0e9..6c398a456d78 100644 --- a/drivers/gpu/drm/radeon/ni_dpm.c +++ b/drivers/gpu/drm/radeon/ni_dpm.c | |||
@@ -3865,12 +3865,6 @@ int ni_dpm_set_power_state(struct radeon_device *rdev) | |||
3865 | return ret; | 3865 | return ret; |
3866 | } | 3866 | } |
3867 | 3867 | ||
3868 | ret = ni_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
3869 | if (ret) { | ||
3870 | DRM_ERROR("ni_dpm_force_performance_level failed\n"); | ||
3871 | return ret; | ||
3872 | } | ||
3873 | |||
3874 | return 0; | 3868 | return 0; |
3875 | } | 3869 | } |
3876 | 3870 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index d41ac8a4224d..87e1d69e8fdb 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -917,10 +917,13 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) | |||
917 | 917 | ||
918 | radeon_dpm_post_set_power_state(rdev); | 918 | radeon_dpm_post_set_power_state(rdev); |
919 | 919 | ||
920 | /* force low perf level for thermal */ | 920 | if (rdev->asic->dpm.force_performance_level) { |
921 | if (rdev->pm.dpm.thermal_active && | 921 | if (rdev->pm.dpm.thermal_active) |
922 | rdev->asic->dpm.force_performance_level) { | 922 | /* force low perf level for thermal */ |
923 | radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_LOW); | 923 | radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_LOW); |
924 | else | ||
925 | /* otherwise, enable auto */ | ||
926 | radeon_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
924 | } | 927 | } |
925 | 928 | ||
926 | done: | 929 | done: |
@@ -1149,9 +1152,10 @@ static int radeon_pm_init_dpm(struct radeon_device *rdev) | |||
1149 | { | 1152 | { |
1150 | int ret; | 1153 | int ret; |
1151 | 1154 | ||
1152 | /* default to performance state */ | 1155 | /* default to balanced state */ |
1153 | rdev->pm.dpm.state = POWER_STATE_TYPE_BALANCED; | 1156 | rdev->pm.dpm.state = POWER_STATE_TYPE_BALANCED; |
1154 | rdev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED; | 1157 | rdev->pm.dpm.user_state = POWER_STATE_TYPE_BALANCED; |
1158 | rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; | ||
1155 | rdev->pm.default_sclk = rdev->clock.default_sclk; | 1159 | rdev->pm.default_sclk = rdev->clock.default_sclk; |
1156 | rdev->pm.default_mclk = rdev->clock.default_mclk; | 1160 | rdev->pm.default_mclk = rdev->clock.default_mclk; |
1157 | rdev->pm.current_sclk = rdev->clock.default_sclk; | 1161 | rdev->pm.current_sclk = rdev->clock.default_sclk; |
diff --git a/drivers/gpu/drm/radeon/rv6xx_dpm.c b/drivers/gpu/drm/radeon/rv6xx_dpm.c index ab1f2016f21e..5811d277a36a 100644 --- a/drivers/gpu/drm/radeon/rv6xx_dpm.c +++ b/drivers/gpu/drm/radeon/rv6xx_dpm.c | |||
@@ -1758,8 +1758,6 @@ int rv6xx_dpm_set_power_state(struct radeon_device *rdev) | |||
1758 | 1758 | ||
1759 | rv6xx_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); | 1759 | rv6xx_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); |
1760 | 1760 | ||
1761 | rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; | ||
1762 | |||
1763 | return 0; | 1761 | return 0; |
1764 | } | 1762 | } |
1765 | 1763 | ||
diff --git a/drivers/gpu/drm/radeon/rv770_dpm.c b/drivers/gpu/drm/radeon/rv770_dpm.c index 7282ce7dab76..913b025ae9b3 100644 --- a/drivers/gpu/drm/radeon/rv770_dpm.c +++ b/drivers/gpu/drm/radeon/rv770_dpm.c | |||
@@ -2064,12 +2064,6 @@ int rv770_dpm_set_power_state(struct radeon_device *rdev) | |||
2064 | rv770_program_dcodt_after_state_switch(rdev, new_ps, old_ps); | 2064 | rv770_program_dcodt_after_state_switch(rdev, new_ps, old_ps); |
2065 | rv770_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); | 2065 | rv770_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); |
2066 | 2066 | ||
2067 | ret = rv770_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
2068 | if (ret) { | ||
2069 | DRM_ERROR("rv770_dpm_force_performance_level failed\n"); | ||
2070 | return ret; | ||
2071 | } | ||
2072 | |||
2073 | return 0; | 2067 | return 0; |
2074 | } | 2068 | } |
2075 | 2069 | ||
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index 5be9b4e72350..cfe5d4d28915 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c | |||
@@ -6075,12 +6075,6 @@ int si_dpm_set_power_state(struct radeon_device *rdev) | |||
6075 | return ret; | 6075 | return ret; |
6076 | } | 6076 | } |
6077 | 6077 | ||
6078 | ret = si_dpm_force_performance_level(rdev, RADEON_DPM_FORCED_LEVEL_AUTO); | ||
6079 | if (ret) { | ||
6080 | DRM_ERROR("si_dpm_force_performance_level failed\n"); | ||
6081 | return ret; | ||
6082 | } | ||
6083 | |||
6084 | si_update_cg(rdev, (RADEON_CG_BLOCK_GFX | | 6078 | si_update_cg(rdev, (RADEON_CG_BLOCK_GFX | |
6085 | RADEON_CG_BLOCK_MC | | 6079 | RADEON_CG_BLOCK_MC | |
6086 | RADEON_CG_BLOCK_SDMA | | 6080 | RADEON_CG_BLOCK_SDMA | |
diff --git a/drivers/gpu/drm/radeon/sumo_dpm.c b/drivers/gpu/drm/radeon/sumo_dpm.c index 864761c0120e..96ea6db8bf57 100644 --- a/drivers/gpu/drm/radeon/sumo_dpm.c +++ b/drivers/gpu/drm/radeon/sumo_dpm.c | |||
@@ -1319,8 +1319,6 @@ int sumo_dpm_set_power_state(struct radeon_device *rdev) | |||
1319 | if (pi->enable_dpm) | 1319 | if (pi->enable_dpm) |
1320 | sumo_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); | 1320 | sumo_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); |
1321 | 1321 | ||
1322 | rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; | ||
1323 | |||
1324 | return 0; | 1322 | return 0; |
1325 | } | 1323 | } |
1326 | 1324 | ||
diff --git a/drivers/gpu/drm/radeon/trinity_dpm.c b/drivers/gpu/drm/radeon/trinity_dpm.c index 4beb9992294a..7f998bf1cc9d 100644 --- a/drivers/gpu/drm/radeon/trinity_dpm.c +++ b/drivers/gpu/drm/radeon/trinity_dpm.c | |||
@@ -1236,7 +1236,6 @@ int trinity_dpm_set_power_state(struct radeon_device *rdev) | |||
1236 | trinity_force_level_0(rdev); | 1236 | trinity_force_level_0(rdev); |
1237 | trinity_unforce_levels(rdev); | 1237 | trinity_unforce_levels(rdev); |
1238 | trinity_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); | 1238 | trinity_set_uvd_clock_after_set_eng_clock(rdev, new_ps, old_ps); |
1239 | rdev->pm.dpm.forced_level = RADEON_DPM_FORCED_LEVEL_AUTO; | ||
1240 | } | 1239 | } |
1241 | trinity_release_mutex(rdev); | 1240 | trinity_release_mutex(rdev); |
1242 | 1241 | ||