All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: extract AUX mask assignment to separate function
Date: Mon, 25 Feb 2019 21:20:35 +0200	[thread overview]
Message-ID: <20190225192035.GL20097@intel.com> (raw)
In-Reply-To: <20190222235954.9795-1-lucas.demarchi@intel.com>

On Fri, Feb 22, 2019 at 03:59:54PM -0800, Lucas De Marchi wrote:
> No change in behavior, this only allows to more easily follow the flow
> of gen8_de_irq_handler without the mask assignments for each platform.
> This also re-organizes the branches a little bit, so the one-off case
> for CNL_WITH_PORT_F is separate from the generic gen >= 11.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Jose Souza <jose.souza@intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 34 +++++++++++++++++++--------------
>  1 file changed, 20 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 7c7e84e86c6a..524caf168a01 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2676,6 +2676,25 @@ static void gen11_hpd_irq_handler(struct drm_i915_private *dev_priv, u32 iir)
>  		DRM_ERROR("Unexpected DE HPD interrupt 0x%08x\n", iir);
>  }
>  
> +static u32 de_port_iir_aux_mask(struct drm_i915_private *dev_priv)

I would drop the "iir" since this applies to all irq registers.
And maybe prefix with "gen8_" ?

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

> +{
> +	u32 mask = GEN8_AUX_CHANNEL_A;
> +
> +	if (INTEL_GEN(dev_priv) >= 9)
> +		mask |= GEN9_AUX_CHANNEL_B |
> +			GEN9_AUX_CHANNEL_C |
> +			GEN9_AUX_CHANNEL_D;
> +
> +	if (IS_CNL_WITH_PORT_F(dev_priv))
> +		mask |= CNL_AUX_CHANNEL_F;
> +
> +	if (INTEL_GEN(dev_priv) >= 11)
> +		mask |= ICL_AUX_CHANNEL_E |
> +			CNL_AUX_CHANNEL_F;
> +
> +	return mask;
> +}
> +
>  static irqreturn_t
>  gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
>  {
> @@ -2731,20 +2750,7 @@ gen8_de_irq_handler(struct drm_i915_private *dev_priv, u32 master_ctl)
>  			I915_WRITE(GEN8_DE_PORT_IIR, iir);
>  			ret = IRQ_HANDLED;
>  
> -			tmp_mask = GEN8_AUX_CHANNEL_A;
> -			if (INTEL_GEN(dev_priv) >= 9)
> -				tmp_mask |= GEN9_AUX_CHANNEL_B |
> -					    GEN9_AUX_CHANNEL_C |
> -					    GEN9_AUX_CHANNEL_D;
> -
> -			if (INTEL_GEN(dev_priv) >= 11)
> -				tmp_mask |= ICL_AUX_CHANNEL_E;
> -
> -			if (IS_CNL_WITH_PORT_F(dev_priv) ||
> -			    INTEL_GEN(dev_priv) >= 11)
> -				tmp_mask |= CNL_AUX_CHANNEL_F;
> -
> -			if (iir & tmp_mask) {
> +			if (iir & de_port_iir_aux_mask(dev_priv)) {
>  				dp_aux_irq_handler(dev_priv);
>  				found = true;
>  			}
> -- 
> 2.20.0

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-02-25 19:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22 23:59 [PATCH] drm/i915: extract AUX mask assignment to separate function Lucas De Marchi
2019-02-23  0:07 ` Souza, Jose
2019-02-23  0:51 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-02-23  7:25 ` ✓ Fi.CI.IGT: " Patchwork
2019-02-25 19:20 ` Ville Syrjälä [this message]
2019-02-26  0:49   ` [PATCH v2] " Lucas De Marchi
2019-02-26  1:33 ` ✓ Fi.CI.BAT: success for drm/i915: extract AUX mask assignment to separate function (rev2) Patchwork
2019-02-26  8:28 ` ✓ Fi.CI.IGT: " 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=20190225192035.GL20097@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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.