intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH v2 13/13] drm/i915/dsb: Add tracepoints for flip queue
Date: Wed,  9 Sep 2026 19:17:30 +0300	[thread overview]
Message-ID: <20260909161730.12969-14-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20260909161730.12969-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Currently flip queue based commits don't leave any breadcrumbs
via tracepoints. Add new intel_flipq_add and intel_flipq_done
tracepoints that at least indicates when we something happens
via the flip queeu.

We might want to improve this later somehow to have a slightly
better idea what the flip queue might end up doing. But at least
this now shows that *something* is going on.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../drm/i915/display/intel_display_trace.h    | 60 +++++++++++++++++++
 drivers/gpu/drm/i915/display/intel_dmc.c      |  3 +
 drivers/gpu/drm/i915/display/intel_flipq.c    |  7 ++-
 3 files changed, 69 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h
index 06cf662931fe..98ba7e20ca30 100644
--- a/drivers/gpu/drm/i915/display/intel_display_trace.h
+++ b/drivers/gpu/drm/i915/display/intel_display_trace.h
@@ -23,6 +23,7 @@
 #include "intel_display_limits.h"
 #include "intel_display_types.h"
 #include "intel_dsb.h"
+#include "intel_flipq.h"
 #include "intel_vblank.h"
 
 #define __dev_name_display(display) dev_name((display)->drm->dev)
@@ -732,6 +733,65 @@ TRACE_EVENT(intel_dsb_done,
 		      __entry->frame, __entry->scanline)
 );
 
+TRACE_EVENT(intel_flipq_add,
+	    TP_PROTO(struct intel_crtc *crtc,
+		     enum intel_flipq_id flipq_id,
+		     enum intel_dsb_id dsb_id,
+		     u32 pts, u32 curr_pts),
+	    TP_ARGS(crtc, flipq_id, dsb_id, pts, curr_pts),
+
+	    TP_STRUCT__entry(
+			     __string(dev, __dev_name_kms(crtc))
+			     __field(char, pipe_name)
+			     __field(u32, flipq_id)
+			     __field(u32, dsb_id)
+			     __field(u32, pts)
+			     __field(u32, curr_pts)
+			     __field(u32, frame)
+			     __field(u32, scanline)
+			     ),
+
+	    TP_fast_assign(
+			   __assign_str(dev);
+			   __entry->pipe_name = pipe_name(crtc->pipe);
+			   __entry->flipq_id = flipq_id;
+			   __entry->dsb_id = dsb_id;
+			   __entry->pts = pts;
+			   __entry->curr_pts = curr_pts;
+			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
+			   __entry->scanline = intel_get_crtc_scanline(crtc);
+			   ),
+
+	    TP_printk("dev %s, pipe %c, FQ %d, DSB %d, PTS %u, current PTS %u, frame=%u, scanline=%u",
+		      __get_str(dev), __entry->pipe_name,
+		      __entry->flipq_id, __entry->dsb_id,
+		      __entry->pts, __entry->curr_pts,
+		      __entry->frame, __entry->scanline)
+);
+
+TRACE_EVENT(intel_flipq_done,
+	    TP_PROTO(struct intel_crtc *crtc),
+	    TP_ARGS(crtc),
+
+	    TP_STRUCT__entry(
+			     __string(dev, __dev_name_kms(crtc))
+			     __field(char, pipe_name)
+			     __field(u32, frame)
+			     __field(u32, scanline)
+			     ),
+
+	    TP_fast_assign(
+			   __assign_str(dev);
+			   __entry->pipe_name = pipe_name(crtc->pipe);
+			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
+			   __entry->scanline = intel_get_crtc_scanline(crtc);
+			   ),
+
+	    TP_printk("dev %s, pipe %c, frame=%u, scanline=%u",
+		      __get_str(dev), __entry->pipe_name,
+		      __entry->frame, __entry->scanline)
+);
+
 TRACE_EVENT(intel_crtc_vblank_work_start,
 	    TP_PROTO(struct intel_crtc *crtc),
 	    TP_ARGS(crtc),
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index a191eee240d9..a16560f94986 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -34,6 +34,7 @@
 #include "intel_display_power_well.h"
 #include "intel_display_regs.h"
 #include "intel_display_rpm.h"
+#include "intel_display_trace.h"
 #include "intel_display_types.h"
 #include "intel_display_utils.h"
 #include "intel_dmc.h"
@@ -1715,6 +1716,8 @@ void intel_pipedmc_irq_handler(struct intel_display *display, enum pipe pipe)
 			spin_lock(&display->drm->event_lock);
 
 			if (crtc->flipq_event) {
+				trace_intel_flipq_done(crtc);
+
 				/*
 				 * Update vblank counter/timestamp in case it
 				 * hasn't been done yet for this frame.
diff --git a/drivers/gpu/drm/i915/display/intel_flipq.c b/drivers/gpu/drm/i915/display/intel_flipq.c
index 45788234fc83..e7cfacd8a5ef 100644
--- a/drivers/gpu/drm/i915/display/intel_flipq.c
+++ b/drivers/gpu/drm/i915/display/intel_flipq.c
@@ -11,6 +11,7 @@
 #include "intel_crtc.h"
 #include "intel_de.h"
 #include "intel_display_core.h"
+#include "intel_display_trace.h"
 #include "intel_display_types.h"
 #include "intel_display_utils.h"
 #include "intel_display_wa.h"
@@ -430,11 +431,13 @@ void intel_flipq_add(struct intel_crtc *crtc,
 {
 	struct intel_display *display = to_intel_display(crtc);
 	struct intel_flipq *flipq = &crtc->flipq[flipq_id];
+	unsigned int curr_pts;
 
 	if (!assert_flipq_has_room(crtc, flipq_id))
 		return;
 
-	pts += intel_de_read(display, PIPEDMC_FPQ_TS(crtc->pipe));
+	curr_pts = intel_de_read(display, PIPEDMC_FPQ_TS(crtc->pipe));
+	pts += curr_pts;
 
 	intel_flipq_preempt(crtc, true);
 
@@ -446,6 +449,8 @@ void intel_flipq_add(struct intel_crtc *crtc,
 	flipq->tail = (flipq->tail + 1) % intel_flipq_size_entries(flipq->flipq_id);
 	intel_flipq_write_tail(crtc);
 
+	trace_intel_flipq_add(crtc, flipq_id, dsb_id, pts, curr_pts);
+
 	intel_flipq_preempt(crtc, false);
 
 	intel_flipq_sw_dmc_wake(crtc);
-- 
2.54.0


  parent reply	other threads:[~2026-09-09 16:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09 16:17 [PATCH v2 00/13] drm/i915: Some DSB/flipq stuff Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 01/13] drm/i915: Give up on DSB/flip queue if we fail to allocate the color DSB buffer Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 02/13] drm/i915: Check use_flipq in intel_crtc_needs_vblank_work() Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 03/13] drm/i915: Don't initialize flip queue on pre-LNL Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 04/13] drm/i915: Warn about use_flip==true in MMIO commit codepaths Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 05/13] drm/i915: Refine vblank evasion DSB check Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 06/13] drm/i915: Make intel_crtc_needs_vblank_work() easier on the eye Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 07/13] drm/i915: Extract intel_dsb_supported() Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 08/13] drm/i915: Use intel_dsb_supported() to determine 'use_dsb' Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 09/13] drm/i915: Extract commit_dsb_max_cmds() Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 10/13] drm/i915: Introduce enum intel_commit_type Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 11/13] drm/i915: Carve intel_atomic_commit_type() up a bit Ville Syrjala
2026-09-09 16:17 ` [PATCH v2 12/13] drm/i915/dsb: Add tracepoints for DSB commit Ville Syrjala
2026-09-09 16:34   ` sashiko-bot
2026-09-10 11:23     ` Ville Syrjälä
2026-09-09 16:17 ` Ville Syrjala [this message]
2026-09-09 16:25 ` ✗ CI.checkpatch: warning for drm/i915: Some DSB/flipq stuff (rev2) Patchwork
2026-09-09 16:27 ` ✓ CI.KUnit: success " Patchwork
2026-09-09 17:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-09-10  0:25 ` ✗ Xe.CI.FULL: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260909161730.12969-14-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).