Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180717
b: refs/heads/master
c: 61caf87
h: refs/heads/master
i:
  180715: 57f43d6
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Linus Torvalds committed Feb 22, 2010
1 parent 97b2fda commit 2a8e147
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4386b58349366511df1c4fe1f7917c198f71529a
refs/heads/master: 61caf87cb5c2a198966018343a6ce4c5ab6cf8df
30 changes: 9 additions & 21 deletions trunk/drivers/gpu/drm/i915/i915_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ MODULE_DEVICE_TABLE(pci, pciidlist);

static int i915_drm_freeze(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;

pci_save_state(dev->pdev);

/* If KMS is active, we do the leavevt stuff here */
Expand All @@ -191,17 +193,12 @@ static int i915_drm_freeze(struct drm_device *dev)

i915_save_state(dev);

return 0;
}

static void i915_drm_suspend(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;

intel_opregion_free(dev, 1);

/* Modeset on resume, not lid events */
dev_priv->modeset_on_lid = 0;

return 0;
}

static int i915_suspend(struct drm_device *dev, pm_message_t state)
Expand All @@ -221,8 +218,6 @@ static int i915_suspend(struct drm_device *dev, pm_message_t state)
if (error)
return error;

i915_drm_suspend(dev);

if (state.event == PM_EVENT_SUSPEND) {
/* Shut down the device */
pci_disable_device(dev->pdev);
Expand All @@ -237,6 +232,10 @@ static int i915_drm_thaw(struct drm_device *dev)
struct drm_i915_private *dev_priv = dev->dev_private;
int error = 0;

i915_restore_state(dev);

intel_opregion_init(dev, 1);

/* KMS EnterVT equivalent */
if (drm_core_check_feature(dev, DRIVER_MODESET)) {
mutex_lock(&dev->struct_mutex);
Expand All @@ -263,10 +262,6 @@ static int i915_resume(struct drm_device *dev)

pci_set_master(dev->pdev);

i915_restore_state(dev);

intel_opregion_init(dev, 1);

return i915_drm_thaw(dev);
}

Expand Down Expand Up @@ -423,8 +418,6 @@ static int i915_pm_suspend(struct device *dev)
if (error)
return error;

i915_drm_suspend(drm_dev);

pci_disable_device(pdev);
pci_set_power_state(pdev, PCI_D3hot);

Expand Down Expand Up @@ -464,13 +457,8 @@ static int i915_pm_poweroff(struct device *dev)
{
struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev);
int error;

error = i915_drm_freeze(drm_dev);
if (!error)
i915_drm_suspend(drm_dev);

return error;
return i915_drm_freeze(drm_dev);
}

const struct dev_pm_ops i915_pm_ops = {
Expand Down

0 comments on commit 2a8e147

Please sign in to comment.