Intel-XE Archive on lore.kernel.org
 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 8/9] drm/i915: Add tracepoint for plane faults
Date: Wed,  2 Apr 2025 03:22:08 +0300	[thread overview]
Message-ID: <20250402002209.24987-9-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20250402002209.24987-1-ville.syrjala@linux.intel.com>

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

When analying plane faults the exact sequence/timing of things can be
important. Add a tracepoint for plane faults that can then be
correclated against other tracepoints to figure out what happened and
when.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../gpu/drm/i915/display/intel_display_irq.c  |  2 ++
 .../drm/i915/display/intel_display_trace.h    | 33 +++++++++++++++++++
 2 files changed, 35 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
index d2a35e3630b1..d8bd06410542 100644
--- a/drivers/gpu/drm/i915/display/intel_display_irq.c
+++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
@@ -87,6 +87,8 @@ static bool handle_plane_fault(struct intel_crtc *crtc, enum plane_id plane_id)
 
 	plane->capture_error(crtc, plane, &error);
 
+	trace_intel_plane_fault(plane, crtc, error.ctl, error.surf, error.surflive);
+
 	drm_err_ratelimited(display->drm,
 			    "[CRTC:%d:%s][PLANE:%d:%s] fault (CTL=0x%x, SURF=0x%x, SURFLIVE=0x%x)\n",
 			    crtc->base.base.id, crtc->base.name,
diff --git a/drivers/gpu/drm/i915/display/intel_display_trace.h b/drivers/gpu/drm/i915/display/intel_display_trace.h
index 27ebc32cb61a..f0763d754eb7 100644
--- a/drivers/gpu/drm/i915/display/intel_display_trace.h
+++ b/drivers/gpu/drm/i915/display/intel_display_trace.h
@@ -498,6 +498,39 @@ TRACE_EVENT(intel_plane_disable_arm,
 		      __entry->frame, __entry->scanline)
 );
 
+TRACE_EVENT(intel_plane_fault,
+	    TP_PROTO(struct intel_plane *plane, struct intel_crtc *crtc,
+		     u32 ctl, u32 surf, u32 surflive),
+	    TP_ARGS(plane, crtc, ctl, surf, surflive),
+
+	    TP_STRUCT__entry(
+			     __string(dev, __dev_name_kms(plane))
+			     __field(char, pipe_name)
+			     __string(name, plane->base.name)
+			     __field(u32, frame)
+			     __field(u32, scanline)
+			     __field(u32, ctl)
+			     __field(u32, surf)
+			     __field(u32, surflive)
+			     ),
+
+	    TP_fast_assign(
+			   __assign_str(dev);
+			   __assign_str(name);
+			   __entry->pipe_name = pipe_name(crtc->pipe);
+			   __entry->frame = intel_crtc_get_vblank_counter(crtc);
+			   __entry->scanline = intel_get_crtc_scanline(crtc);
+			   __entry->ctl = ctl;
+			   __entry->surf = surf;
+			   __entry->surflive = surflive;
+			   ),
+
+	    TP_printk("dev %s, pipe %c, %s, frame=%u, scanline=%u ctl=0x%x, surf=0x%x, surflive=0x%x",
+		      __get_str(dev), __entry->pipe_name, __get_str(name),
+		      __entry->frame, __entry->scanline,
+		      __entry->ctl, __entry->surf, __entry->surflive)
+);
+
 TRACE_EVENT(intel_plane_scaler_update_arm,
 	    TP_PROTO(struct intel_plane *plane,
 		     int scaler_id, int x, int y, int w, int h),
-- 
2.45.3


  parent reply	other threads:[~2025-04-02  0:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-02  0:22 [PATCH 0/9] drm/i915: Precompute plane SURF address/etc Ville Syrjala
2025-04-02  0:22 ` [PATCH 1/9] drm/i915: Precompute plane SURF address Ville Syrjala
2025-04-02  0:22 ` [PATCH 2/9] drm/i915: Nuke intel_plane_ggtt_offset() Ville Syrjala
2025-04-02  0:22 ` [PATCH 3/9] drm/i915: Move the intel_dpt_offset() check into intel_plane_pin_fb() Ville Syrjala
2025-04-02  0:22 ` [PATCH 4/9] drm/i915: Use i915_vma_offset() in intel_dpt_offset() Ville Syrjala
2025-04-02  0:22 ` [PATCH 5/9] drm/i915: Remove unused dpt_total_entries() Ville Syrjala
2025-04-02  0:22 ` [PATCH 6/9] drm/i915: Don't pass crtc_state to foo_plane_ctl() & co Ville Syrjala
2025-04-02  0:22 ` [PATCH 7/9] drm/i915: Include crtc contributed bits in plane_state->ctl Ville Syrjala
2025-04-02  0:22 ` Ville Syrjala [this message]
2025-04-02  0:22 ` [PATCH 9/9] drm/i915: Include plane ctl/surf registers in the plane update_arm() tracepoint Ville Syrjala
2025-04-02  0:28 ` ✓ CI.Patch_applied: success for drm/i915: Precompute plane SURF address/etc Patchwork
2025-04-02  0:29 ` ✗ CI.checkpatch: warning " Patchwork
2025-04-02  0:30 ` ✓ CI.KUnit: success " Patchwork
2025-04-02  0:46 ` ✓ CI.Build: " Patchwork
2025-04-02  0:49 ` ✓ CI.Hooks: " Patchwork
2025-04-02  0:50 ` ✗ CI.checksparse: warning " Patchwork
2025-04-02  1:36 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-04-02  4:00 ` ✗ Xe.CI.Full: " 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=20250402002209.24987-9-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