From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915/irq: use a dedicated IMR cache for VLV/CHV
Date: Thu, 18 Sep 2025 20:31:06 +0300 [thread overview]
Message-ID: <aMxB2qMVdcGxElZo@intel.com> (raw)
In-Reply-To: <cef6dee8d0b02ff76180c5879f3056e102947a57.1758198300.git.jani.nikula@intel.com>
On Thu, Sep 18, 2025 at 03:25:44PM +0300, Jani Nikula wrote:
> There are three groups of platforms using i915->irq_mask independently:
> gen 2-4, VLV/CHV, and gen 5-7.
>
> The VLV/CHV usage is purely limited to display. Move its irq_mask usage
> to struct intel_display as vlv_imr_mask for VLV/CHV.
>
> vlv_imr_mask could be put inside a union with de_irq_mask[], but keep
> them separate to avoid accidental aliasing of the values.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display_core.h | 5 +++++
> drivers/gpu/drm/i915/display/intel_display_irq.c | 11 ++++-------
> 2 files changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
> index 791021a4e3bb..48a707557c29 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_core.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_core.h
> @@ -475,6 +475,11 @@ struct intel_display {
>
> struct work_struct vblank_notify_work;
>
> + /*
> + * Cached value of VLV/CHV IMR to avoid reads in updating the
> + * bitfield.
> + */
> + u32 vlv_imr_mask;
> u32 de_irq_mask[I915_MAX_PIPES];
> u32 pipestat_irq_mask[I915_MAX_PIPES];
> } irq;
> diff --git a/drivers/gpu/drm/i915/display/intel_display_irq.c b/drivers/gpu/drm/i915/display/intel_display_irq.c
> index 123e054affbe..df718670546b 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_irq.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_irq.c
> @@ -1865,8 +1865,6 @@ void vlv_display_error_irq_handler(struct intel_display *display,
>
> static void _vlv_display_irq_reset(struct intel_display *display)
> {
> - struct drm_i915_private *dev_priv = to_i915(display->drm);
> -
> if (display->platform.cherryview)
> intel_de_write(display, DPINVGTT, DPINVGTT_STATUS_MASK_CHV);
> else
> @@ -1881,7 +1879,7 @@ static void _vlv_display_irq_reset(struct intel_display *display)
> i9xx_pipestat_irq_reset(display);
>
> intel_display_irq_regs_reset(display, VLV_IRQ_REGS);
> - dev_priv->irq_mask = ~0u;
> + display->irq.vlv_imr_mask = ~0u;
> }
>
> void vlv_display_irq_reset(struct intel_display *display)
> @@ -1939,7 +1937,6 @@ static u32 vlv_error_mask(void)
>
> static void _vlv_display_irq_postinstall(struct intel_display *display)
> {
> - struct drm_i915_private *dev_priv = to_i915(display->drm);
> u32 pipestat_mask;
> u32 enable_mask;
> enum pipe pipe;
> @@ -1973,11 +1970,11 @@ static void _vlv_display_irq_postinstall(struct intel_display *display)
> enable_mask |= I915_DISPLAY_PIPE_C_EVENT_INTERRUPT |
> I915_LPE_PIPE_C_INTERRUPT;
>
> - drm_WARN_ON(display->drm, dev_priv->irq_mask != ~0u);
> + drm_WARN_ON(display->drm, display->irq.vlv_imr_mask != ~0u);
>
> - dev_priv->irq_mask = ~enable_mask;
> + display->irq.vlv_imr_mask = ~enable_mask;
>
> - intel_display_irq_regs_init(display, VLV_IRQ_REGS, dev_priv->irq_mask, enable_mask);
> + intel_display_irq_regs_init(display, VLV_IRQ_REGS, display->irq.vlv_imr_mask, enable_mask);
> }
>
> void vlv_display_irq_postinstall(struct intel_display *display)
> --
> 2.47.3
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-09-18 17:31 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-18 12:25 [PATCH 0/5] drm/i915/irq: clarify and refactor ->irq_mask Jani Nikula
2025-09-18 12:25 ` [PATCH 1/5] drm/i915/irq: use a dedicated IMR cache for VLV/CHV Jani Nikula
2025-09-18 17:31 ` Ville Syrjälä [this message]
2025-09-18 12:25 ` [PATCH 2/5] drm/i915/irq: use a dedicated IMR cache for gen 5-7 Jani Nikula
2025-09-18 17:31 ` Ville Syrjälä
2025-09-18 12:25 ` [PATCH 3/5] drm/i915/irq: rename irq_mask to gen2_imr_mask Jani Nikula
2025-09-18 17:32 ` Ville Syrjälä
2025-09-18 12:25 ` [PATCH 4/5] drm/i915/irq: rename de_irq_mask[] to de_pipe_imr_mask[] Jani Nikula
2025-09-18 17:33 ` Ville Syrjälä
2025-09-18 12:25 ` [PATCH 5/5] drm/i915/irq: add ilk_display_irq_reset() Jani Nikula
2025-09-18 12:35 ` Ville Syrjälä
2025-09-18 12:42 ` Jani Nikula
2025-09-18 12:41 ` [PATCH v2] " Jani Nikula
2025-09-18 12:54 ` Ville Syrjälä
2025-09-18 13:46 ` Jani Nikula
2025-09-18 13:38 ` [PATCH v3] " Jani Nikula
2025-09-18 17:25 ` Ville Syrjälä
2025-09-19 7:17 ` Jani Nikula
2025-09-18 12:46 ` ✗ CI.checkpatch: warning for drm/i915/irq: clarify and refactor ->irq_mask Patchwork
2025-09-18 12:47 ` ✓ CI.KUnit: success " Patchwork
2025-09-18 13:02 ` ✗ CI.checksparse: warning " Patchwork
2025-09-18 13:30 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-09-18 13:36 ` ✗ CI.checkpatch: warning for drm/i915/irq: clarify and refactor ->irq_mask (rev2) Patchwork
2025-09-18 13:37 ` ✓ CI.KUnit: success " Patchwork
2025-09-18 13:52 ` ✗ CI.checksparse: warning " Patchwork
2025-09-18 14:18 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-18 14:30 ` ✗ CI.checkpatch: warning for drm/i915/irq: clarify and refactor ->irq_mask (rev3) Patchwork
2025-09-18 14:32 ` ✓ CI.KUnit: success " Patchwork
2025-09-18 14:47 ` ✗ CI.checksparse: warning " Patchwork
2025-09-18 15:06 ` ✓ Xe.CI.BAT: success " Patchwork
2025-09-18 21:00 ` ✗ Xe.CI.Full: failure for drm/i915/irq: clarify and refactor ->irq_mask Patchwork
2025-09-18 22:30 ` ✓ Xe.CI.Full: success for drm/i915/irq: clarify and refactor ->irq_mask (rev2) Patchwork
2025-09-18 23:11 ` ✗ Xe.CI.Full: failure for drm/i915/irq: clarify and refactor ->irq_mask (rev3) 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=aMxB2qMVdcGxElZo@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox