[PATCH 06/29] drm/i915: Move HPD poll disable/enable to display suspend/resume handlers

Imre Deak imre.deak at intel.com
Wed Dec 20 00:53:45 UTC 2023


Signed-off-by: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_driver.c | 5 +++++
 drivers/gpu/drm/i915/i915_driver.c                  | 6 ------
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_driver.c b/drivers/gpu/drm/i915/display/intel_display_driver.c
index 6025b37e6e2d3..190e1c6d00438 100644
--- a/drivers/gpu/drm/i915/display/intel_display_driver.c
+++ b/drivers/gpu/drm/i915/display/intel_display_driver.c
@@ -512,6 +512,8 @@ int intel_display_driver_suspend(struct drm_i915_private *i915)
 	if (!HAS_DISPLAY(i915))
 		return 0;
 
+	drm_kms_helper_poll_disable(&i915->drm);
+
 	state = drm_atomic_helper_suspend(&i915->drm);
 	ret = PTR_ERR_OR_ZERO(state);
 	if (ret)
@@ -603,4 +605,7 @@ void intel_display_driver_resume(struct drm_i915_private *i915)
 			"Restoring old state failed with %i\n", ret);
 	if (state)
 		drm_atomic_state_put(state);
+
+	intel_hpd_poll_disable(i915);
+	drm_kms_helper_poll_enable(&i915->drm);
 }
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index e7ab45eb53381..7825257f7643d 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1080,8 +1080,6 @@ static int i915_drm_suspend(struct drm_device *dev)
 	/* We do a lot of poking in a lot of registers, make sure they work
 	 * properly. */
 	intel_power_domains_disable(dev_priv);
-	if (HAS_DISPLAY(dev_priv))
-		drm_kms_helper_poll_disable(dev);
 
 	pci_save_state(pdev);
 
@@ -1245,10 +1243,6 @@ static int i915_drm_resume(struct drm_device *dev)
 
 	intel_display_driver_resume(dev_priv);
 
-	intel_hpd_poll_disable(dev_priv);
-	if (HAS_DISPLAY(dev_priv))
-		drm_kms_helper_poll_enable(dev);
-
 	intel_opregion_resume(dev_priv);
 
 	intel_fbdev_set_suspend(dev, FBINFO_STATE_RUNNING, false);
-- 
2.39.2



More information about the Intel-gfx-trybot mailing list