aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2009-09-14 13:58:48 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-09-17 17:42:54 -0400
commit06891e27a9b5dba5268bb80e41a283f51335afe7 (patch)
tree252e7a4a096249c1b3db037c27631290bcfa7e8f /drivers/gpu/drm/i915/i915_drv.c
parentba1234d17b3b1fe7087defb191a3c705f208aca6 (diff)
drm/i915: fix suspend/resume breakage in lid notifier
We now unconditionally restore the mode at lid open time since some platforms turn off the panel, pipes or other display elements when the lid is closed. There's a problem with doing this at resume time however. At resume time, we'll get a lid event, but restoring the mode at that time may not be safe (e.g. if we get the lid event before global state has been restored), so check the suspended state and make sure our restore is locked against other mode updates. Tested-by: Ben Gamari <bgamari.foss@gmail.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 435082e40736..1f9e4503b072 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -89,6 +89,8 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
89 pci_set_power_state(dev->pdev, PCI_D3hot); 89 pci_set_power_state(dev->pdev, PCI_D3hot);
90 } 90 }
91 91
92 dev_priv->suspended = 1;
93
92 return 0; 94 return 0;
93} 95}
94 96
@@ -124,6 +126,8 @@ static int i915_resume(struct drm_device *dev)
124 drm_helper_resume_force_mode(dev); 126 drm_helper_resume_force_mode(dev);
125 } 127 }
126 128
129 dev_priv->suspended = 0;
130
127 return ret; 131 return ret;
128} 132}
129 133