[Intel-gfx] [PATCH] drm/i915: Call i915_gem_suspend() only after display is turned off

José Roberto de Souza jose.souza at intel.com
Fri Jun 17 19:06:29 UTC 2022


Gem buffers could still be in use by display after i915_gem_suspend()
is executed so there is chances that i915_gem_flush_free_objects()
will be being executed at the same time that
intel_runtime_pm_driver_release() is executed printing warnings about
wakerefs will being held.

So here only calling i915_gem_suspend() and by consequence
i915_gem_drain_freed_objects() only after display is down making
sure all buffers are freed.

Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
---
 drivers/gpu/drm/i915/i915_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index d26dcca7e654a..4227675dd1cfe 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1067,8 +1067,6 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
 	intel_runtime_pm_disable(&i915->runtime_pm);
 	intel_power_domains_disable(i915);
 
-	i915_gem_suspend(i915);
-
 	if (HAS_DISPLAY(i915)) {
 		drm_kms_helper_poll_disable(&i915->drm);
 
@@ -1085,6 +1083,8 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
 
 	intel_dmc_ucode_suspend(i915);
 
+	i915_gem_suspend(i915);
+
 	/*
 	 * The only requirement is to reboot with display DC states disabled,
 	 * for now leaving all display power wells in the INIT power domain
-- 
2.36.1



More information about the Intel-gfx mailing list