Commit c7b5abd3 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Jani Nikula

drm/i915: Remove i915_drm_suspend_mode

enum i915_drm_suspend_mode suspend_mode is only used in
intel_display_power, while we only care about whether we perform a
s2idle. Remove it and use a simple bool.

v2: Rebase
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230529105900.1942814-1-jani.nikula@intel.com
parent e788ff7e
...@@ -2031,7 +2031,7 @@ void intel_power_domains_disable(struct drm_i915_private *i915) ...@@ -2031,7 +2031,7 @@ void intel_power_domains_disable(struct drm_i915_private *i915)
/** /**
* intel_power_domains_suspend - suspend power domain state * intel_power_domains_suspend - suspend power domain state
* @i915: i915 device instance * @i915: i915 device instance
* @suspend_mode: specifies the target suspend state (idle, mem, hibernation) * @s2idle: specifies whether we go to idle, or deeper sleep
* *
* This function prepares the hardware power domain state before entering * This function prepares the hardware power domain state before entering
* system suspend. * system suspend.
...@@ -2039,8 +2039,7 @@ void intel_power_domains_disable(struct drm_i915_private *i915) ...@@ -2039,8 +2039,7 @@ void intel_power_domains_disable(struct drm_i915_private *i915)
* It must be called with power domains already disabled (after a call to * It must be called with power domains already disabled (after a call to
* intel_power_domains_disable()) and paired with intel_power_domains_resume(). * intel_power_domains_disable()) and paired with intel_power_domains_resume().
*/ */
void intel_power_domains_suspend(struct drm_i915_private *i915, void intel_power_domains_suspend(struct drm_i915_private *i915, bool s2idle)
enum i915_drm_suspend_mode suspend_mode)
{ {
struct i915_power_domains *power_domains = &i915->display.power.domains; struct i915_power_domains *power_domains = &i915->display.power.domains;
intel_wakeref_t wakeref __maybe_unused = intel_wakeref_t wakeref __maybe_unused =
...@@ -2055,8 +2054,7 @@ void intel_power_domains_suspend(struct drm_i915_private *i915, ...@@ -2055,8 +2054,7 @@ void intel_power_domains_suspend(struct drm_i915_private *i915,
* resources as required and also enable deeper system power states * resources as required and also enable deeper system power states
* that would be blocked if the firmware was inactive. * that would be blocked if the firmware was inactive.
*/ */
if (!(power_domains->allowed_dc_mask & DC_STATE_EN_DC9) && if (!(power_domains->allowed_dc_mask & DC_STATE_EN_DC9) && s2idle &&
suspend_mode == I915_DRM_SUSPEND_IDLE &&
intel_dmc_has_payload(i915)) { intel_dmc_has_payload(i915)) {
intel_display_power_flush_work(i915); intel_display_power_flush_work(i915);
intel_power_domains_verify_state(i915); intel_power_domains_verify_state(i915);
......
...@@ -171,8 +171,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume) ...@@ -171,8 +171,7 @@ void intel_power_domains_init_hw(struct drm_i915_private *dev_priv, bool resume)
void intel_power_domains_driver_remove(struct drm_i915_private *dev_priv); void intel_power_domains_driver_remove(struct drm_i915_private *dev_priv);
void intel_power_domains_enable(struct drm_i915_private *dev_priv); void intel_power_domains_enable(struct drm_i915_private *dev_priv);
void intel_power_domains_disable(struct drm_i915_private *dev_priv); void intel_power_domains_disable(struct drm_i915_private *dev_priv);
void intel_power_domains_suspend(struct drm_i915_private *dev_priv, void intel_power_domains_suspend(struct drm_i915_private *dev_priv, bool s2idle);
enum i915_drm_suspend_mode);
void intel_power_domains_resume(struct drm_i915_private *dev_priv); void intel_power_domains_resume(struct drm_i915_private *dev_priv);
void intel_power_domains_sanitize_state(struct drm_i915_private *dev_priv); void intel_power_domains_sanitize_state(struct drm_i915_private *dev_priv);
......
...@@ -1118,18 +1118,6 @@ static int i915_drm_suspend(struct drm_device *dev) ...@@ -1118,18 +1118,6 @@ static int i915_drm_suspend(struct drm_device *dev)
return 0; return 0;
} }
static enum i915_drm_suspend_mode
get_suspend_mode(struct drm_i915_private *dev_priv, bool hibernate)
{
if (hibernate)
return I915_DRM_SUSPEND_HIBERNATE;
if (suspend_to_idle(dev_priv))
return I915_DRM_SUSPEND_IDLE;
return I915_DRM_SUSPEND_MEM;
}
static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
...@@ -1137,6 +1125,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) ...@@ -1137,6 +1125,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
struct intel_runtime_pm *rpm = &dev_priv->runtime_pm; struct intel_runtime_pm *rpm = &dev_priv->runtime_pm;
struct intel_gt *gt; struct intel_gt *gt;
int ret, i; int ret, i;
bool s2idle = !hibernation && suspend_to_idle(dev_priv);
disable_rpm_wakeref_asserts(rpm); disable_rpm_wakeref_asserts(rpm);
...@@ -1147,8 +1136,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation) ...@@ -1147,8 +1136,7 @@ static int i915_drm_suspend_late(struct drm_device *dev, bool hibernation)
for_each_gt(gt, dev_priv, i) for_each_gt(gt, dev_priv, i)
intel_uncore_suspend(gt->uncore); intel_uncore_suspend(gt->uncore);
intel_power_domains_suspend(dev_priv, intel_power_domains_suspend(dev_priv, s2idle);
get_suspend_mode(dev_priv, hibernation));
intel_display_power_suspend_late(dev_priv); intel_display_power_suspend_late(dev_priv);
......
...@@ -16,12 +16,6 @@ struct device; ...@@ -16,12 +16,6 @@ struct device;
struct drm_i915_private; struct drm_i915_private;
struct drm_printer; struct drm_printer;
enum i915_drm_suspend_mode {
I915_DRM_SUSPEND_IDLE,
I915_DRM_SUSPEND_MEM,
I915_DRM_SUSPEND_HIBERNATE,
};
/* /*
* This struct helps tracking the state needed for runtime PM, which puts the * This struct helps tracking the state needed for runtime PM, which puts the
* device in PCI D3 state. Notice that when this happens, nothing on the * device in PCI D3 state. Notice that when this happens, nothing on the
......
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