diff options
author | David John <davidjon@xenontk.org> | 2009-12-31 01:30:46 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-10 23:36:08 -0500 |
commit | 89347bb8ef2d0af1ae8d847b7df91e9f04eccf2a (patch) | |
tree | ec171501d3f7b1cf6df42a8157944589f7e95b2a /drivers/gpu/drm/drm_crtc_helper.c | |
parent | a81406b4143ff07e586bbe03c50f089da94eefe1 (diff) |
drm: Keep disabled outputs disabled after suspend / resume
With the current DRM code, an output that has been powered off
from userspace will automatically power back on when resuming
from suspend. This patch fixes this behaviour.
Tested only with the Intel i915 driver on an Intel GM45 Express
chipset.
Signed-off-by: David John <davidjon@xenontk.org>
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_crtc_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_crtc_helper.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 4231d6db72ec..aba79c494587 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
@@ -216,7 +216,7 @@ bool drm_helper_crtc_in_use(struct drm_crtc *crtc) | |||
216 | EXPORT_SYMBOL(drm_helper_crtc_in_use); | 216 | EXPORT_SYMBOL(drm_helper_crtc_in_use); |
217 | 217 | ||
218 | /** | 218 | /** |
219 | * drm_disable_unused_functions - disable unused objects | 219 | * drm_helper_disable_unused_functions - disable unused objects |
220 | * @dev: DRM device | 220 | * @dev: DRM device |
221 | * | 221 | * |
222 | * LOCKING: | 222 | * LOCKING: |
@@ -1162,6 +1162,9 @@ EXPORT_SYMBOL(drm_helper_mode_fill_fb_struct); | |||
1162 | int drm_helper_resume_force_mode(struct drm_device *dev) | 1162 | int drm_helper_resume_force_mode(struct drm_device *dev) |
1163 | { | 1163 | { |
1164 | struct drm_crtc *crtc; | 1164 | struct drm_crtc *crtc; |
1165 | struct drm_encoder *encoder; | ||
1166 | struct drm_encoder_helper_funcs *encoder_funcs; | ||
1167 | struct drm_crtc_helper_funcs *crtc_funcs; | ||
1165 | int ret; | 1168 | int ret; |
1166 | 1169 | ||
1167 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 1170 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
@@ -1174,6 +1177,25 @@ int drm_helper_resume_force_mode(struct drm_device *dev) | |||
1174 | 1177 | ||
1175 | if (ret == false) | 1178 | if (ret == false) |
1176 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); | 1179 | DRM_ERROR("failed to set mode on crtc %p\n", crtc); |
1180 | |||
1181 | /* Turn off outputs that were already powered off */ | ||
1182 | if (drm_helper_choose_crtc_dpms(crtc)) { | ||
1183 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | ||
1184 | |||
1185 | if(encoder->crtc != crtc) | ||
1186 | continue; | ||
1187 | |||
1188 | encoder_funcs = encoder->helper_private; | ||
1189 | if (encoder_funcs->dpms) | ||
1190 | (*encoder_funcs->dpms) (encoder, | ||
1191 | drm_helper_choose_encoder_dpms(encoder)); | ||
1192 | |||
1193 | crtc_funcs = crtc->helper_private; | ||
1194 | if (crtc_funcs->dpms) | ||
1195 | (*crtc_funcs->dpms) (crtc, | ||
1196 | drm_helper_choose_crtc_dpms(crtc)); | ||
1197 | } | ||
1198 | } | ||
1177 | } | 1199 | } |
1178 | /* disable the unused connectors while restoring the modesetting */ | 1200 | /* disable the unused connectors while restoring the modesetting */ |
1179 | drm_helper_disable_unused_functions(dev); | 1201 | drm_helper_disable_unused_functions(dev); |