diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-05-03 01:13:14 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-05-18 04:21:50 -0400 |
commit | d7311171c4cc8d6231427f7ac5056b939a184b80 (patch) | |
tree | bbe3db53048b12ccf1e480261e69121f095226d7 /drivers/gpu/drm/radeon/r600.c | |
parent | ca2af92311eee95820f3b48c35045e5f56bc1477 (diff) |
drm/radeon/kms/pm: add support for no display power states
The lowest power states often cause display problems, so only enable
them when all displays are off.
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r-- | drivers/gpu/drm/radeon/r600.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 75c825cb8790..08a328c4165a 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -120,7 +120,7 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
120 | } else { | 120 | } else { |
121 | if (rdev->pm.active_crtc_count > 1) { | 121 | if (rdev->pm.active_crtc_count > 1) { |
122 | for (i = 0; i < rdev->pm.num_power_states; i++) { | 122 | for (i = 0; i < rdev->pm.num_power_states; i++) { |
123 | if (rdev->pm.power_state[i].flags & RADEON_PM_SINGLE_DISPLAY_ONLY) | 123 | if (rdev->pm.power_state[i].flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY) |
124 | continue; | 124 | continue; |
125 | else if (i >= rdev->pm.current_power_state_index) { | 125 | else if (i >= rdev->pm.current_power_state_index) { |
126 | rdev->pm.requested_power_state_index = | 126 | rdev->pm.requested_power_state_index = |
@@ -136,6 +136,13 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
136 | rdev->pm.current_power_state_index - 1; | 136 | rdev->pm.current_power_state_index - 1; |
137 | } | 137 | } |
138 | rdev->pm.requested_clock_mode_index = 0; | 138 | rdev->pm.requested_clock_mode_index = 0; |
139 | /* don't use the power state if crtcs are active and no display flag is set */ | ||
140 | if ((rdev->pm.active_crtc_count > 0) && | ||
141 | (rdev->pm.power_state[rdev->pm.requested_power_state_index]. | ||
142 | clock_info[rdev->pm.requested_clock_mode_index].flags & | ||
143 | RADEON_PM_MODE_NO_DISPLAY)) { | ||
144 | rdev->pm.requested_power_state_index++; | ||
145 | } | ||
139 | break; | 146 | break; |
140 | case PM_ACTION_UPCLOCK: | 147 | case PM_ACTION_UPCLOCK: |
141 | if (rdev->pm.current_power_state_index == (rdev->pm.num_power_states - 1)) { | 148 | if (rdev->pm.current_power_state_index == (rdev->pm.num_power_states - 1)) { |
@@ -144,7 +151,7 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
144 | } else { | 151 | } else { |
145 | if (rdev->pm.active_crtc_count > 1) { | 152 | if (rdev->pm.active_crtc_count > 1) { |
146 | for (i = (rdev->pm.num_power_states - 1); i >= 0; i--) { | 153 | for (i = (rdev->pm.num_power_states - 1); i >= 0; i--) { |
147 | if (rdev->pm.power_state[i].flags & RADEON_PM_SINGLE_DISPLAY_ONLY) | 154 | if (rdev->pm.power_state[i].flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY) |
148 | continue; | 155 | continue; |
149 | else if (i <= rdev->pm.current_power_state_index) { | 156 | else if (i <= rdev->pm.current_power_state_index) { |
150 | rdev->pm.requested_power_state_index = | 157 | rdev->pm.requested_power_state_index = |
@@ -179,7 +186,7 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
179 | rdev->pm.requested_power_state_index = -1; | 186 | rdev->pm.requested_power_state_index = -1; |
180 | /* start at 1 as we don't want the default mode */ | 187 | /* start at 1 as we don't want the default mode */ |
181 | for (i = 1; i < rdev->pm.num_power_states; i++) { | 188 | for (i = 1; i < rdev->pm.num_power_states; i++) { |
182 | if (rdev->pm.power_state[i].flags & RADEON_PM_SINGLE_DISPLAY_ONLY) | 189 | if (rdev->pm.power_state[i].flags & RADEON_PM_STATE_SINGLE_DISPLAY_ONLY) |
183 | continue; | 190 | continue; |
184 | else if ((rdev->pm.power_state[i].type == POWER_STATE_TYPE_PERFORMANCE) || | 191 | else if ((rdev->pm.power_state[i].type == POWER_STATE_TYPE_PERFORMANCE) || |
185 | (rdev->pm.power_state[i].type == POWER_STATE_TYPE_BATTERY)) { | 192 | (rdev->pm.power_state[i].type == POWER_STATE_TYPE_BATTERY)) { |
@@ -210,6 +217,13 @@ void r600_get_power_state(struct radeon_device *rdev, | |||
210 | rdev->pm.requested_clock_mode_index = 0; | 217 | rdev->pm.requested_clock_mode_index = 0; |
211 | rdev->pm.can_downclock = false; | 218 | rdev->pm.can_downclock = false; |
212 | } | 219 | } |
220 | /* don't use the power state if crtcs are active and no display flag is set */ | ||
221 | if ((rdev->pm.active_crtc_count > 0) && | ||
222 | (rdev->pm.power_state[rdev->pm.requested_power_state_index]. | ||
223 | clock_info[rdev->pm.requested_clock_mode_index].flags & | ||
224 | RADEON_PM_MODE_NO_DISPLAY)) { | ||
225 | rdev->pm.requested_clock_mode_index++; | ||
226 | } | ||
213 | break; | 227 | break; |
214 | case PM_ACTION_UPCLOCK: | 228 | case PM_ACTION_UPCLOCK: |
215 | if (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index) { | 229 | if (rdev->pm.requested_power_state_index == rdev->pm.current_power_state_index) { |