aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-07-02 13:48:08 -0400
committerDave Airlie <airlied@redhat.com>2010-07-07 00:21:39 -0400
commit023eb571a1d0eae738326042dcffa974257eb8c8 (patch)
tree81451d23e88d72b221fdf999ebe75c5e8b44d77a /drivers/gpu
parentb2ea4aa67bfd084834edd070e0a4a47857d6db59 (diff)
drm: correctly update connector DPMS status in drm_fb_helper
We don't currently update the DPMS status of the connector (both in the connector itself and the connector's DPMS property) in the fb helper code. This means that if the kernel FB core has blanked the screen, sysfs will still show a DPMS status of "on". It also means that when X starts, it will try to light up the connectors, but the drm_crtc_helper code will ignore the DPMS change since according to the connector, the DPMS status is already on. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=28436 (the annoying "my screen was blanked when I started X and now it won't light up" bug). Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 1f2cc6b0962..719662034bb 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -315,8 +315,9 @@ static void drm_fb_helper_on(struct fb_info *info)
315 struct drm_device *dev = fb_helper->dev; 315 struct drm_device *dev = fb_helper->dev;
316 struct drm_crtc *crtc; 316 struct drm_crtc *crtc;
317 struct drm_crtc_helper_funcs *crtc_funcs; 317 struct drm_crtc_helper_funcs *crtc_funcs;
318 struct drm_connector *connector;
318 struct drm_encoder *encoder; 319 struct drm_encoder *encoder;
319 int i; 320 int i, j;
320 321
321 /* 322 /*
322 * For each CRTC in this fb, turn the crtc on then, 323 * For each CRTC in this fb, turn the crtc on then,
@@ -332,7 +333,14 @@ static void drm_fb_helper_on(struct fb_info *info)
332 333
333 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON); 334 crtc_funcs->dpms(crtc, DRM_MODE_DPMS_ON);
334 335
335 336 /* Walk the connectors & encoders on this fb turning them on */
337 for (j = 0; j < fb_helper->connector_count; j++) {
338 connector = fb_helper->connector_info[j]->connector;
339 connector->dpms = DRM_MODE_DPMS_ON;
340 drm_connector_property_set_value(connector,
341 dev->mode_config.dpms_property,
342 DRM_MODE_DPMS_ON);
343 }
336 /* Found a CRTC on this fb, now find encoders */ 344 /* Found a CRTC on this fb, now find encoders */
337 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 345 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
338 if (encoder->crtc == crtc) { 346 if (encoder->crtc == crtc) {
@@ -352,8 +360,9 @@ static void drm_fb_helper_off(struct fb_info *info, int dpms_mode)
352 struct drm_device *dev = fb_helper->dev; 360 struct drm_device *dev = fb_helper->dev;
353 struct drm_crtc *crtc; 361 struct drm_crtc *crtc;
354 struct drm_crtc_helper_funcs *crtc_funcs; 362 struct drm_crtc_helper_funcs *crtc_funcs;
363 struct drm_connector *connector;
355 struct drm_encoder *encoder; 364 struct drm_encoder *encoder;
356 int i; 365 int i, j;
357 366
358 /* 367 /*
359 * For each CRTC in this fb, find all associated encoders 368 * For each CRTC in this fb, find all associated encoders
@@ -367,6 +376,14 @@ static void drm_fb_helper_off(struct fb_info *info, int dpms_mode)
367 if (!crtc->enabled) 376 if (!crtc->enabled)
368 continue; 377 continue;
369 378
379 /* Walk the connectors on this fb and mark them off */
380 for (j = 0; j < fb_helper->connector_count; j++) {
381 connector = fb_helper->connector_info[j]->connector;
382 connector->dpms = dpms_mode;
383 drm_connector_property_set_value(connector,
384 dev->mode_config.dpms_property,
385 dpms_mode);
386 }
370 /* Found a CRTC on this fb, now find encoders */ 387 /* Found a CRTC on this fb, now find encoders */
371 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 388 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
372 if (encoder->crtc == crtc) { 389 if (encoder->crtc == crtc) {