[PATCH 23/31] drm/xe/display: Prepare runtime pm functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



No functional change. Just organize the runtime_pm related
functions to allow a later sync with the i915.

Move runtime_suspend down near the runtime_resume.
Create runtime_suspend_late and runtime_suspend_early
stages for a better visualization of the missed i915
sequences.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
---
 drivers/gpu/drm/xe/display/xe_display.c | 41 +++++++++++++++++--------
 drivers/gpu/drm/xe/display/xe_display.h |  2 ++
 drivers/gpu/drm/xe/xe_pm.c              |  7 +++--
 3 files changed, 35 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index 6bfad26a3c06..1ab4dd51094f 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -388,17 +388,6 @@ void xe_display_pm_shutdown_noaccel(struct xe_device *xe)
 	intel_display_driver_shutdown_nogem(xe);
 }
 
-void xe_display_pm_runtime_suspend(struct xe_device *xe)
-{
-	if (!xe->info.probe_display)
-		return;
-
-	if (xe->d3cold.allowed)
-		xe_display_to_d3cold(xe);
-
-	intel_hpd_poll_enable(xe);
-}
-
 void xe_display_pm_suspend_late(struct xe_device *xe)
 {
 	bool s2idle = suspend_to_idle();
@@ -443,6 +432,35 @@ void xe_display_pm_resume_noaccel(struct xe_device *xe)
 	intel_display_driver_resume_nogem(&xe->display);
 }
 
+void xe_display_pm_runtime_suspend(struct xe_device *xe)
+{
+	if (!xe->info.probe_display)
+		return;
+
+	if (xe->d3cold.allowed)
+		xe_display_to_d3cold(xe);
+
+	intel_hpd_poll_enable(xe);
+}
+
+void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
+{
+	if (!xe->info.probe_display)
+		return;
+
+	if (xe->d3cold.allowed)
+		intel_display_power_suspend_late(xe, false);
+}
+
+void xe_display_pm_runtime_resume_early(struct xe_device *xe)
+{
+	if (!xe->info.probe_display)
+		return;
+
+	if (xe->d3cold.allowed)
+		intel_display_power_resume_early(xe);
+}
+
 void xe_display_pm_runtime_resume(struct xe_device *xe)
 {
 	if (!xe->info.probe_display)
@@ -454,7 +472,6 @@ void xe_display_pm_runtime_resume(struct xe_device *xe)
 		xe_display_from_d3cold(xe);
 }
 
-
 static void display_device_remove(struct drm_device *dev, void *arg)
 {
 	struct xe_device *xe = arg;
diff --git a/drivers/gpu/drm/xe/display/xe_display.h b/drivers/gpu/drm/xe/display/xe_display.h
index 256bd2d23964..64ff2d2f5270 100644
--- a/drivers/gpu/drm/xe/display/xe_display.h
+++ b/drivers/gpu/drm/xe/display/xe_display.h
@@ -46,6 +46,8 @@ void xe_display_pm_resume(struct xe_device *xe);
 void xe_display_pm_resume_noirq(struct xe_device *xe);
 void xe_display_pm_resume_noaccel(struct xe_device *xe);
 void xe_display_pm_runtime_suspend(struct xe_device *xe);
+void xe_display_pm_runtime_suspend_late(struct xe_device *xe);
+void xe_display_pm_runtime_resume_early(struct xe_device *xe);
 void xe_display_pm_runtime_resume(struct xe_device *xe);
 
 #else
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 77eb45a641e8..4cacf4b33d83 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -418,8 +418,7 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 
 	xe_irq_suspend(xe);
 
-	if (xe->d3cold.allowed)
-		xe_display_pm_suspend_late(xe);
+	xe_display_pm_runtime_suspend_late(xe);
 out:
 	if (err)
 		xe_display_pm_runtime_resume(xe);
@@ -450,9 +449,11 @@ int xe_pm_runtime_resume(struct xe_device *xe)
 		err = xe_pcode_ready(xe, true);
 		if (err)
 			goto out;
+	}
 
-		xe_display_pm_resume_early(xe);
+	xe_display_pm_runtime_resume_early(xe);
 
+	if (xe->d3cold.allowed) {
 		/*
 		 * This only restores pinned memory which is the memory
 		 * required for the GT(s) to resume.
-- 
2.46.0




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux