All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: Ander Conselvan de Oliveira
	<ander.conselvan.de.oliveira@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails
Date: Fri, 29 Jul 2016 11:29:56 +0200	[thread overview]
Message-ID: <20160729092956.GA6232@phenom.ffwll.local> (raw)
In-Reply-To: <1469717448-4297-7-git-send-email-ville.syrjala@linux.intel.com>

On Thu, Jul 28, 2016 at 05:50:42PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> With HSW + Dell UP2414Q (at least) drm_probe_ddc() occasionally fails,
> and then we'll assume that the entire display has been disconnected.
> We don't need the EDID from the main link, so we can simply check if
> the sink is MST capable, and if so treat is as connected.
> 
> Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> Cc: Jim Bride <jim.bride@linux.intel.com>
> Cc: Manasi D Navare <manasi.d.navare@intel.com>
> Cc: Durgadoss R <durgadoss.r@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 45 +++++++++++++++++++++++++++--------------
>  1 file changed, 30 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3a9c5d3b5c66..4a4184c21989 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3538,7 +3538,7 @@ intel_dp_probe_oui(struct intel_dp *intel_dp)
>  }
>  
>  static bool
> -intel_dp_probe_mst(struct intel_dp *intel_dp)
> +intel_dp_can_mst(struct intel_dp *intel_dp)
>  {
>  	u8 buf[1];
>  
> @@ -3551,18 +3551,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
>  	if (intel_dp->dpcd[DP_DPCD_REV] < 0x12)
>  		return false;
>  
> -	if (drm_dp_dpcd_read(&intel_dp->aux, DP_MSTM_CAP, buf, 1)) {
> -		if (buf[0] & DP_MST_CAP) {
> -			DRM_DEBUG_KMS("Sink is MST capable\n");
> -			intel_dp->is_mst = true;
> -		} else {
> -			DRM_DEBUG_KMS("Sink is not MST capable\n");
> -			intel_dp->is_mst = false;
> -		}
> -	}
> +	if (drm_dp_dpcd_read(&intel_dp->aux, DP_MSTM_CAP, buf, 1) != 1)
> +		return false;
>  
> -	drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr, intel_dp->is_mst);
> -	return intel_dp->is_mst;
> +	return buf[0] & DP_MST_CAP;
> +}
> +
> +static void
> +intel_dp_configure_mst(struct intel_dp *intel_dp)
> +{
> +	if (!i915.enable_dp_mst)
> +		return;
> +
> +	if (!intel_dp->can_mst)
> +		return;
> +
> +	intel_dp->is_mst = intel_dp_can_mst(intel_dp);

can_mst (is the hw capable) vs. can_mst (is the sink capable). Needs a
can_sink_mst or something else.

Also this really should be part of the mst helpers imo ...

> +
> +	if (intel_dp->is_mst)
> +		DRM_DEBUG_KMS("Sink is MST capable\n");
> +	else
> +		DRM_DEBUG_KMS("Sink is not MST capable\n");
> +
> +	drm_dp_mst_topology_mgr_set_mst(&intel_dp->mst_mgr,
> +					intel_dp->is_mst);
>  }
>  
>  static int intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
> @@ -3993,6 +4005,9 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
>  	if (drm_probe_ddc(&intel_dp->aux.ddc))
>  		return connector_status_connected;
>  
> +	if (intel_dp_can_mst(intel_dp))
> +		return connector_status_connected;

Shouldn't we instead just outright not poke the ddc when there's an mst
branch connected? The dp mst helpers will read the ddc for the final leaf
ports, anything intermediate is kinda bonghits anyway. So

  	if (!intel_dp_can_mst() && drm_probe_ddc(&intel_dp->aux.ddc))
  		return connector_status_connected;

I think with that it makes a lot more sense and is

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

And again, this so should be all shared in dp helpers somehow.
-Daniel

> +
>  	/* Well we tried, say unknown for unreliable port types */
>  	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) {
>  		type = intel_dp->downstream_ports[0] & DP_DS_PORT_TYPE_MASK;
> @@ -4213,7 +4228,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)
>  	struct drm_device *dev = connector->dev;
>  	enum drm_connector_status status;
>  	enum intel_display_power_domain power_domain;
> -	bool ret;
>  	u8 sink_irq_vector;
>  
>  	power_domain = intel_display_port_aux_power_domain(intel_encoder);
> @@ -4249,8 +4263,9 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)
>  
>  	intel_dp_probe_oui(intel_dp);
>  
> -	ret = intel_dp_probe_mst(intel_dp);
> -	if (ret) {
> +	intel_dp_configure_mst(intel_dp);
> +
> +	if (intel_dp->is_mst) {
>  		/*
>  		 * If we are in MST mode then this connector
>  		 * won't appear connected or have anything
> -- 
> 2.7.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-07-29  9:30 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28 14:50 [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc ville.syrjala
2016-07-28 14:50 ` [PATCH 01/12] drm/i915: Ignore initial lid state for eDP ville.syrjala
2016-07-28 15:47   ` Chris Wilson
2016-07-28 16:01     ` Ville Syrjälä
2016-07-28 16:36       ` Chris Wilson
2016-07-28 16:48         ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 02/12] drm/i915: Read PSR caps/intermediate freqs/etc. only once on eDP ville.syrjala
2016-07-28 17:30   ` Chris Wilson
2016-07-28 17:45     ` Ville Syrjälä
2016-07-29 13:52   ` [PATCH v3 " ville.syrjala
2016-07-28 14:50 ` [PATCH 03/12] drm/i915: Avoid mixing up SST and MST in DDI setup ville.syrjala
2016-07-29  9:16   ` Daniel Vetter
2016-07-29  9:55     ` Ville Syrjälä
2016-08-02 14:20       ` Daniel Vetter
2016-08-01  9:24   ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 04/12] drm/i915: Reject mixing MST and SST/HDMI on the same digital port ville.syrjala
2016-07-29  9:19   ` Daniel Vetter
2016-07-29 11:28     ` Ville Syrjälä
2016-08-02 14:22       ` Daniel Vetter
2016-08-01  9:28   ` Maarten Lankhorst
2016-07-28 14:50 ` [PATCH 05/12] drm/i915: Track active streams also for DP SST ville.syrjala
2016-07-29  9:22   ` Daniel Vetter
2016-07-29 11:36     ` Ville Syrjälä
2016-07-29 18:36       ` Jim Bride
2016-08-02 14:28         ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 06/12] drm/i915: Allow MST sinks to work even if drm_probe_ddc() fails ville.syrjala
2016-07-29  9:29   ` Daniel Vetter [this message]
2016-07-29 11:41     ` Ville Syrjälä
2016-07-29 13:51   ` [PATCH v2 " ville.syrjala
2016-07-28 14:50 ` [PATCH 07/12] drm/i915: Move DP link retraining into intel_dp_detect() ville.syrjala
2016-07-28 19:48   ` Manasi Navare
2016-07-28 20:15     ` Ville Syrjälä
2016-07-29  0:36       ` Manasi Navare
2016-07-29  9:52         ` Ville Syrjälä
2016-07-29 21:42           ` Manasi Navare
2016-07-29 21:45         ` Manasi Navare
2016-08-01 10:03           ` Ville Syrjälä
2016-07-29 20:37   ` Jim Bride
2016-07-28 14:50 ` [PATCH 08/12] drm/i915: Skip dpcd/edid read unless there was a long hpd ville.syrjala
2016-07-28 15:38   ` Chris Wilson
2016-07-28 15:44     ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 09/12] drm/i915: Remove useless rate_to_index() usage ville.syrjala
2016-07-29  9:33   ` Daniel Vetter
2016-07-28 14:50 ` [PATCH 10/12] drm/i915: Allow rate_to_index() to return non-exact matches ville.syrjala
2016-07-29  9:35   ` Daniel Vetter
2016-07-29 11:43     ` Ville Syrjälä
2016-07-28 14:50 ` [PATCH 11/12] drm/i915: Don't try to ack sink irqs when there are none ville.syrjala
2016-07-29  9:38   ` Daniel Vetter
2016-07-28 14:50 ` [RFC][PATCH 12/12] drm/i915: Add encoder .sync_state() hook ville.syrjala
2016-07-29  9:42   ` Daniel Vetter
2016-07-28 15:39 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc Patchwork
2016-07-29 14:27 ` ✗ Ro.CI.BAT: failure for drm/i915: Move DP link retraining to hotplug work etc. (rev3) Patchwork
2016-08-04 12:35   ` Ville Syrjälä
2016-08-04 13:08 ` [PATCH 00/12] drm/i915: Move DP link retraining to hotplug work etc Ville Syrjälä

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=20160729092956.GA6232@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ander.conselvan.de.oliveira@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.