aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_pm.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-06-02 17:56:01 -0400
committerDave Airlie <airlied@redhat.com>2010-06-07 19:35:19 -0400
commitc9e75b2125b563e67663f78ad53ea9387a9a7aa1 (patch)
treeee05b7f6e310e2a0f4f278acab0332b1f31ce88f /drivers/gpu/drm/radeon/radeon_pm.c
parentf8ed8b4c5d30b5214f185997131b06e35f6f7113 (diff)
drm/radeon/kms/pm: add mid profile
This adds an additional profile, mid, to the pm profile code which takes the place of the old low profile. The default behavior remains the same, e.g., auto profile now selects between mid and high profiles based on power source, however, you can now manually force the low profile which was previously only available as a dpms off state. Enabling the low profile when the displays are on has been known to cause display corruption in some cases. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_pm.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_pm.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c
index 62e7f967c6c4..fcdf1db1e3ce 100644
--- a/drivers/gpu/drm/radeon/radeon_pm.c
+++ b/drivers/gpu/drm/radeon/radeon_pm.c
@@ -84,9 +84,9 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
84 rdev->pm.profile_index = PM_PROFILE_HIGH_SH_IDX; 84 rdev->pm.profile_index = PM_PROFILE_HIGH_SH_IDX;
85 } else { 85 } else {
86 if (rdev->pm.active_crtc_count > 1) 86 if (rdev->pm.active_crtc_count > 1)
87 rdev->pm.profile_index = PM_PROFILE_LOW_MH_IDX; 87 rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
88 else 88 else
89 rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX; 89 rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
90 } 90 }
91 break; 91 break;
92 case PM_PROFILE_LOW: 92 case PM_PROFILE_LOW:
@@ -95,6 +95,12 @@ static void radeon_pm_update_profile(struct radeon_device *rdev)
95 else 95 else
96 rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX; 96 rdev->pm.profile_index = PM_PROFILE_LOW_SH_IDX;
97 break; 97 break;
98 case PM_PROFILE_MID:
99 if (rdev->pm.active_crtc_count > 1)
100 rdev->pm.profile_index = PM_PROFILE_MID_MH_IDX;
101 else
102 rdev->pm.profile_index = PM_PROFILE_MID_SH_IDX;
103 break;
98 case PM_PROFILE_HIGH: 104 case PM_PROFILE_HIGH:
99 if (rdev->pm.active_crtc_count > 1) 105 if (rdev->pm.active_crtc_count > 1)
100 rdev->pm.profile_index = PM_PROFILE_HIGH_MH_IDX; 106 rdev->pm.profile_index = PM_PROFILE_HIGH_MH_IDX;
@@ -302,6 +308,8 @@ static ssize_t radeon_set_pm_profile(struct device *dev,
302 rdev->pm.profile = PM_PROFILE_AUTO; 308 rdev->pm.profile = PM_PROFILE_AUTO;
303 else if (strncmp("low", buf, strlen("low")) == 0) 309 else if (strncmp("low", buf, strlen("low")) == 0)
304 rdev->pm.profile = PM_PROFILE_LOW; 310 rdev->pm.profile = PM_PROFILE_LOW;
311 else if (strncmp("mid", buf, strlen("mid")) == 0)
312 rdev->pm.profile = PM_PROFILE_MID;
305 else if (strncmp("high", buf, strlen("high")) == 0) 313 else if (strncmp("high", buf, strlen("high")) == 0)
306 rdev->pm.profile = PM_PROFILE_HIGH; 314 rdev->pm.profile = PM_PROFILE_HIGH;
307 else { 315 else {