summaryrefslogtreecommitdiff
path: root/drivers/char/drm/i915_drv.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2008-02-20 10:02:20 +1000
committerDave Airlie <airlied@redhat.com>2008-02-20 10:05:12 +1000
commitb932ccb5674eb649133b5c33950405c37d17aab3 (patch)
tree8ba30575cb83cc8d7d35517871b15657d1c1ab19 /drivers/char/drm/i915_drv.c
parentda636ad6a0d72eb5cb99738056af0bcc3db9ef9d (diff)
drm: add support for passing state into the suspend hooks.
fix i915 driver to use state for hibernate save avoidance. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm/i915_drv.c')
-rw-r--r--drivers/char/drm/i915_drv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/char/drm/i915_drv.c b/drivers/char/drm/i915_drv.c
index 35758a6c8b0d..4048f39b7eed 100644
--- a/drivers/char/drm/i915_drv.c
+++ b/drivers/char/drm/i915_drv.c
@@ -238,7 +238,7 @@ static void i915_restore_vga(struct drm_device *dev)
}
-static int i915_suspend(struct drm_device *dev)
+static int i915_suspend(struct drm_device *dev, pm_message_t state)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int i;
@@ -249,6 +249,9 @@ static int i915_suspend(struct drm_device *dev)
return -ENODEV;
}
+ if (state.event == PM_EVENT_PRETHAW)
+ return 0;
+
pci_save_state(dev->pdev);
pci_read_config_byte(dev->pdev, LBB, &dev_priv->saveLBB);
@@ -363,9 +366,11 @@ static int i915_suspend(struct drm_device *dev)
i915_save_vga(dev);
- /* Shut down the device */
- pci_disable_device(dev->pdev);
- pci_set_power_state(dev->pdev, PCI_D3hot);
+ if (state.event == PM_EVENT_SUSPEND) {
+ /* Shut down the device */
+ pci_disable_device(dev->pdev);
+ pci_set_power_state(dev->pdev, PCI_D3hot);
+ }
return 0;
}