Commit f6761c68 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Rodrigo Vivi

drm/xe/display: Improve s2idle handling.

We accidentally always pass true as s2idle argument, instead of
calculating it in the same way as i915.

Suspend modes were removed to achieve compatibility with i915, but
accidentally left in the source code.

While at it, fix all other cases too, s2idle will go into a D1 state and
setting a lower power state should be handled by PCI core.

Maybe my laptop stops draining so much power during suspend now? I can
only hope..
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 44e69495
...@@ -5,12 +5,6 @@ ...@@ -5,12 +5,6 @@
#include "intel_wakeref.h" #include "intel_wakeref.h"
enum i915_drm_suspend_mode {
I915_DRM_SUSPEND_IDLE,
I915_DRM_SUSPEND_MEM,
I915_DRM_SUSPEND_HIBERNATE,
};
#define intel_runtime_pm xe_runtime_pm #define intel_runtime_pm xe_runtime_pm
static inline void disable_rpm_wakeref_asserts(void *rpm) static inline void disable_rpm_wakeref_asserts(void *rpm)
......
...@@ -321,6 +321,7 @@ static void intel_suspend_encoders(struct xe_device *xe) ...@@ -321,6 +321,7 @@ static void intel_suspend_encoders(struct xe_device *xe)
void xe_display_pm_suspend(struct xe_device *xe) void xe_display_pm_suspend(struct xe_device *xe)
{ {
bool s2idle = acpi_target_system_state() < ACPI_STATE_S3;
if (!xe->info.enable_display) if (!xe->info.enable_display)
return; return;
...@@ -340,7 +341,7 @@ void xe_display_pm_suspend(struct xe_device *xe) ...@@ -340,7 +341,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
intel_suspend_encoders(xe); intel_suspend_encoders(xe);
intel_opregion_suspend(xe, PCI_D3cold); intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true); intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
...@@ -349,10 +350,11 @@ void xe_display_pm_suspend(struct xe_device *xe) ...@@ -349,10 +350,11 @@ void xe_display_pm_suspend(struct xe_device *xe)
void xe_display_pm_suspend_late(struct xe_device *xe) void xe_display_pm_suspend_late(struct xe_device *xe)
{ {
bool s2idle = acpi_target_system_state() < ACPI_STATE_S3;
if (!xe->info.enable_display) if (!xe->info.enable_display)
return; return;
intel_power_domains_suspend(xe, I915_DRM_SUSPEND_MEM); intel_power_domains_suspend(xe, s2idle);
intel_display_power_suspend_late(xe); intel_display_power_suspend_late(xe);
} }
......
...@@ -795,10 +795,6 @@ static int xe_pci_suspend(struct device *dev) ...@@ -795,10 +795,6 @@ static int xe_pci_suspend(struct device *dev)
pci_save_state(pdev); pci_save_state(pdev);
pci_disable_device(pdev); pci_disable_device(pdev);
err = pci_set_power_state(pdev, PCI_D3hot);
if (err)
return err;
return 0; return 0;
} }
...@@ -814,8 +810,6 @@ static int xe_pci_resume(struct device *dev) ...@@ -814,8 +810,6 @@ static int xe_pci_resume(struct device *dev)
if (err) if (err)
return err; return err;
pci_restore_state(pdev);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
return err; return err;
......
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