intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/pps: debug log the remaining power cycle delay to wait
@ 2024-12-04 16:00 Jani Nikula
  2024-12-04 16:31 ` ✓ CI.Patch_applied: success for " Patchwork
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Jani Nikula @ 2024-12-04 16:00 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: jani.nikula, Paul Menzel

While pps_init_delays() debug logs the power cycle delay, also debug log
the actual remaining time to wait in wait_panel_power_cycle().

Note that this still isn't the full picture; the power sequencer may
still wait after this one.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/13007
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

Cc: Paul Menzel <pmenzel@molgen.mpg.de>
---
 drivers/gpu/drm/i915/display/intel_pps.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 7784b3b760db..bfda52850150 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -668,23 +668,24 @@ static void wait_panel_power_cycle(struct intel_dp *intel_dp)
 	struct intel_display *display = to_intel_display(intel_dp);
 	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
 	ktime_t panel_power_on_time;
-	s64 panel_power_off_duration;
-
-	drm_dbg_kms(display->drm,
-		    "[ENCODER:%d:%s] %s wait for panel power cycle\n",
-		    dig_port->base.base.base.id, dig_port->base.base.name,
-		    pps_name(intel_dp));
+	s64 panel_power_off_duration, remaining;
 
 	/* take the difference of current time and panel power off time
 	 * and then make panel wait for power_cycle if needed. */
 	panel_power_on_time = ktime_get_boottime();
 	panel_power_off_duration = ktime_ms_delta(panel_power_on_time, intel_dp->pps.panel_power_off_time);
 
+	remaining = max(0, intel_dp->pps.panel_power_cycle_delay - panel_power_off_duration);
+
+	drm_dbg_kms(display->drm,
+		    "[ENCODER:%d:%s] %s wait for panel power cycle (%lld ms remaining)\n",
+		    dig_port->base.base.base.id, dig_port->base.base.name,
+		    pps_name(intel_dp), remaining);
+
 	/* When we disable the VDD override bit last we have to do the manual
 	 * wait. */
-	if (panel_power_off_duration < (s64)intel_dp->pps.panel_power_cycle_delay)
-		wait_remaining_ms_from_jiffies(jiffies,
-				       intel_dp->pps.panel_power_cycle_delay - panel_power_off_duration);
+	if (remaining)
+		wait_remaining_ms_from_jiffies(jiffies, remaining);
 
 	wait_panel_status(intel_dp, IDLE_CYCLE_MASK, IDLE_CYCLE_VALUE);
 }
-- 
2.39.5


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

end of thread, other threads:[~2024-12-10  9:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04 16:00 [PATCH] drm/i915/pps: debug log the remaining power cycle delay to wait Jani Nikula
2024-12-04 16:31 ` ✓ CI.Patch_applied: success for " Patchwork
2024-12-04 16:32 ` ✓ CI.checkpatch: " Patchwork
2024-12-04 16:33 ` ✓ CI.KUnit: " Patchwork
2024-12-04 16:51 ` ✓ CI.Build: " Patchwork
2024-12-04 16:54 ` ✓ CI.Hooks: " Patchwork
2024-12-04 16:55 ` ✗ CI.checksparse: warning " Patchwork
2024-12-04 17:16 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-04 19:21 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-05 14:39 ` [PATCH] " Paul Menzel
2024-12-09 13:02 ` Borah, Chaitanya Kumar
2024-12-10  9:27   ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).