Commit c3c09c95 authored by Imre Deak's avatar Imre Deak Committed by Daniel Vetter

drm/i915: factor out i915_drm_suspend_late

This is needed by an upcoming patch fixing the switcheroo/legacy suspend
paths.

No functional change.
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 22a916aa
...@@ -630,6 +630,25 @@ static int i915_drm_freeze(struct drm_device *dev) ...@@ -630,6 +630,25 @@ static int i915_drm_freeze(struct drm_device *dev)
return 0; return 0;
} }
static int i915_drm_suspend_late(struct drm_device *drm_dev)
{
struct drm_i915_private *dev_priv = drm_dev->dev_private;
int ret;
ret = intel_suspend_complete(dev_priv);
if (ret) {
DRM_ERROR("Suspend complete failed: %d\n", ret);
return ret;
}
pci_disable_device(drm_dev->pdev);
pci_set_power_state(drm_dev->pdev, PCI_D3hot);
return 0;
}
int i915_suspend(struct drm_device *dev, pm_message_t state) int i915_suspend(struct drm_device *dev, pm_message_t state)
{ {
int error; int error;
...@@ -955,8 +974,6 @@ static int i915_pm_suspend_late(struct device *dev) ...@@ -955,8 +974,6 @@ static int i915_pm_suspend_late(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
struct drm_device *drm_dev = pci_get_drvdata(pdev); struct drm_device *drm_dev = pci_get_drvdata(pdev);
struct drm_i915_private *dev_priv = drm_dev->dev_private;
int ret;
/* /*
* We have a suspedn ordering issue with the snd-hda driver also * We have a suspedn ordering issue with the snd-hda driver also
...@@ -970,16 +987,7 @@ static int i915_pm_suspend_late(struct device *dev) ...@@ -970,16 +987,7 @@ static int i915_pm_suspend_late(struct device *dev)
if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF) if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
return 0; return 0;
ret = intel_suspend_complete(dev_priv); return i915_drm_suspend_late(drm_dev);
if (ret)
DRM_ERROR("Suspend complete failed: %d\n", ret);
else {
pci_disable_device(pdev);
pci_set_power_state(pdev, PCI_D3hot);
}
return ret;
} }
static int i915_pm_resume_early(struct device *dev) static int i915_pm_resume_early(struct device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment