|
@@ -766,9 +766,6 @@ static int i915_drm_thaw(struct drm_device *dev)
|
|
|
|
|
|
static int i915_resume_early(struct drm_device *dev)
|
|
|
{
|
|
|
- if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
- return 0;
|
|
|
-
|
|
|
/*
|
|
|
* We have a resume ordering issue with the snd-hda driver also
|
|
|
* requiring our device to be power up. Due to the lack of a
|
|
@@ -808,6 +805,9 @@ static int i915_resume_legacy(struct drm_device *dev)
|
|
|
{
|
|
|
int ret;
|
|
|
|
|
|
+ if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
ret = i915_resume_early(dev);
|
|
|
if (ret)
|
|
|
return ret;
|
|
@@ -997,6 +997,9 @@ static int i915_pm_resume_early(struct device *dev)
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
struct drm_device *drm_dev = pci_get_drvdata(pdev);
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_resume_early(drm_dev);
|
|
|
}
|
|
|
|
|
@@ -1005,6 +1008,9 @@ static int i915_pm_resume(struct device *dev)
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
struct drm_device *drm_dev = pci_get_drvdata(pdev);
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_drm_resume(drm_dev);
|
|
|
}
|
|
|
|
|
@@ -1018,6 +1024,9 @@ static int i915_pm_freeze(struct device *dev)
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_drm_freeze(drm_dev);
|
|
|
}
|
|
|
|
|
@@ -1027,6 +1036,9 @@ static int i915_pm_freeze_late(struct device *dev)
|
|
|
struct drm_device *drm_dev = pci_get_drvdata(pdev);
|
|
|
struct drm_i915_private *dev_priv = drm_dev->dev_private;
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return intel_suspend_complete(dev_priv);
|
|
|
}
|
|
|
|
|
@@ -1035,6 +1047,9 @@ static int i915_pm_thaw_early(struct device *dev)
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
struct drm_device *drm_dev = pci_get_drvdata(pdev);
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_drm_thaw_early(drm_dev);
|
|
|
}
|
|
|
|
|
@@ -1043,6 +1058,9 @@ static int i915_pm_thaw(struct device *dev)
|
|
|
struct pci_dev *pdev = to_pci_dev(dev);
|
|
|
struct drm_device *drm_dev = pci_get_drvdata(pdev);
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_drm_thaw(drm_dev);
|
|
|
}
|
|
|
|
|
@@ -1051,6 +1069,9 @@ 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);
|
|
|
|
|
|
+ if (drm_dev->switch_power_state == DRM_SWITCH_POWER_OFF)
|
|
|
+ return 0;
|
|
|
+
|
|
|
return i915_drm_freeze(drm_dev);
|
|
|
}
|
|
|
|