Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/display: handle HPD polling in display runtime suspend/resume
@ 2024-08-15 17:25 Vinod Govindapillai
  2024-08-15 18:27 ` Rodrigo Vivi
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Vinod Govindapillai @ 2024-08-15 17:25 UTC (permalink / raw)
  To: intel-xe; +Cc: vinod.govindapillai, imre.deak, arun.r.murthy, rodrigo.vivi

In XE, display runtime suspend / resume routines are called only
if d3cold is allowed. This makes the driver unable to detect any
HPDs once the device goes into runtime suspend state in platforms
like LNL. Update the display runtime suspend / resume routines
to include HPD polling regardless of d3cold status.

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 drivers/gpu/drm/xe/display/xe_display.c | 20 ++++++++++++++++++++
 drivers/gpu/drm/xe/xe_pm.c              |  5 +++--
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index 982b9c5b440f..0cddf55351c8 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -294,6 +294,9 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
 	if (!xe->info.probe_display)
 		return;
 
+	if (!xe->d3cold.allowed)
+		goto enable_hpd_poll;
+
 	/*
 	 * We do a lot of poking in a lot of registers, make sure they work
 	 * properly.
@@ -308,6 +311,8 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
 	intel_dp_mst_suspend(xe);
 
 	intel_hpd_cancel_work(xe);
+	if (runtime)
+		intel_hpd_poll_enable(xe);
 
 	intel_encoder_suspend_all(&xe->display);
 
@@ -316,6 +321,12 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
 	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
 
 	intel_dmc_suspend(xe);
+
+	return;
+
+enable_hpd_poll:
+	if (runtime)
+		intel_hpd_poll_enable(xe);
 }
 
 void xe_display_pm_suspend_late(struct xe_device *xe)
@@ -346,6 +357,9 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
 	if (!xe->info.probe_display)
 		return;
 
+	if (!xe->d3cold.allowed)
+		goto disable_hpd_poll;
+
 	intel_dmc_resume(xe);
 
 	if (has_display(xe))
@@ -368,6 +382,12 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
 	intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
 
 	intel_power_domains_enable(xe);
+
+	return;
+
+disable_hpd_poll:
+	intel_hpd_init(xe);
+	intel_hpd_poll_disable(xe);
 }
 
 static void display_device_remove(struct drm_device *dev, void *arg)
diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
index 9f3c14fd9f33..2abfe70d2697 100644
--- a/drivers/gpu/drm/xe/xe_pm.c
+++ b/drivers/gpu/drm/xe/xe_pm.c
@@ -370,8 +370,8 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
 		err = xe_bo_evict_all(xe);
 		if (err)
 			goto out;
-		xe_display_pm_suspend(xe, true);
 	}
+	xe_display_pm_suspend(xe, true);
 
 	for_each_gt(gt, xe, id) {
 		err = xe_gt_suspend(gt);
@@ -431,11 +431,12 @@ int xe_pm_runtime_resume(struct xe_device *xe)
 		xe_gt_resume(gt);
 
 	if (xe->d3cold.allowed) {
-		xe_display_pm_resume(xe, true);
 		err = xe_bo_restore_user(xe);
 		if (err)
 			goto out;
 	}
+	xe_display_pm_resume(xe, true);
+
 out:
 	lock_map_release(&xe_pm_runtime_lockdep_map);
 	xe_pm_write_callback_task(xe, NULL);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-08-16  8:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 17:25 [PATCH] drm/xe/display: handle HPD polling in display runtime suspend/resume Vinod Govindapillai
2024-08-15 18:27 ` Rodrigo Vivi
2024-08-15 20:55   ` Govindapillai, Vinod
2024-08-16  8:28   ` Jani Nikula
2024-08-15 19:02 ` ✓ CI.Patch_applied: success for " Patchwork
2024-08-15 19:03 ` ✓ CI.checkpatch: " Patchwork
2024-08-15 19:04 ` ✓ CI.KUnit: " Patchwork
2024-08-15 19:15 ` ✓ CI.Build: " Patchwork
2024-08-15 19:18 ` ✓ CI.Hooks: " Patchwork
2024-08-15 19:19 ` ✓ CI.checksparse: " Patchwork
2024-08-15 19:35 ` ✓ CI.BAT: " Patchwork
2024-08-15 22:32 ` ✗ CI.FULL: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox