diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-03-22 13:31:08 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 04:21:10 -0400 |
commit | 58e21dff53b9063563e7bb5f5a795ab2d8f61dda (patch) | |
tree | e583e93b5685a8904058820f191048198c73a87f | |
parent | 79daedc942813c0417ff5e277da6f7f35705cde5 (diff) |
drm/radeon/kms/pm: restore default power state on exit
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 10 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_pm.c | 9 |
4 files changed, 25 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index f10b747024f1..6443d9ea6c11 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -123,6 +123,10 @@ void r100_get_power_state(struct radeon_device *rdev, | |||
123 | rdev->pm.current_power_state_index + 1; | 123 | rdev->pm.current_power_state_index + 1; |
124 | } | 124 | } |
125 | break; | 125 | break; |
126 | case PM_ACTION_DEFAULT: | ||
127 | rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index; | ||
128 | rdev->pm.can_upclock = false; | ||
129 | break; | ||
126 | case PM_ACTION_NONE: | 130 | case PM_ACTION_NONE: |
127 | default: | 131 | default: |
128 | DRM_ERROR("Requested mode for not defined action\n"); | 132 | DRM_ERROR("Requested mode for not defined action\n"); |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 35a5d4856f46..4f7f318b5437 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -161,6 +161,11 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
161 | } | 161 | } |
162 | rdev->pm.requested_clock_mode_index = 0; | 162 | rdev->pm.requested_clock_mode_index = 0; |
163 | break; | 163 | break; |
164 | case PM_ACTION_DEFAULT: | ||
165 | rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index; | ||
166 | rdev->pm.requested_clock_mode_index = 0; | ||
167 | rdev->pm.can_upclock = false; | ||
168 | break; | ||
164 | case PM_ACTION_NONE: | 169 | case PM_ACTION_NONE: |
165 | default: | 170 | default: |
166 | DRM_ERROR("Requested mode for not defined action\n"); | 171 | DRM_ERROR("Requested mode for not defined action\n"); |
@@ -221,6 +226,11 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
221 | rdev->pm.can_upclock = false; | 226 | rdev->pm.can_upclock = false; |
222 | } | 227 | } |
223 | break; | 228 | break; |
229 | case PM_ACTION_DEFAULT: | ||
230 | rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index; | ||
231 | rdev->pm.requested_clock_mode_index = 0; | ||
232 | rdev->pm.can_upclock = false; | ||
233 | break; | ||
224 | case PM_ACTION_NONE: | 234 | case PM_ACTION_NONE: |
225 | default: | 235 | default: |
226 | DRM_ERROR("Requested mode for not defined action\n"); | 236 | DRM_ERROR("Requested mode for not defined action\n"); |
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index b9ad976cfb9c..5ffb29597af7 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -615,7 +615,8 @@ enum radeon_pm_action { | |||
615 | PM_ACTION_NONE, | 615 | PM_ACTION_NONE, |
616 | PM_ACTION_MINIMUM, | 616 | PM_ACTION_MINIMUM, |
617 | PM_ACTION_DOWNCLOCK, | 617 | PM_ACTION_DOWNCLOCK, |
618 | PM_ACTION_UPCLOCK | 618 | PM_ACTION_UPCLOCK, |
619 | PM_ACTION_DEFAULT | ||
619 | }; | 620 | }; |
620 | 621 | ||
621 | enum radeon_voltage_type { | 622 | enum radeon_voltage_type { |
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 87814eb8a1b4..23b79ebce6c1 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -125,6 +125,15 @@ int radeon_pm_init(struct radeon_device *rdev) | |||
125 | 125 | ||
126 | void radeon_pm_fini(struct radeon_device *rdev) | 126 | void radeon_pm_fini(struct radeon_device *rdev) |
127 | { | 127 | { |
128 | if (rdev->pm.state != PM_STATE_DISABLED) { | ||
129 | /* cancel work */ | ||
130 | cancel_delayed_work_sync(&rdev->pm.idle_work); | ||
131 | /* reset default clocks */ | ||
132 | rdev->pm.state = PM_STATE_DISABLED; | ||
133 | rdev->pm.planned_action = PM_ACTION_DEFAULT; | ||
134 | radeon_pm_set_clocks(rdev); | ||
135 | } | ||
136 | |||
128 | if (rdev->pm.i2c_bus) | 137 | if (rdev->pm.i2c_bus) |
129 | radeon_i2c_destroy(rdev->pm.i2c_bus); | 138 | radeon_i2c_destroy(rdev->pm.i2c_bus); |
130 | } | 139 | } |