All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Govindapillai, Vinod" <vinod.govindapillai@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] [PATCH 7/7] drm/i915: Reuse <platform>_hotplug_mask() in .hpd_detection_setup()
Date: Fri, 14 Apr 2023 22:05:40 +0000	[thread overview]
Message-ID: <0906bb636feaccbd2be1dcec7f49599be8b359aa.camel@intel.com> (raw)
In-Reply-To: <20230302161013.29213-8-ville.syrjala@linux.intel.com>

On Thu, 2023-03-02 at 18:10 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace the hardcoded masks with just a loop over all hpd
> pins using the <platform>_hotplug_mask() functions.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---

Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com>

>  drivers/gpu/drm/i915/i915_irq.c | 57 +++++++++++++--------------------
>  1 file changed, 22 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 9d00b840727c..11c6a9ca3c23 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -82,6 +82,7 @@ static inline void pmu_irq_stats(struct drm_i915_private *i915,
>  
>  typedef bool (*long_pulse_detect_func)(enum hpd_pin pin, u32 val);
>  typedef u32 (*hotplug_enables_func)(struct intel_encoder *encoder);
> +typedef u32 (*hotplug_mask_func)(enum hpd_pin pin);
>  
>  static const u32 hpd_ilk[HPD_NUM_PINS] = {
>         [HPD_PORT_A] = DE_DP_A_HOTPLUG,
> @@ -878,6 +879,18 @@ static u32 intel_hpd_hotplug_irqs(struct drm_i915_private *dev_priv,
>         return hotplug_irqs;
>  }
>  
> +static u32 intel_hpd_hotplug_mask(struct drm_i915_private *i915,
> +                                 hotplug_mask_func hotplug_mask)
> +{
> +       enum hpd_pin pin;
> +       u32 hotplug = 0;
> +
> +       for_each_hpd_pin(pin)
> +               hotplug |= hotplug_mask(pin);
> +
> +       return hotplug;
> +}
> +
>  static u32 intel_hpd_hotplug_enables(struct drm_i915_private *i915,
>                                      hotplug_enables_func hotplug_enables)
>  {
> @@ -2886,10 +2899,7 @@ static void ibx_hpd_detection_setup(struct drm_i915_private *dev_priv)
>          * The pulse duration bits are reserved on LPT+.
>          */
>         intel_uncore_rmw(&dev_priv->uncore, PCH_PORT_HOTPLUG,
> -                        ibx_hotplug_mask(HPD_PORT_A) |
> -                        ibx_hotplug_mask(HPD_PORT_B) |
> -                        ibx_hotplug_mask(HPD_PORT_C) |
> -                        ibx_hotplug_mask(HPD_PORT_D),
> +                        intel_hpd_hotplug_mask(dev_priv, ibx_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, ibx_hotplug_enables));
>  }
>  
> @@ -2965,10 +2975,7 @@ static u32 icp_tc_hotplug_enables(struct intel_encoder *encoder)
>  static void icp_ddi_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>         intel_uncore_rmw(&dev_priv->uncore, SHOTPLUG_CTL_DDI,
> -                        icp_ddi_hotplug_mask(HPD_PORT_A) |
> -                        icp_ddi_hotplug_mask(HPD_PORT_B) |
> -                        icp_ddi_hotplug_mask(HPD_PORT_C) |
> -                        icp_ddi_hotplug_mask(HPD_PORT_D),
> +                        intel_hpd_hotplug_mask(dev_priv, icp_ddi_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, icp_ddi_hotplug_enables));
>  }
>  
> @@ -2984,12 +2991,7 @@ static void icp_ddi_hpd_enable_detection(struct intel_encoder *encoder)
>  static void icp_tc_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>         intel_uncore_rmw(&dev_priv->uncore, SHOTPLUG_CTL_TC,
> -                        icp_tc_hotplug_mask(HPD_PORT_TC1) |
> -                        icp_tc_hotplug_mask(HPD_PORT_TC2) |
> -                        icp_tc_hotplug_mask(HPD_PORT_TC3) |
> -                        icp_tc_hotplug_mask(HPD_PORT_TC4) |
> -                        icp_tc_hotplug_mask(HPD_PORT_TC5) |
> -                        icp_tc_hotplug_mask(HPD_PORT_TC6),
> +                        intel_hpd_hotplug_mask(dev_priv, icp_tc_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, icp_tc_hotplug_enables));
>  }
>  
> @@ -3075,12 +3077,7 @@ static void dg1_hpd_irq_setup(struct drm_i915_private *dev_priv)
>  static void gen11_tc_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>         intel_uncore_rmw(&dev_priv->uncore, GEN11_TC_HOTPLUG_CTL,
> -                        gen11_hotplug_mask(HPD_PORT_TC1) |
> -                        gen11_hotplug_mask(HPD_PORT_TC2) |
> -                        gen11_hotplug_mask(HPD_PORT_TC3) |
> -                        gen11_hotplug_mask(HPD_PORT_TC4) |
> -                        gen11_hotplug_mask(HPD_PORT_TC5) |
> -                        gen11_hotplug_mask(HPD_PORT_TC6),
> +                        intel_hpd_hotplug_mask(dev_priv, gen11_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, gen11_hotplug_enables));
>  }
>  
> @@ -3096,12 +3093,7 @@ static void gen11_tc_hpd_enable_detection(struct intel_encoder *encoder)
>  static void gen11_tbt_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>         intel_uncore_rmw(&dev_priv->uncore, GEN11_TBT_HOTPLUG_CTL,
> -                        gen11_hotplug_mask(HPD_PORT_TC1) |
> -                        gen11_hotplug_mask(HPD_PORT_TC2) |
> -                        gen11_hotplug_mask(HPD_PORT_TC3) |
> -                        gen11_hotplug_mask(HPD_PORT_TC4) |
> -                        gen11_hotplug_mask(HPD_PORT_TC5) |
> -                        gen11_hotplug_mask(HPD_PORT_TC6),
> +                        intel_hpd_hotplug_mask(dev_priv, gen11_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, gen11_hotplug_enables));
>  }
>  
> @@ -3199,14 +3191,11 @@ static void spt_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  
>         /* Enable digital hotplug on the PCH */
>         intel_uncore_rmw(&dev_priv->uncore, PCH_PORT_HOTPLUG,
> -                        spt_hotplug_mask(HPD_PORT_A) |
> -                        spt_hotplug_mask(HPD_PORT_B) |
> -                        spt_hotplug_mask(HPD_PORT_C) |
> -                        spt_hotplug_mask(HPD_PORT_D),
> +                        intel_hpd_hotplug_mask(dev_priv, spt_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, spt_hotplug_enables));
>  
>         intel_uncore_rmw(&dev_priv->uncore, PCH_PORT_HOTPLUG2,
> -                        spt_hotplug2_mask(HPD_PORT_E),
> +                        intel_hpd_hotplug_mask(dev_priv, spt_hotplug2_mask),
>                          intel_hpd_hotplug_enables(dev_priv, spt_hotplug2_enables));
>  }
>  
> @@ -3275,7 +3264,7 @@ static void ilk_hpd_detection_setup(struct drm_i915_private *dev_priv)
>          * The pulse duration bits are reserved on HSW+.
>          */
>         intel_uncore_rmw(&dev_priv->uncore, DIGITAL_PORT_HOTPLUG_CNTRL,
> -                        ilk_hotplug_mask(HPD_PORT_A),
> +                        intel_hpd_hotplug_mask(dev_priv, ilk_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, ilk_hotplug_enables));
>  }
>  
> @@ -3349,9 +3338,7 @@ static u32 bxt_hotplug_enables(struct intel_encoder *encoder)
>  static void bxt_hpd_detection_setup(struct drm_i915_private *dev_priv)
>  {
>         intel_uncore_rmw(&dev_priv->uncore, PCH_PORT_HOTPLUG,
> -                        bxt_hotplug_mask(HPD_PORT_A) |
> -                        bxt_hotplug_mask(HPD_PORT_B) |
> -                        bxt_hotplug_mask(HPD_PORT_C),
> +                        intel_hpd_hotplug_mask(dev_priv, bxt_hotplug_mask),
>                          intel_hpd_hotplug_enables(dev_priv, bxt_hotplug_enables));
>  }
>  


  reply	other threads:[~2023-04-14 22:05 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 16:10 [Intel-gfx] [PATCH 0/7] drm/i915: Check HPD during eDP probe Ville Syrjala
2023-03-02 16:10 ` [Intel-gfx] [PATCH 1/7] drm/i915: Populate dig_port->connected() before connector init Ville Syrjala
2023-03-02 16:10 ` [Intel-gfx] [PATCH 2/7] drm/i915: Fix SKL DDI A digital port .connected() Ville Syrjala
2023-03-02 16:10 ` [Intel-gfx] [PATCH 3/7] drm/i915: Get rid of the gm45 HPD live state nonsense Ville Syrjala
2023-03-02 16:10 ` [Intel-gfx] [PATCH 4/7] drm/i915: Introduce <platform>_hotplug_mask() Ville Syrjala
2023-03-03 16:58   ` [Intel-gfx] [PATCH v2 " Ville Syrjala
2023-04-14 21:56     ` Govindapillai, Vinod
2023-03-02 16:10 ` [Intel-gfx] [PATCH 5/7] drm/i915: Introduce intel_hpd_enable_detection() Ville Syrjala
2023-04-14 12:59   ` Govindapillai, Vinod
2023-04-14 13:23     ` Govindapillai, Vinod
2023-04-14 14:21       ` Ville Syrjälä
2023-04-14 21:43         ` Govindapillai, Vinod
2023-03-02 16:10 ` [Intel-gfx] [PATCH 6/7] drm/i915: Check HPD live state during eDP probe Ville Syrjala
2023-04-14 13:03   ` Govindapillai, Vinod
2023-03-02 16:10 ` [Intel-gfx] [PATCH 7/7] drm/i915: Reuse <platform>_hotplug_mask() in .hpd_detection_setup() Ville Syrjala
2023-04-14 22:05   ` Govindapillai, Vinod [this message]
2023-03-02 16:29 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Check HPD during eDP probe Patchwork
2023-03-03  4:32 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-03 14:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Check HPD during eDP probe (rev2) Patchwork
2023-03-03 14:47 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-03 17:27 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Check HPD during eDP probe (rev3) Patchwork
2023-03-03 17:54 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-03-03 21:21 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Check HPD during eDP probe (rev4) Patchwork
2023-03-03 21:49 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2023-03-03 23:07 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915: Check HPD during eDP probe (rev5) Patchwork
2023-03-03 23:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-03-06 14:18 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915: Check HPD during eDP probe Patchwork
2023-03-06 22:37 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915: Check HPD during eDP probe (rev5) 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=0906bb636feaccbd2be1dcec7f49599be8b359aa.camel@intel.com \
    --to=vinod.govindapillai@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.