All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [11/12] drm/i915: Introduce intel_hpd_hotplug_irqs()
Date: Wed, 9 Sep 2020 00:46:56 +0000	[thread overview]
Message-ID: <d716a2310227ceca42abc51a75cae51fed79dc62.camel@intel.com> (raw)
In-Reply-To: <20200630215601.28557-12-ville.syrjala@linux.intel.com>

On Wed, 2020-07-01 at 00:56 +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <
> ville.syrjala@linux.intel.com
> >
> 
> Introduce intel_hpd_hotplug_irqs() as a partner to
> intel_hpd_enabled_irqs(). There's no need to care about the
> encoders which we're not exposing, so we can avoid hardocoding

hard-coding

> the masks in various places.

Pretty nice patch, you only missed to do this change in the irq_handlers so we could nuke the SDE_DDI_MASKs, or are you planning to do this in a
follow up patch? If later consider this

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Signed-off-by: Ville Syrjälä <
> ville.syrjala@linux.intel.com
> >
> ---
>  drivers/gpu/drm/i915/i915_irq.c | 50 +++++++++++++++------------------
>  1 file changed, 23 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 95ab4432a87d..b8a6a21f4c54 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -2943,6 +2943,18 @@ static u32 intel_hpd_enabled_irqs(struct drm_i915_private *dev_priv,
>  	return enabled_irqs;
>  }
>  
> +static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
> +				  const u32 hpd[HPD_NUM_PINS])
> +{
> +	struct intel_encoder *encoder;
> +	u32 hotplug_irqs = 0;
> +
> +	for_each_intel_encoder(&dev_priv->drm, encoder)
> +		hotplug_irqs |= hpd[encoder->hpd_pin];
> +
> +	return hotplug_irqs;
> +}
> +
>  static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>  	u32 hotplug;
> @@ -2972,12 +2984,8 @@ static void ibx_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  {
>  	u32 hotplug_irqs, enabled_irqs;
>  
> -	if (HAS_PCH_IBX(dev_priv))
> -		hotplug_irqs = SDE_HOTPLUG_MASK;
> -	else
> -		hotplug_irqs = SDE_HOTPLUG_MASK_CPT;
> -
>  	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
>  
>  	ibx_display_interrupt_update(dev_priv, hotplug_irqs, enabled_irqs);
>  
> @@ -3005,13 +3013,12 @@ static void icp_tc_hpd_detection_setup(struct drm_i915_private *dev_priv,
>  }
>  
>  static void icp_hpd_irq_setup(struct drm_i915_private *dev_priv,
> -			      u32 sde_ddi_mask, u32 sde_tc_mask,
>  			      u32 ddi_enable_mask, u32 tc_enable_mask)
>  {
>  	u32 hotplug_irqs, enabled_irqs;
>  
> -	hotplug_irqs = sde_ddi_mask | sde_tc_mask;
>  	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
>  
>  	I915_WRITE(SHPD_FILTER_CNT, SHPD_FILTER_CNT_500_ADJ);
>  
> @@ -3029,7 +3036,6 @@ static void icp_hpd_irq_setup(struct drm_i915_private *dev_priv,
>  static void mcc_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  {
>  	icp_hpd_irq_setup(dev_priv,
> -			  SDE_DDI_MASK_ICP, SDE_TC_HOTPLUG_ICP(PORT_TC1),
>  			  ICP_DDI_HPD_ENABLE_MASK, ICP_TC_HPD_ENABLE(PORT_TC1));
>  }
>  
> @@ -3041,7 +3047,6 @@ static void mcc_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  static void jsp_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  {
>  	icp_hpd_irq_setup(dev_priv,
> -			  SDE_DDI_MASK_TGP, 0,
>  			  TGP_DDI_HPD_ENABLE_MASK, 0);
>  }
>  
> @@ -3074,7 +3079,7 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  	u32 val;
>  
>  	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> -	hotplug_irqs = GEN11_DE_TC_HOTPLUG_MASK | GEN11_DE_TBT_HOTPLUG_MASK;
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.hpd);
>  
>  	val = I915_READ(GEN11_DE_HPD_IMR);
>  	val &= ~hotplug_irqs;
> @@ -3085,10 +3090,10 @@ static void gen11_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  	gen11_hpd_detection_setup(dev_priv);
>  
>  	if (INTEL_PCH_TYPE(dev_priv) >= PCH_TGP)
> -		icp_hpd_irq_setup(dev_priv, SDE_DDI_MASK_TGP, SDE_TC_MASK_TGP,
> +		icp_hpd_irq_setup(dev_priv,
>  				  TGP_DDI_HPD_ENABLE_MASK, TGP_TC_HPD_ENABLE_MASK);
>  	else if (INTEL_PCH_TYPE(dev_priv) >= PCH_ICP)
> -		icp_hpd_irq_setup(dev_priv, SDE_DDI_MASK_ICP, SDE_TC_MASK_ICP,
> +		icp_hpd_irq_setup(dev_priv,
>  				  ICP_DDI_HPD_ENABLE_MASK, ICP_TC_HPD_ENABLE_MASK);
>  }
>  
> @@ -3124,8 +3129,8 @@ static void spt_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  	if (INTEL_PCH_TYPE(dev_priv) >= PCH_CNP)
>  		I915_WRITE(SHPD_FILTER_CNT, SHPD_FILTER_CNT_500_ADJ);
>  
> -	hotplug_irqs = SDE_HOTPLUG_MASK_SPT;
>  	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.pch_hpd);
>  
>  	ibx_display_interrupt_update(dev_priv, hotplug_irqs, enabled_irqs);
>  
> @@ -3152,22 +3157,13 @@ static void ilk_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  {
>  	u32 hotplug_irqs, enabled_irqs;
>  
> -	if (INTEL_GEN(dev_priv) >= 8) {
> -		hotplug_irqs = GEN8_PORT_DP_A_HOTPLUG;
> -		enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> +	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.hpd);
>  
> +	if (INTEL_GEN(dev_priv) >= 8)
>  		bdw_update_port_irq(dev_priv, hotplug_irqs, enabled_irqs);
> -	} else if (INTEL_GEN(dev_priv) >= 7) {
> -		hotplug_irqs = DE_DP_A_HOTPLUG_IVB;
> -		enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> -
> +	else
>  		ilk_update_display_irq(dev_priv, hotplug_irqs, enabled_irqs);
> -	} else {
> -		hotplug_irqs = DE_DP_A_HOTPLUG;
> -		enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> -
> -		ilk_update_display_irq(dev_priv, hotplug_irqs, enabled_irqs);
> -	}
>  
>  	ilk_hpd_detection_setup(dev_priv);
>  
> @@ -3216,7 +3212,7 @@ static void bxt_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  	u32 hotplug_irqs, enabled_irqs;
>  
>  	enabled_irqs = intel_hpd_enabled_irqs(dev_priv, dev_priv->hotplug.hpd);
> -	hotplug_irqs = BXT_DE_PORT_HOTPLUG_MASK;
> +	hotplug_irqs = intel_hpd_hotplug_irqs(dev_priv, dev_priv->hotplug.hpd);
>  
>  	bdw_update_port_irq(dev_priv, hotplug_irqs, enabled_irqs);
>  
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-09-09  0:47 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 21:55 [Intel-gfx] [PATCH 00/12] drm/i915: Futher hotplug cleanups Ville Syrjala
2020-06-30 21:55 ` [Intel-gfx] [PATCH 01/12] drm/i915: Add more AUX CHs to the enum Ville Syrjala
2020-09-08 16:21   ` [Intel-gfx] [01/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 02/12] drm/i915: Add PORT_{H, I} to intel_port_to_power_domain() Ville Syrjala
2020-09-08 16:21   ` [Intel-gfx] [02/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 03/12] drm/i915: Add AUX_CH_{H, I} power domain handling Ville Syrjala
2020-09-08 16:23   ` [Intel-gfx] [03/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 04/12] drm/i915: Add VBT DVO ports H and I Ville Syrjala
2020-09-08 16:37   ` [Intel-gfx] [04/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 05/12] drm/i915: Add VBT AUX CH " Ville Syrjala
2020-09-08 16:38   ` [Intel-gfx] [05/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 06/12] drm/i915: Nuke the redundant TC/TBT HPD bit defines Ville Syrjala
2020-09-08 16:41   ` [Intel-gfx] [06/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 07/12] drm/i915: Configure GEN11_{TBT, TC}_HOTPLUG_CTL for ports TC5/6 Ville Syrjala
2020-09-08 16:45   ` [Intel-gfx] [07/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 08/12] drm/i915: Split icp_hpd_detection_setup() into ddi vs. tc parts Ville Syrjala
2020-09-08 16:49   ` [Intel-gfx] [08/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 09/12] drm/i915: Move hpd_pin setup to encoder init Ville Syrjala
2020-09-08 16:57   ` [Intel-gfx] [09/12] " Souza, Jose
2020-06-30 21:55 ` [Intel-gfx] [PATCH 10/12] drm/i915: Introduce HPD_PORT_TC<n> Ville Syrjala
2020-09-12  1:30   ` [Intel-gfx] [10/12] " Souza, Jose
2020-09-14 14:48     ` Ville Syrjälä
2020-09-14 16:58       ` Souza, Jose
2020-09-14 17:06         ` Ville Syrjälä
2020-06-30 21:56 ` [Intel-gfx] [PATCH 11/12] drm/i915: Introduce intel_hpd_hotplug_irqs() Ville Syrjala
2020-09-09  0:46   ` Souza, Jose [this message]
2020-09-09 19:17     ` [Intel-gfx] [11/12] " Ville Syrjälä
2020-06-30 21:56 ` [Intel-gfx] [PATCH 12/12] drm/i915: Nuke pointless variable Ville Syrjala
2020-09-08 17:00   ` [Intel-gfx] [12/12] " Souza, Jose
2020-06-30 22:36 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Futher hotplug cleanups Patchwork
2020-07-01  3:20 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-07-01  6:53 ` [Intel-gfx] ✓ 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=d716a2310227ceca42abc51a75cae51fed79dc62.camel@intel.com \
    --to=jose.souza@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.