aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-23 12:16:34 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-11-29 05:43:52 -0500
commit45e2b5f640b3766da3eda48f6c35f088155c06f3 (patch)
tree5d5ff7f3edcf08baebf105c220528c91c13cc587 /drivers/gpu
parentb5d177946a30b097fbd1e5afa7c11acdeeb6bad8 (diff)
drm/i915: force restore on lid open
There seem to be indeed some awkwards machines around, mostly those without OpRegion support, where the firmware changes the display hw state behind our backs when closing the lid. This force-restore logic has been originally introduced in commit c1c7af60892070e4b82ad63bbfb95ae745056de0 Author: Jesse Barnes <jbarnes@virtuousgeek.org> Date: Thu Sep 10 15:28:03 2009 -0700 drm/i915: force mode set at lid open time but after the modeset-rework we've disabled it in the vain hope that it's no longer required: commit 3b7a89fce3e3dc96b549d6d829387b4439044d0d Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Mon Sep 17 22:27:21 2012 +0200 drm/i915: fix OOPS in lid_notify Alas, no. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54677 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57434 Tested-by: Krzysztof Mazur <krzysiek@podlesie.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c2
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h3
-rw-r--r--drivers/gpu/drm/i915/intel_display.c15
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c2
4 files changed, 16 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 6745c7f976db..a12921892446 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -564,7 +564,7 @@ static int __i915_drm_thaw(struct drm_device *dev)
564 mutex_unlock(&dev->struct_mutex); 564 mutex_unlock(&dev->struct_mutex);
565 565
566 intel_modeset_init_hw(dev); 566 intel_modeset_init_hw(dev);
567 intel_modeset_setup_hw_state(dev); 567 intel_modeset_setup_hw_state(dev, false);
568 drm_irq_install(dev); 568 drm_irq_install(dev);
569 } 569 }
570 570
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 87c06f97fa89..47c62f5125a7 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1652,7 +1652,8 @@ extern void intel_modeset_init(struct drm_device *dev);
1652extern void intel_modeset_gem_init(struct drm_device *dev); 1652extern void intel_modeset_gem_init(struct drm_device *dev);
1653extern void intel_modeset_cleanup(struct drm_device *dev); 1653extern void intel_modeset_cleanup(struct drm_device *dev);
1654extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state); 1654extern int intel_modeset_vga_set_state(struct drm_device *dev, bool state);
1655extern void intel_modeset_setup_hw_state(struct drm_device *dev); 1655extern void intel_modeset_setup_hw_state(struct drm_device *dev,
1656 bool force_restore);
1656extern bool intel_fbc_enabled(struct drm_device *dev); 1657extern bool intel_fbc_enabled(struct drm_device *dev);
1657extern void intel_disable_fbc(struct drm_device *dev); 1658extern void intel_disable_fbc(struct drm_device *dev);
1658extern bool ironlake_set_drps(struct drm_device *dev, u8 val); 1659extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3f7f62d370cb..78d12c471472 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8988,7 +8988,8 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
8988 8988
8989/* Scan out the current hw modeset state, sanitizes it and maps it into the drm 8989/* Scan out the current hw modeset state, sanitizes it and maps it into the drm
8990 * and i915 state tracking structures. */ 8990 * and i915 state tracking structures. */
8991void intel_modeset_setup_hw_state(struct drm_device *dev) 8991void intel_modeset_setup_hw_state(struct drm_device *dev,
8992 bool force_restore)
8992{ 8993{
8993 struct drm_i915_private *dev_priv = dev->dev_private; 8994 struct drm_i915_private *dev_priv = dev->dev_private;
8994 enum pipe pipe; 8995 enum pipe pipe;
@@ -9087,7 +9088,15 @@ void intel_modeset_setup_hw_state(struct drm_device *dev)
9087 intel_sanitize_crtc(crtc); 9088 intel_sanitize_crtc(crtc);
9088 } 9089 }
9089 9090
9090 intel_modeset_update_staged_output_state(dev); 9091 if (force_restore) {
9092 for_each_pipe(pipe) {
9093 crtc = to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]);
9094 intel_set_mode(&crtc->base, &crtc->base.mode,
9095 crtc->base.x, crtc->base.y, crtc->base.fb);
9096 }
9097 } else {
9098 intel_modeset_update_staged_output_state(dev);
9099 }
9091 9100
9092 intel_modeset_check_state(dev); 9101 intel_modeset_check_state(dev);
9093 9102
@@ -9100,7 +9109,7 @@ void intel_modeset_gem_init(struct drm_device *dev)
9100 9109
9101 intel_setup_overlay(dev); 9110 intel_setup_overlay(dev);
9102 9111
9103 intel_modeset_setup_hw_state(dev); 9112 intel_modeset_setup_hw_state(dev, false);
9104} 9113}
9105 9114
9106void intel_modeset_cleanup(struct drm_device *dev) 9115void intel_modeset_cleanup(struct drm_device *dev)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 81502e8be26b..b9a660a53677 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -532,7 +532,7 @@ static int intel_lid_notify(struct notifier_block *nb, unsigned long val,
532 dev_priv->modeset_on_lid = 0; 532 dev_priv->modeset_on_lid = 0;
533 533
534 mutex_lock(&dev->mode_config.mutex); 534 mutex_lock(&dev->mode_config.mutex);
535 intel_modeset_check_state(dev); 535 intel_modeset_setup_hw_state(dev, true);
536 mutex_unlock(&dev->mode_config.mutex); 536 mutex_unlock(&dev->mode_config.mutex);
537 537
538 return NOTIFY_OK; 538 return NOTIFY_OK;