All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/5] drm/i915: Convert intel_hpd_irq_event() into an encoder hotplug hook
Date: Tue, 30 Jan 2018 18:22:25 -0500	[thread overview]
Message-ID: <1517354545.4938.27.camel@redhat.com> (raw)
In-Reply-To: <20180117192149.17760-1-ville.syrjala@linux.intel.com>

Almost forgot to respond to this one!

Reviewed-by: Lyude Paul <lyude@redhat.com>

On Wed, 2018-01-17 at 21:21 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Allow encoders to customize their hotplug processing by moving the
> intel_hpd_irq_event() code into an encoder hotplug vfunc. Currently
> only SDVO needs this to re-enable hotplug signalling in the SDVO
> chip. We'll use this same hook for DP/HDMI link management later.
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_crt.c     |  4 +++-
>  drivers/gpu/drm/i915/intel_ddi.c     |  1 +
>  drivers/gpu/drm/i915/intel_dp.c      |  1 +
>  drivers/gpu/drm/i915/intel_drv.h     |  6 ++++--
>  drivers/gpu/drm/i915/intel_hdmi.c    |  1 +
>  drivers/gpu/drm/i915/intel_hotplug.c | 24 ++++++++++++------------
>  drivers/gpu/drm/i915/intel_sdvo.c    | 12 ++++++++++--
>  7 files changed, 32 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_crt.c
> b/drivers/gpu/drm/i915/intel_crt.c
> index 9f31aea51dff..9bc47cff5409 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -966,8 +966,10 @@ void intel_crt_init(struct drm_i915_private *dev_priv)
>  	crt->base.power_domain = POWER_DOMAIN_PORT_CRT;
>  
>  	if (I915_HAS_HOTPLUG(dev_priv) &&
> -	    !dmi_check_system(intel_spurious_crt_detect))
> +	    !dmi_check_system(intel_spurious_crt_detect)) {
>  		crt->base.hpd_pin = HPD_CRT;
> +		crt->base.hotplug = intel_encoder_hotplug;
> +	}
>  
>  	if (HAS_DDI(dev_priv)) {
>  		crt->base.port = PORT_E;
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> b/drivers/gpu/drm/i915/intel_ddi.c
> index 6260a882fbe4..1aeae3e97013 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2866,6 +2866,7 @@ void intel_ddi_init(struct drm_i915_private *dev_priv,
> enum port port)
>  	drm_encoder_init(&dev_priv->drm, encoder, &intel_ddi_funcs,
>  			 DRM_MODE_ENCODER_TMDS, "DDI %c", port_name(port));
>  
> +	intel_encoder->hotplug = intel_encoder_hotplug;
>  	intel_encoder->compute_output_type = intel_ddi_compute_output_type;
>  	intel_encoder->compute_config = intel_ddi_compute_config;
>  	intel_encoder->enable = intel_enable_ddi;
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 68229f53d5b8..6bbf14410c2a 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -6400,6 +6400,7 @@ bool intel_dp_init(struct drm_i915_private *dev_priv,
>  			     "DP %c", port_name(port)))
>  		goto err_encoder_init;
>  
> +	intel_encoder->hotplug = intel_encoder_hotplug;
>  	intel_encoder->compute_config = intel_dp_compute_config;
>  	intel_encoder->get_hw_state = intel_dp_get_hw_state;
>  	intel_encoder->get_config = intel_dp_get_config;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h
> b/drivers/gpu/drm/i915/intel_drv.h
> index 5c8e260ca2bc..5ea1dc3f63bf 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -214,7 +214,8 @@ struct intel_encoder {
>  	enum intel_output_type type;
>  	enum port port;
>  	unsigned int cloneable;
> -	void (*hot_plug)(struct intel_encoder *);
> +	bool (*hotplug)(struct intel_encoder *encoder,
> +			struct intel_connector *connector);
>  	enum intel_output_type (*compute_output_type)(struct intel_encoder *,
>  						      struct intel_crtc_state
> *,
>  						      struct
> drm_connector_state *);
> @@ -1690,7 +1691,8 @@ int intel_dsi_dcs_init_backlight_funcs(struct
> intel_connector *intel_connector);
>  void intel_dvo_init(struct drm_i915_private *dev_priv);
>  /* intel_hotplug.c */
>  void intel_hpd_poll_init(struct drm_i915_private *dev_priv);
> -
> +bool intel_encoder_hotplug(struct intel_encoder *encoder,
> +			   struct intel_connector *connector);
>  
>  /* legacy fbdev emulation in intel_fbdev.c */
>  #ifdef CONFIG_DRM_FBDEV_EMULATION
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c
> b/drivers/gpu/drm/i915/intel_hdmi.c
> index 691f15b59124..4a93cfd7a28e 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -2348,6 +2348,7 @@ void intel_hdmi_init(struct drm_i915_private *dev_priv,
>  			 &intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
>  			 "HDMI %c", port_name(port));
>  
> +	intel_encoder->hotplug = intel_encoder_hotplug;
>  	intel_encoder->compute_config = intel_hdmi_compute_config;
>  	if (HAS_PCH_SPLIT(dev_priv)) {
>  		intel_encoder->disable = pch_disable_hdmi;
> diff --git a/drivers/gpu/drm/i915/intel_hotplug.c
> b/drivers/gpu/drm/i915/intel_hotplug.c
> index 875d5d218d5c..0191c7831a06 100644
> --- a/drivers/gpu/drm/i915/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/intel_hotplug.c
> @@ -263,24 +263,25 @@ static void intel_hpd_irq_storm_reenable_work(struct
> work_struct *work)
>  	intel_runtime_pm_put(dev_priv);
>  }
>  
> -static bool intel_hpd_irq_event(struct drm_device *dev,
> -				struct drm_connector *connector)
> +bool intel_encoder_hotplug(struct intel_encoder *encoder,
> +			   struct intel_connector *connector)
>  {
> +	struct drm_device *dev = connector->base.dev;
>  	enum drm_connector_status old_status;
>  
>  	WARN_ON(!mutex_is_locked(&dev->mode_config.mutex));
> -	old_status = connector->status;
> +	old_status = connector->base.status;
>  
> -	connector->status = drm_helper_probe_detect(connector, NULL, false);
> +	connector->base.status = drm_helper_probe_detect(&connector->base,
> NULL, false);
>  
> -	if (old_status == connector->status)
> +	if (old_status == connector->base.status)
>  		return false;
>  
>  	DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %s to %s\n",
> -		      connector->base.id,
> -		      connector->name,
> +		      connector->base.base.id,
> +		      connector->base.name,
>  		      drm_get_connector_status_name(old_status),
> -		      drm_get_connector_status_name(connector->status));
> +		      drm_get_connector_status_name(connector->base.status));
>  
>  	return true;
>  }
> @@ -370,10 +371,9 @@ static void i915_hotplug_work_func(struct work_struct
> *work)
>  		if (hpd_event_bits & (1 << intel_encoder->hpd_pin)) {
>  			DRM_DEBUG_KMS("Connector %s (pin %i) received hotplug
> event.\n",
>  				      connector->name, intel_encoder-
> >hpd_pin);
> -			if (intel_encoder->hot_plug)
> -				intel_encoder->hot_plug(intel_encoder);
> -			if (intel_hpd_irq_event(dev, connector))
> -				changed = true;
> +
> +			changed |= intel_encoder->hotplug(intel_encoder,
> +							  intel_connector);
>  		}
>  	}
>  	drm_connector_list_iter_end(&conn_iter);
> diff --git a/drivers/gpu/drm/i915/intel_sdvo.c
> b/drivers/gpu/drm/i915/intel_sdvo.c
> index 2b8764897d68..5b1ad42ec446 100644
> --- a/drivers/gpu/drm/i915/intel_sdvo.c
> +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> @@ -1692,7 +1692,15 @@ static void intel_sdvo_enable_hotplug(struct
> intel_encoder *encoder)
>  	struct intel_sdvo *intel_sdvo = to_sdvo(encoder);
>  
>  	intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG,
> -			&intel_sdvo->hotplug_active, 2);
> +			     &intel_sdvo->hotplug_active, 2);
> +}
> +
> +static bool intel_sdvo_hotplug(struct intel_encoder *encoder,
> +			       struct intel_connector *connector)
> +{
> +	intel_sdvo_enable_hotplug(encoder);
> +
> +	return intel_encoder_hotplug(encoder, connector);
>  }
>  
>  static bool
> @@ -2496,7 +2504,7 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int
> device)
>  		/* Some SDVO devices have one-shot hotplug interrupts.
>  		 * Ensure that they get re-enabled when an interrupt happens.
>  		 */
> -		intel_encoder->hot_plug = intel_sdvo_enable_hotplug;
> +		intel_encoder->hotplug = intel_sdvo_hotplug;
>  		intel_sdvo_enable_hotplug(intel_encoder);
>  	} else {
>  		intel_connector->polled = DRM_CONNECTOR_POLL_CONNECT |
> DRM_CONNECTOR_POLL_DISCONNECT;
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2018-01-30 23:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17 19:21 [PATCH 1/5] drm/i915: Convert intel_hpd_irq_event() into an encoder hotplug hook Ville Syrjala
2018-01-17 19:21 ` [PATCH v2 2/5] drm/i915: Reinitialize sink scrambling/TMDS clock ratio on HPD Ville Syrjala
2018-01-30 22:45   ` Lyude Paul
2018-01-17 19:21 ` [PATCH v2 3/5] drm/i915: Move SST DP link retraining into the ->post_hotplug() hook Ville Syrjala
2018-01-30 23:16   ` Lyude Paul
2018-01-31 13:27     ` Ville Syrjälä
2018-02-28  7:17       ` Manasi Navare
2018-02-28 19:07         ` Lyude Paul
2018-02-28 19:27           ` Manasi Navare
2018-02-28 19:41             ` Lyude Paul
2018-02-28 19:57               ` Manasi Navare
2018-02-28 20:10                 ` Lyude Paul
2018-03-05 23:41                   ` Manasi Navare
2018-01-17 19:21 ` [PATCH 4/5] drm/i915: Nuke intel_dp->channel_eq_status Ville Syrjala
2018-01-19  6:59   ` Rodrigo Vivi
2018-02-28 20:12     ` Manasi Navare
2018-01-30 23:17   ` Lyude Paul
2018-01-17 19:21 ` [PATCH 5/5] drm/i915: Track whether the DP link is trained or not Ville Syrjala
2018-01-30 23:19   ` Lyude Paul
2018-02-28 20:08   ` Manasi Navare
2018-01-18 11:21 ` ✓ Fi.CI.BAT: success for series starting with [1/5] drm/i915: Convert intel_hpd_irq_event() into an encoder hotplug hook Patchwork
2018-01-18 13:04 ` ✓ Fi.CI.IGT: " Patchwork
2018-01-30 23:22 ` Lyude Paul [this message]

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=1517354545.4938.27.camel@redhat.com \
    --to=lyude@redhat.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.