intel-xe.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
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 v2 2/5] drm/i915/irq: initialize gen2_imr_mask in terms of enable_mask
Date: Tue, 23 Sep 2025 17:40:30 +0300	[thread overview]
Message-ID: <aNKxXqMyyhMF66RL@intel.com> (raw)
In-Reply-To: <e3b612ce4decea699bde2c52aeaef48bf95f7abc.1758637773.git.jani.nikula@intel.com>

On Tue, Sep 23, 2025 at 05:31:05PM +0300, Jani Nikula wrote:
> Instead of initializing gen2_imr_mask and enable_mask independently, use
> the latter for initializing the former. This also highlights the
> differences in the masks, i.e. what's set to enable_mask after it's been
> used to initialize gen2_imr_mask.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 34 ++++++++++++---------------------
>  1 file changed, 12 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 56f231591a3e..04de02fc08d9 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -895,26 +895,20 @@ static void i915_irq_postinstall(struct drm_i915_private *dev_priv)
>  
>  	gen2_error_init(uncore, GEN2_ERROR_REGS, ~i9xx_error_mask(dev_priv));
>  
> -	dev_priv->gen2_imr_mask =
> -		~(I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
> -		  I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
> -		  I915_MASTER_ERROR_INTERRUPT);
> -
>  	enable_mask =
>  		I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
>  		I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
> -		I915_MASTER_ERROR_INTERRUPT |
> -		I915_USER_INTERRUPT;
> +		I915_MASTER_ERROR_INTERRUPT;
>  
> -	if (DISPLAY_VER(display) >= 3) {
> -		dev_priv->gen2_imr_mask &= ~I915_ASLE_INTERRUPT;
> +	if (DISPLAY_VER(display) >= 3)
>  		enable_mask |= I915_ASLE_INTERRUPT;
> -	}
>  
> -	if (HAS_HOTPLUG(display)) {
> -		dev_priv->gen2_imr_mask &= ~I915_DISPLAY_PORT_INTERRUPT;
> +	if (HAS_HOTPLUG(display))
>  		enable_mask |= I915_DISPLAY_PORT_INTERRUPT;
> -	}
> +
> +	dev_priv->gen2_imr_mask = ~enable_mask;
> +
> +	enable_mask |= I915_USER_INTERRUPT;

This diff is susprisingly hard to read :/

But it *looks* ok to me.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	gen2_irq_init(uncore, GEN2_IRQ_REGS, dev_priv->gen2_imr_mask, enable_mask);
>  
> @@ -1016,20 +1010,16 @@ static void i965_irq_postinstall(struct drm_i915_private *dev_priv)
>  
>  	gen2_error_init(uncore, GEN2_ERROR_REGS, ~i965_error_mask(dev_priv));
>  
> -	dev_priv->gen2_imr_mask =
> -		~(I915_ASLE_INTERRUPT |
> -		  I915_DISPLAY_PORT_INTERRUPT |
> -		  I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
> -		  I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
> -		  I915_MASTER_ERROR_INTERRUPT);
> -
>  	enable_mask =
>  		I915_ASLE_INTERRUPT |
>  		I915_DISPLAY_PORT_INTERRUPT |
>  		I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
>  		I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
> -		I915_MASTER_ERROR_INTERRUPT |
> -		I915_USER_INTERRUPT;
> +		I915_MASTER_ERROR_INTERRUPT;
> +
> +	dev_priv->gen2_imr_mask = ~enable_mask;
> +
> +	enable_mask |= I915_USER_INTERRUPT;
>  
>  	if (IS_G4X(dev_priv))
>  		enable_mask |= I915_BSD_USER_INTERRUPT;
> -- 
> 2.47.3

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-09-23 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 14:31 [PATCH v2 0/5] drm/i915/irq: display irq refactoring Jani Nikula
2025-09-23 14:31 ` [PATCH v2 1/5] drm/i915/irq: drop intel_psr_regs.h include Jani Nikula
2025-09-23 14:39   ` Ville Syrjälä
2025-09-23 14:31 ` [PATCH v2 2/5] drm/i915/irq: initialize gen2_imr_mask in terms of enable_mask Jani Nikula
2025-09-23 14:40   ` Ville Syrjälä [this message]
2025-09-23 14:31 ` [PATCH v2 3/5] drm/i915/irq: abstract i9xx_display_irq_enable_mask() Jani Nikula
2025-09-23 14:41   ` Ville Syrjälä
2025-09-23 14:31 ` [PATCH v2 4/5] drm/i915/irq: move check for HAS_HOTPLUG() inside i9xx_hpd_irq_ack() Jani Nikula
2025-09-23 14:43   ` Ville Syrjälä
2025-09-23 14:31 ` [PATCH v2 5/5] drm/i915/irq: split ILK display irq handling Jani Nikula
2025-09-23 14:45   ` Ville Syrjälä
2025-09-24  6:47     ` Jani Nikula
2025-09-23 15:08 ` ✓ CI.KUnit: success for drm/i915/irq: display irq refactoring (rev2) Patchwork
2025-09-23 17:58 ` ✗ 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=aNKxXqMyyhMF66RL@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;
as well as URLs for NNTP newsgroup(s).