All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 3/8] drm/i915: Pimp display fault reporting
Date: Mon, 20 Jan 2025 16:48:25 +0200	[thread overview]
Message-ID: <Z45iOZzV01fk4Fnk@intel.com> (raw)
In-Reply-To: <87ef6c2e-a5c9-431a-9ea5-3b709e913384@linux.intel.com>

On Mon, Jan 20, 2025 at 02:50:50PM +0100, Maarten Lankhorst wrote:
> 
> 
> Den 2025-01-16 kl. 18:47, skrev Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Decode the display faults a bit more extensively so that one
> > doesn't have translate the bitmask to planes/etc. manually.
> > Also for plane faults we can read out a bit of state from the
> > relevant plane(s) and dump that out.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   .../gpu/drm/i915/display/intel_atomic_plane.c |   2 +-
> >   .../gpu/drm/i915/display/intel_atomic_plane.h |   2 +
> >   .../gpu/drm/i915/display/intel_display_irq.c  | 156 +++++++++++++++++-
> >   3 files changed, 155 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.c b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > index 612e9b0ec14a..0aeb5f00d9c4 100644
> > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.c
> > @@ -663,7 +663,7 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_
> >   					       old_plane_state, new_plane_state);
> >   }
> >   
> > -static struct intel_plane *
> > +struct intel_plane *
> >   intel_crtc_get_plane(struct intel_crtc *crtc, enum plane_id plane_id)
> >   {
> >   	struct drm_i915_private *i915 = to_i915(crtc->base.dev);
> > diff --git a/drivers/gpu/drm/i915/display/intel_atomic_plane.h b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> > index 0f982f452ff3..298bb97b37a4 100644
> > --- a/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> > +++ b/drivers/gpu/drm/i915/display/intel_atomic_plane.h
> > @@ -19,6 +19,8 @@ struct intel_plane;
> >   struct intel_plane_state;
> >   enum plane_id;
> >   
> > +struct intel_plane *
> > +intel_crtc_get_plane(struct intel_crtc *crtc, enum plane_id plane_id);
> >   unsigned int intel_adjusted_rate(const struct drm_rect *src,
> >   				 const struct drm_rect *dst,
> >   				 unsigned int rate);
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> > index f06273d9bc8c..1b3b6b8bc794 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> > @@ -10,6 +10,7 @@
> >   #include "i915_irq.h"
> >   #include "i915_reg.h"
> >   #include "icl_dsi_regs.h"
> > +#include "intel_atomic_plane.h"
> >   #include "intel_crtc.h"
> >   #include "intel_de.h"
> >   #include "intel_display_irq.h"
> > @@ -26,6 +27,52 @@
> >   #include "intel_psr.h"
> >   #include "intel_psr_regs.h"
> >   
> > +struct pipe_fault_handler {
> > +	bool (*handle)(struct intel_crtc *crtc, enum plane_id plane_id);
> > +	u32 fault;
> > +	enum plane_id plane_id;
> > +};
> > +
> > +static bool handle_plane_fault(struct intel_crtc *crtc, enum plane_id plane_id)
> > +{
> > +	struct intel_display *display = to_intel_display(crtc);
> > +	struct intel_plane_error error = {};
> > +	struct intel_plane *plane;
> > +
> > +	plane = intel_crtc_get_plane(crtc, plane_id);
> > +	if (!plane || !plane->capture_error)
> > +		return false;
> > +
> > +	plane->capture_error(crtc, plane, &error);
> > +
> > +	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,
> > +			    plane->base.base.id, plane->base.name,
> > +			    error.ctl, error.surf, error.surflive);
> 
> Could we drop the CRTC here?
> <3> [264.586596] xe 0000:00:02.0: [drm] *ERROR* [CRTC:82:pipe 
> A][PLANE:32:plane 1A] fault (CTL=0x94001002, SURF=0x1800000, 
> SURFLIVE=0x1800000)
> 
> Looks to be a bit redundant to print CRTC and plane here. Most likely 
> PLANE is good enough. :-)

It's helpful with cases where the plane name isn't very descriptive,
which will mainly be VLV/CHV sprites.

Would also help with gen2/3 where we swap the plane<->pipe mapping
around for FBC purposes, but as FBC seems to trigger spurious
faults on those platforms we probably can't hook this up there.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-01-20 14:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-16 17:47 [PATCH 0/8] drm/i915: Provide more information on display faults Ville Syrjala
2025-01-16 17:47 ` [PATCH 1/8] drm/i915: Add missing else to the if ladder in missing else Ville Syrjala
2025-02-12 20:46   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 2/8] drm/i915: Introduce a minimal plane error state Ville Syrjala
2025-02-12 21:08   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 3/8] drm/i915: Pimp display fault reporting Ville Syrjala
2025-01-20 13:50   ` Maarten Lankhorst
2025-01-20 14:48     ` Ville Syrjälä [this message]
2025-02-13 19:28   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 4/8] drm/i915: Hook in display GTT faults for IVB/HSW Ville Syrjala
2025-02-13 20:02   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 5/8] drm/i915: Hook in display GTT faults for ILK/SNB Ville Syrjala
2025-02-13 20:09   ` Govindapillai, Vinod
2025-02-13 20:18     ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 6/8] drm/i915: Introduce i915_error_regs Ville Syrjala
2025-02-13 20:47   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 7/8] drm/i915: Un-invert {i9xx,i965}_error_mask() Ville Syrjala
2025-02-13 20:49   ` Govindapillai, Vinod
2025-01-16 17:47 ` [PATCH 8/8] drm/i915: Hook up display fault interrupts for VLV/CHV Ville Syrjala
2025-02-13 21:03   ` Govindapillai, Vinod
2025-01-16 22:53 ` ✓ CI.Patch_applied: success for drm/i915: Provide more information on display faults Patchwork
2025-01-16 22:53 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-16 22:54 ` ✓ CI.KUnit: success " Patchwork
2025-01-16 23:12 ` ✓ CI.Build: " Patchwork
2025-01-16 23:15 ` ✓ CI.Hooks: " Patchwork
2025-01-16 23:17 ` ✗ CI.checksparse: warning " Patchwork
2025-01-17  1:16 ` ✗ Fi.CI.CHECKPATCH: " Patchwork
2025-01-17  1:16 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-01-17  1:30 ` ✓ i915.CI.BAT: success " Patchwork
2025-01-17  9:10 ` ✗ Xe.CI.Full: failure " Patchwork
2025-01-17 10:35 ` ✓ CI.Patch_applied: success for drm/i915: Provide more information on display faults (rev2) Patchwork
2025-01-17 10:35 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-17 10:37 ` ✓ CI.KUnit: success " Patchwork
2025-01-17 10:55 ` ✓ CI.Build: " Patchwork
2025-01-17 10:57 ` ✓ CI.Hooks: " Patchwork
2025-01-17 10:59 ` ✗ CI.checksparse: warning " Patchwork
2025-01-17 11:25 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-17 12:20 ` ✓ Xe.CI.BAT: success for drm/i915: Provide more information on display faults Patchwork
2025-01-17 17:57 ` ✗ Xe.CI.Full: failure for drm/i915: Provide more information on display faults (rev2) Patchwork
2025-01-17 23:14 ` ✗ i915.CI.Full: failure for drm/i915: Provide more information on display faults 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=Z45iOZzV01fk4Fnk@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.