diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-01-16 12:52:04 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-06-27 19:16:16 -0400 |
commit | 84dd1928260fe82344c1d587900bce630c1e6e66 (patch) | |
tree | 02598c28ad2991757891b14a7900d57450618a35 /drivers/gpu/drm/radeon/radeon_pm.c | |
parent | 940eea8e4d92ef92e376d48970079386ea2a4bf3 (diff) |
drm/radeon/dpm: add new pre/post_set_power_state callbacks
Needed to properly handle dynamic state adjustment.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 7143c914fc8..4e2ccc6b75f 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -700,6 +700,7 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) int i; struct radeon_ps *ps; enum radeon_pm_state_type dpm_state; + int ret; /* if dpm init failed */ if (!rdev->pm.dpm_enabled) @@ -766,6 +767,12 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) down_write(&rdev->pm.mclk_lock); mutex_lock(&rdev->ring_lock); + if (rdev->asic->dpm.pre_set_power_state) { + ret = radeon_dpm_pre_set_power_state(rdev); + if (ret) + goto done; + } + /* update display watermarks based on new power state */ radeon_bandwidth_update(rdev); /* update displays */ @@ -787,6 +794,10 @@ static void radeon_dpm_change_power_state_locked(struct radeon_device *rdev) /* update current power state */ rdev->pm.dpm.current_ps = rdev->pm.dpm.requested_ps; + if (rdev->asic->dpm.post_set_power_state) + radeon_dpm_post_set_power_state(rdev); + +done: mutex_unlock(&rdev->ring_lock); up_write(&rdev->pm.mclk_lock); mutex_unlock(&rdev->ddev->struct_mutex); |