]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/radeon/kms/pm: restore default power state on exit
authorAlex Deucher <alexdeucher@gmail.com>
Mon, 22 Mar 2010 17:31:08 +0000 (13:31 -0400)
committerDave Airlie <airlied@redhat.com>
Tue, 18 May 2010 08:21:10 +0000 (18:21 +1000)
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_pm.c

index f10b747024f1b6074dc64a92c7b4331472bce171..6443d9ea6c11053a690dca7092606b70a59f59f1 100644 (file)
@@ -123,6 +123,10 @@ void r100_get_power_state(struct radeon_device *rdev,
                                        rdev->pm.current_power_state_index + 1;
                }
                break;
+       case PM_ACTION_DEFAULT:
+               rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
+               rdev->pm.can_upclock = false;
+               break;
        case PM_ACTION_NONE:
        default:
                DRM_ERROR("Requested mode for not defined action\n");
index 35a5d4856f465ef88a8aef6caff54f426d7b82b6..4f7f318b5437452d67e1f09f23c8a6cf396318a0 100644 (file)
@@ -161,6 +161,11 @@ void r600_get_power_state(struct radeon_device *rdev,
                        }
                        rdev->pm.requested_clock_mode_index = 0;
                        break;
+               case PM_ACTION_DEFAULT:
+                       rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
+                       rdev->pm.requested_clock_mode_index = 0;
+                       rdev->pm.can_upclock = false;
+                       break;
                case PM_ACTION_NONE:
                default:
                        DRM_ERROR("Requested mode for not defined action\n");
@@ -221,6 +226,11 @@ void r600_get_power_state(struct radeon_device *rdev,
                                rdev->pm.can_upclock = false;
                        }
                        break;
+               case PM_ACTION_DEFAULT:
+                       rdev->pm.requested_power_state_index = rdev->pm.default_power_state_index;
+                       rdev->pm.requested_clock_mode_index = 0;
+                       rdev->pm.can_upclock = false;
+                       break;
                case PM_ACTION_NONE:
                default:
                        DRM_ERROR("Requested mode for not defined action\n");
index b9ad976cfb9c2b2b5bf5422043efd08f5f0b3980..5ffb29597af718119d02de7c50e632d70cc3514c 100644 (file)
@@ -615,7 +615,8 @@ enum radeon_pm_action {
        PM_ACTION_NONE,
        PM_ACTION_MINIMUM,
        PM_ACTION_DOWNCLOCK,
-       PM_ACTION_UPCLOCK
+       PM_ACTION_UPCLOCK,
+       PM_ACTION_DEFAULT
 };
 
 enum radeon_voltage_type {
index 87814eb8a1b49c9062aa9c08423307bb43e957d6..23b79ebce6c1fd08ca2b304f7e6be2463121c4b8 100644 (file)
@@ -125,6 +125,15 @@ int radeon_pm_init(struct radeon_device *rdev)
 
 void radeon_pm_fini(struct radeon_device *rdev)
 {
+       if (rdev->pm.state != PM_STATE_DISABLED) {
+               /* cancel work */
+               cancel_delayed_work_sync(&rdev->pm.idle_work);
+               /* reset default clocks */
+               rdev->pm.state = PM_STATE_DISABLED;
+               rdev->pm.planned_action = PM_ACTION_DEFAULT;
+               radeon_pm_set_clocks(rdev);
+       }
+
        if (rdev->pm.i2c_bus)
                radeon_i2c_destroy(rdev->pm.i2c_bus);
 }