drm/radeon/kms: for downclocking non-mobility check PERFORMANCE state
authorRafał Miłecki <zajec5@gmail.com>
Sun, 21 Feb 2010 22:46:30 +0000 (22:46 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 22 Feb 2010 23:47:38 +0000 (09:47 +1000)
AtomBIOS tables on non-mobility GPU do not contain POWERSAVE/BATTERY.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_pm.c

index 8960acf14155bf95b41fba02964251b75a857a29..d174d93c9386927fa03bb239bf7a59bb0417fb29 100644 (file)
@@ -91,14 +91,24 @@ static struct radeon_power_state * radeon_pick_power_state(struct radeon_device
        default:
                return rdev->pm.default_power_state;
        case POWER_STATE_TYPE_POWERSAVE:
-               wanted_types[0] = POWER_STATE_TYPE_POWERSAVE;
-               wanted_types[1] = POWER_STATE_TYPE_BATTERY;
-               wanted_count = 2;
+               if (rdev->flags & RADEON_IS_MOBILITY) {
+                       wanted_types[0] = POWER_STATE_TYPE_POWERSAVE;
+                       wanted_types[1] = POWER_STATE_TYPE_BATTERY;
+                       wanted_count = 2;
+               } else {
+                       wanted_types[0] = POWER_STATE_TYPE_PERFORMANCE;
+                       wanted_count = 1;
+               }
                break;
        case POWER_STATE_TYPE_BATTERY:
-               wanted_types[0] = POWER_STATE_TYPE_BATTERY;
-               wanted_types[1] = POWER_STATE_TYPE_POWERSAVE;
-               wanted_count = 2;
+               if (rdev->flags & RADEON_IS_MOBILITY) {
+                       wanted_types[0] = POWER_STATE_TYPE_BATTERY;
+                       wanted_types[1] = POWER_STATE_TYPE_POWERSAVE;
+                       wanted_count = 2;
+               } else {
+                       wanted_types[0] = POWER_STATE_TYPE_PERFORMANCE;
+                       wanted_count = 1;
+               }
                break;
        case POWER_STATE_TYPE_BALANCED:
        case POWER_STATE_TYPE_PERFORMANCE: