From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 03/14] drm/i915/dsb: Hook up DSB error interrupts
Date: Tue, 25 Jun 2024 10:58:20 +0300 [thread overview]
Message-ID: <87ikxxe9nn.fsf@intel.com> (raw)
In-Reply-To: <20240624191032.27333-4-ville.syrjala@linux.intel.com>
On Mon, 24 Jun 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Enable all DSB error/fault interrupts so that we can see if
> anything goes terribly wrong.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> .../gpu/drm/i915/display/intel_display_irq.c | 17 ++++++
> drivers/gpu/drm/i915/display/intel_dsb.c | 58 +++++++++++++++++++
> drivers/gpu/drm/i915/display/intel_dsb.h | 6 ++
> drivers/gpu/drm/i915/i915_reg.h | 4 ++
> 4 files changed, 85 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index 5219ba295c74..7169db984651 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -14,6 +14,7 @@
> #include "intel_display_trace.h"
> #include "intel_display_types.h"
> #include "intel_dp_aux.h"
> +#include "intel_dsb.h"
> #include "intel_fdi_regs.h"
> #include "intel_fifo_underrun.h"
> #include "intel_gmbus.h"
> @@ -1143,6 +1144,17 @@ void gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
>
> intel_uncore_write(&dev_priv->uncore, GEN8_DE_PIPE_IIR(pipe), iir);
>
> + if (HAS_DSB(dev_priv)) {
> + if (iir & GEN12_DSB_INT(INTEL_DSB_0))
> + intel_dsb_irq_handler(&dev_priv->display, pipe, INTEL_DSB_0);
> +
> + if (iir & GEN12_DSB_INT(INTEL_DSB_1))
> + intel_dsb_irq_handler(&dev_priv->display, pipe, INTEL_DSB_1);
> +
> + if (iir & GEN12_DSB_INT(INTEL_DSB_2))
> + intel_dsb_irq_handler(&dev_priv->display, pipe, INTEL_DSB_2);
> + }
> +
> if (iir & GEN8_PIPE_VBLANK)
> intel_handle_vblank(dev_priv, pipe);
>
> @@ -1718,6 +1730,11 @@ void gen8_de_irq_postinstall(struct drm_i915_private *dev_priv)
> de_port_masked |= DSI0_TE | DSI1_TE;
> }
>
> + if (HAS_DSB(dev_priv))
> + de_pipe_masked |= GEN12_DSB_INT(INTEL_DSB_0) |
> + GEN12_DSB_INT(INTEL_DSB_1) |
> + GEN12_DSB_INT(INTEL_DSB_2);
> +
> de_pipe_enables = de_pipe_masked |
> GEN8_PIPE_VBLANK |
> gen8_de_pipe_underrun_mask(dev_priv) |
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
> index 2ab3765f6c06..ded696363258 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.c
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.c
> @@ -339,6 +339,42 @@ static u32 dsb_chicken(struct intel_crtc *crtc)
> return DSB_SKIP_WAITS_EN;
> }
>
> +static u32 dsb_error_int_status(struct intel_display *display)
> +{
> + struct drm_i915_private *i915 = to_i915(display->drm);
I think this is redundant, you can just pass display to DISPLAY_VER().
> + u32 errors;
> +
> + errors = DSB_GTT_FAULT_INT_STATUS |
> + DSB_RSPTIMEOUT_INT_STATUS |
> + DSB_POLL_ERR_INT_STATUS;
> +
> + /*
> + * All the non-existing status bits operate as
> + * normal r/w bits, so any attempt to clear them
> + * will just end up setting them. Never do that so
> + * we won't mistake them for actual error interrupts.
> + */
> + if (DISPLAY_VER(i915) >= 14)
> + errors |= DSB_ATS_FAULT_INT_STATUS;
> +
> + return errors;
> +}
> +
> +static u32 dsb_error_int_en(struct intel_display *display)
> +{
> + struct drm_i915_private *i915 = to_i915(display->drm);
Ditto.
> + u32 errors;
> +
> + errors = DSB_GTT_FAULT_INT_EN |
> + DSB_RSPTIMEOUT_INT_EN |
> + DSB_POLL_ERR_INT_EN;
> +
> + if (DISPLAY_VER(i915) >= 14)
> + errors |= DSB_ATS_FAULT_INT_EN;
> +
> + return errors;
> +}
> +
> static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
> int dewake_scanline)
> {
> @@ -363,6 +399,10 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
> intel_de_write_fw(display, DSB_CHICKEN(pipe, dsb->id),
> dsb_chicken(crtc));
>
> + intel_de_write_fw(display, DSB_INTERRUPT(pipe, dsb->id),
> + dsb_error_int_status(display) | DSB_PROG_INT_STATUS |
> + dsb_error_int_en(display));
> +
> intel_de_write_fw(display, DSB_HEAD(pipe, dsb->id),
> intel_dsb_buffer_ggtt_offset(&dsb->dsb_buf));
>
> @@ -430,6 +470,9 @@ void intel_dsb_wait(struct intel_dsb *dsb)
> dsb->free_pos = 0;
> dsb->ins_start_offset = 0;
> intel_de_write_fw(display, DSB_CTRL(pipe, dsb->id), 0);
> +
> + intel_de_write_fw(display, DSB_INTERRUPT(pipe, dsb->id),
> + dsb_error_int_status(display) | DSB_PROG_INT_STATUS);
> }
>
> /**
> @@ -513,3 +556,18 @@ void intel_dsb_cleanup(struct intel_dsb *dsb)
> intel_dsb_buffer_cleanup(&dsb->dsb_buf);
> kfree(dsb);
> }
> +
> +void intel_dsb_irq_handler(struct intel_display *display,
> + enum pipe pipe, enum intel_dsb_id dsb_id)
> +{
> + struct intel_crtc *crtc = intel_crtc_for_pipe(to_i915(display->drm), pipe);
> + u32 tmp, errors;
> +
> + tmp = intel_de_read_fw(display, DSB_INTERRUPT(pipe, dsb_id));
> + intel_de_write_fw(display, DSB_INTERRUPT(pipe, dsb_id), tmp);
> +
> + errors = tmp & dsb_error_int_status(display);
> + if (errors)
> + drm_err(display->drm, "[CRTC:%d:%s] / DSB %d error interrupt: 0x%x\n",
> + crtc->base.base.id, crtc->base.name, dsb_id, errors);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_dsb.h b/drivers/gpu/drm/i915/display/intel_dsb.h
> index bb42749f2ea4..84fc2f8434d1 100644
> --- a/drivers/gpu/drm/i915/display/intel_dsb.h
> +++ b/drivers/gpu/drm/i915/display/intel_dsb.h
> @@ -13,8 +13,11 @@
> struct intel_atomic_state;
> struct intel_crtc;
> struct intel_crtc_state;
> +struct intel_display;
> struct intel_dsb;
>
> +enum pipe;
> +
> enum intel_dsb_id {
> INTEL_DSB_0,
> INTEL_DSB_1,
> @@ -41,4 +44,7 @@ void intel_dsb_commit(struct intel_dsb *dsb,
> bool wait_for_vblank);
> void intel_dsb_wait(struct intel_dsb *dsb);
>
> +void intel_dsb_irq_handler(struct intel_display *display,
> + enum pipe pipe, enum intel_dsb_id dsb_id);
> +
> #endif
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index 0e3d79227e3c..49a9761ca313 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -2515,6 +2515,10 @@
> #define GEN11_PIPE_PLANE7_FLIP_DONE REG_BIT(18) /* icl/tgl */
> #define GEN11_PIPE_PLANE6_FLIP_DONE REG_BIT(17) /* icl/tgl */
> #define GEN11_PIPE_PLANE5_FLIP_DONE REG_BIT(16) /* icl+ */
> +#define GEN12_DSB_2_INT REG_BIT(15) /* tgl+ */
> +#define GEN12_DSB_1_INT REG_BIT(14) /* tgl+ */
> +#define GEN12_DSB_0_INT REG_BIT(13) /* tgl+ */
> +#define GEN12_DSB_INT(dsb_id) REG_BIT(13 + (dsb_id))
> #define GEN9_PIPE_CURSOR_FAULT REG_BIT(11) /* skl+ */
> #define GEN9_PIPE_PLANE4_FAULT REG_BIT(10) /* skl+ */
> #define GEN8_PIPE_CURSOR_FAULT REG_BIT(10) /* bdw */
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-06-25 7:58 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-24 19:10 [PATCH 00/14] drm/i915/dsb: Use chained DSBs for LUT programming Ville Syrjala
2024-06-24 19:10 ` [PATCH 01/14] drm/i915: Calculate vblank delay more accurately Ville Syrjala
2024-06-28 8:16 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 02/14] drm/i915: Make vrr_{enabling, disabling}() usable outside intel_display.c Ville Syrjala
2024-06-28 8:18 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 03/14] drm/i915/dsb: Hook up DSB error interrupts Ville Syrjala
2024-06-25 7:58 ` Jani Nikula [this message]
2024-06-25 13:58 ` [PATCH v2 " Ville Syrjala
2024-08-27 14:10 ` Manna, Animesh
2024-06-28 9:21 ` [PATCH " Manna, Animesh
2024-06-28 11:04 ` Ville Syrjälä
2024-06-24 19:10 ` [PATCH 04/14] drm/i915/dsb: Convert dewake_scanline to a hw scanline number earlier Ville Syrjala
2024-06-24 19:10 ` [PATCH 05/14] drm/i915/dsb: Shuffle code around Ville Syrjala
2024-07-03 5:49 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 06/14] drm/i915/dsb: Fix dewake scanline Ville Syrjala
2024-07-03 5:59 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 07/14] drm/i915/dsb: Account for VRR properly in DSB scanline stuff Ville Syrjala
2024-07-03 8:23 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 08/14] drm/i915/dsb: Precompute DSB_CHICKEN Ville Syrjala
2024-07-03 8:48 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 09/14] drm/i915/dsb: Introduce intel_dsb_wait_scanline_{in, out}() Ville Syrjala
2024-07-03 11:37 ` Manna, Animesh
2024-07-03 12:07 ` Ville Syrjälä
2024-07-03 12:10 ` Ville Syrjälä
2024-08-27 6:30 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 10/14] drm/i915/dsb: Introduce intel_dsb_chain() Ville Syrjala
2024-07-03 12:10 ` Manna, Animesh
2024-07-03 12:20 ` Ville Syrjälä
2024-08-21 15:05 ` Manna, Animesh
2024-08-23 12:45 ` Ville Syrjälä
2024-08-27 6:19 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 11/14] drm/i915/dsb: Allow intel_dsb_chain() to use DSB_WAIT_FOR_VBLANK Ville Syrjala
2024-07-05 15:58 ` Manna, Animesh
2024-07-05 16:09 ` Manna, Animesh
2024-07-05 17:36 ` Ville Syrjälä
2024-07-05 17:39 ` Ville Syrjälä
2024-08-21 14:58 ` Manna, Animesh
2024-08-23 12:44 ` Ville Syrjälä
2024-08-27 6:23 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 12/14] drm/i915/dsb: Clear DSB_ENABLE_DEWAKE once the DSB is done Ville Syrjala
2024-07-05 17:26 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 13/14] drm/i915/dsb: s/dsb/dsb_color_vblank/ Ville Syrjala
2024-07-05 17:28 ` Manna, Animesh
2024-06-24 19:10 ` [PATCH 14/14] drm/i915/dsb: Use chained DSBs for LUT programming Ville Syrjala
2024-08-27 6:25 ` Manna, Animesh
2024-06-24 19:54 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-06-24 19:54 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-24 20:01 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-25 14:42 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsb: Use chained DSBs for LUT programming (rev2) Patchwork
2024-06-25 14:42 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-25 14:55 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-26 2:30 ` ✗ Fi.CI.IGT: failure for drm/i915/dsb: Use chained DSBs for LUT programming Patchwork
2024-06-26 9:57 ` ✗ Fi.CI.IGT: failure for drm/i915/dsb: Use chained DSBs for LUT programming (rev2) Patchwork
2024-08-28 12:06 ` ✗ Fi.CI.BUILD: warning for drm/i915/dsb: Use chained DSBs for LUT programming (rev3) Patchwork
2024-08-28 12:06 ` ✗ Fi.CI.CHECKPATCH: " Patchwork
2024-08-28 12:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-08-28 12:27 ` ✓ Fi.CI.BAT: success " Patchwork
2024-08-29 8:56 ` ✗ Fi.CI.IGT: 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=87ikxxe9nn.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@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.