All of lore.kernel.org
 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
Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/hotplug: refactor hotplug init slightly
Date: Fri, 16 Sep 2022 12:29:44 +0300	[thread overview]
Message-ID: <YyRCCEUmfhWCdoAZ@intel.com> (raw)
In-Reply-To: <20220909124234.2124050-2-jani.nikula@intel.com>

On Fri, Sep 09, 2022 at 03:42:34PM +0300, Jani Nikula wrote:
> Rename intel_hpd_init_work() to the more generic intel_hpd_init_early(),
> and move the hotplug storm initialization there. This lets us move the
> HPD_STORM_DEFAULT_THRESHOLD macro to intel_hotplug.c too.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

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

> ---
>  drivers/gpu/drm/i915/display/intel_hotplug.c | 22 +++++++++++++++-----
>  drivers/gpu/drm/i915/display/intel_hotplug.h |  2 +-
>  drivers/gpu/drm/i915/i915_drv.h              |  3 ---
>  drivers/gpu/drm/i915/i915_irq.c              | 11 +---------
>  4 files changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index 4faae25d76c0..352a1b53b63e 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -90,6 +90,9 @@ enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
>  	return HPD_PORT_A + port - PORT_A;
>  }
>  
> +/* Threshold == 5 for long IRQs, 50 for short */
> +#define HPD_STORM_DEFAULT_THRESHOLD	50
> +
>  #define HPD_STORM_DETECT_PERIOD		1000
>  #define HPD_STORM_REENABLE_DELAY	(2 * 60 * 1000)
>  #define HPD_RETRY_DELAY			1000
> @@ -711,14 +714,23 @@ void intel_hpd_poll_disable(struct drm_i915_private *dev_priv)
>  	schedule_work(&dev_priv->display.hotplug.poll_init_work);
>  }
>  
> -void intel_hpd_init_work(struct drm_i915_private *dev_priv)
> +void intel_hpd_init_early(struct drm_i915_private *i915)
>  {
> -	INIT_DELAYED_WORK(&dev_priv->display.hotplug.hotplug_work,
> +	INIT_DELAYED_WORK(&i915->display.hotplug.hotplug_work,
>  			  i915_hotplug_work_func);
> -	INIT_WORK(&dev_priv->display.hotplug.dig_port_work, i915_digport_work_func);
> -	INIT_WORK(&dev_priv->display.hotplug.poll_init_work, i915_hpd_poll_init_work);
> -	INIT_DELAYED_WORK(&dev_priv->display.hotplug.reenable_work,
> +	INIT_WORK(&i915->display.hotplug.dig_port_work, i915_digport_work_func);
> +	INIT_WORK(&i915->display.hotplug.poll_init_work, i915_hpd_poll_init_work);
> +	INIT_DELAYED_WORK(&i915->display.hotplug.reenable_work,
>  			  intel_hpd_irq_storm_reenable_work);
> +
> +	i915->display.hotplug.hpd_storm_threshold = HPD_STORM_DEFAULT_THRESHOLD;
> +	/* If we have MST support, we want to avoid doing short HPD IRQ storm
> +	 * detection, as short HPD storms will occur as a natural part of
> +	 * sideband messaging with MST.
> +	 * On older platforms however, IRQ storms can occur with both long and
> +	 * short pulses, as seen on some G4x systems.
> +	 */
> +	i915->display.hotplug.hpd_short_storm_enabled = !HAS_DP_MST(i915);
>  }
>  
>  void intel_hpd_cancel_work(struct drm_i915_private *dev_priv)
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.h b/drivers/gpu/drm/i915/display/intel_hotplug.h
> index aa84e381d6c3..424ae5dbf5a0 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.h
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.h
> @@ -22,7 +22,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv,
>  			   u32 pin_mask, u32 long_mask);
>  void intel_hpd_trigger_irq(struct intel_digital_port *dig_port);
>  void intel_hpd_init(struct drm_i915_private *dev_priv);
> -void intel_hpd_init_work(struct drm_i915_private *dev_priv);
> +void intel_hpd_init_early(struct drm_i915_private *i915);
>  void intel_hpd_cancel_work(struct drm_i915_private *dev_priv);
>  enum hpd_pin intel_hpd_pin_default(struct drm_i915_private *dev_priv,
>  				   enum port port);
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index be201ba5e9ab..c91cccb2b8c7 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -75,9 +75,6 @@ struct intel_limit;
>  struct intel_overlay_error_state;
>  struct vlv_s0ix_state;
>  
> -/* Threshold == 5 for long IRQs, 50 for short */
> -#define HPD_STORM_DEFAULT_THRESHOLD 50
> -
>  #define I915_GEM_GPU_DOMAINS \
>  	(I915_GEM_DOMAIN_RENDER | \
>  	 I915_GEM_DOMAIN_SAMPLER | \
> diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
> index 515648cd1233..8ffd81243a19 100644
> --- a/drivers/gpu/drm/i915/i915_irq.c
> +++ b/drivers/gpu/drm/i915/i915_irq.c
> @@ -4399,7 +4399,7 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
>  
>  	intel_hpd_init_pins(dev_priv);
>  
> -	intel_hpd_init_work(dev_priv);
> +	intel_hpd_init_early(dev_priv);
>  
>  	dev->vblank_disable_immediate = true;
>  
> @@ -4413,15 +4413,6 @@ void intel_irq_init(struct drm_i915_private *dev_priv)
>  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
>  		dev_priv->display_irqs_enabled = false;
>  
> -	dev_priv->display.hotplug.hpd_storm_threshold = HPD_STORM_DEFAULT_THRESHOLD;
> -	/* If we have MST support, we want to avoid doing short HPD IRQ storm
> -	 * detection, as short HPD storms will occur as a natural part of
> -	 * sideband messaging with MST.
> -	 * On older platforms however, IRQ storms can occur with both long and
> -	 * short pulses, as seen on some G4x systems.
> -	 */
> -	dev_priv->display.hotplug.hpd_short_storm_enabled = !HAS_DP_MST(dev_priv);
> -
>  	if (HAS_GMCH(dev_priv)) {
>  		if (I915_HAS_HOTPLUG(dev_priv))
>  			dev_priv->display.funcs.hotplug = &i915_hpd_funcs;
> -- 
> 2.34.1

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2022-09-16  9:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-09 12:42 [Intel-gfx] [PATCH 1/2] drm/i915/hotplug: move hotplug storm debugfs to intel_hotplug.c Jani Nikula
2022-09-09 12:42 ` [Intel-gfx] [PATCH 2/2] drm/i915/hotplug: refactor hotplug init slightly Jani Nikula
2022-09-16  9:29   ` Ville Syrjälä [this message]
2022-09-09 17:10 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/2] drm/i915/hotplug: move hotplug storm debugfs to intel_hotplug.c Patchwork
2022-09-09 17:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-09-09 23:11 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=YyRCCEUmfhWCdoAZ@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@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 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.