All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ander Conselvan De Oliveira <conselvan2@gmail.com>
To: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/6] drm/i915: Splitting intel_dp_detect
Date: Mon, 16 Nov 2015 15:40:25 +0200	[thread overview]
Message-ID: <1447681225.2624.29.camel@gmail.com> (raw)
In-Reply-To: <1446812886-32156-2-git-send-email-shubhangi.shrivastava@intel.com>

On Fri, 2015-11-06 at 17:58 +0530, Shubhangi Shrivastava wrote:
> This patch moves probing for panel, DPCD read etc to another
> function intel_dp_long_pulse, while intel_dp_detect returns
> the status as connected or disconnected depending on
> whether the edid is available or not.

Why is the change in connector status necessary?

> This change will be required by further patches in the series
> to avoid performing multiple DPCD operations and removing
> their duplication.
> 
> Signed-off-by: Sivakumar Thulasimani <sivakumar.thulasimani@intel.com>
> Signed-off-by: Shubhangi Shrivastava <shubhangi.shrivastava@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 66 ++++++++++++++++++++++++++++++----------
> -
>  1 file changed, 49 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 1cb1f3f..a0fe827 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4785,9 +4785,10 @@ intel_dp_power_put(struct intel_dp *dp,
>  	intel_display_power_put(to_i915(encoder->base.dev), power_domain);
>  }
>  
> -static enum drm_connector_status
> -intel_dp_detect(struct drm_connector *connector, bool force)
> +static void
> +intel_dp_long_pulse(struct intel_connector *intel_connector)
>  {
> +	struct drm_connector *connector = &intel_connector->base;
>  	struct intel_dp *intel_dp = intel_attached_dp(connector);
>  	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_encoder *intel_encoder = &intel_dig_port->base;
> @@ -4797,17 +4798,6 @@ intel_dp_detect(struct drm_connector *connector, bool
> force)
>  	bool ret;
>  	u8 sink_irq_vector;
>  
> -	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
> -		      connector->base.id, connector->name);
> -	intel_dp_unset_edid(intel_dp);
> -
> -	if (intel_dp->is_mst) {
> -		/* MST devices are disconnected from a monitor POV */
> -		if (intel_encoder->type != INTEL_OUTPUT_EDP)
> -			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
> -		return connector_status_disconnected;
> -	}
> -
>  	power_domain = intel_dp_power_get(intel_dp);
>  
>  	/* Can't disconnect eDP, but you can close the lid... */
> @@ -4817,19 +4807,35 @@ intel_dp_detect(struct drm_connector *connector, bool
> force)
>  		status = ironlake_dp_detect(intel_dp);
>  	else
>  		status = g4x_dp_detect(intel_dp);
> -	if (status != connector_status_connected)
> +	if (status != connector_status_connected) {
> +		intel_dp_unset_edid(intel_dp);
>  		goto out;
> +	}
>  
>  	intel_dp_probe_oui(intel_dp);
>  
>  	ret = intel_dp_probe_mst(intel_dp);
>  	if (ret) {
> -		/* if we are in MST mode then this connector
> -		   won't appear connected or have anything with EDID on it */
> +		/*
> +		 * if we are in MST mode then this connector
> +		 * won't appear connected or have anything with
> +		 * EDID on it
> +		 */
>  		if (intel_encoder->type != INTEL_OUTPUT_EDP)
>  			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
>  		status = connector_status_disconnected;
>  		goto out;

Here the function will exit without a call to intel_dp_unset_edid(), which is
different from the behavior prior to this patch.

> +	} else if (connector->status == connector_status_connected) {
> +
> +		/*
> +		 * If display was connected already and is still connected
> +		 * check links status, there has been known issues of
> +		 * link loss triggerring long pulse!!!!
> +		 */
> +		drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
> +		intel_dp_check_link_status(intel_dp);
> +		drm_modeset_unlock(&dev->mode_config.connection_mutex);
> +		goto out;
>  	}

The hunk above should be in a separate patch. It also doesn't call
intel_dp_unset_edid(). Might be easier to just add

out:
	if (status == connector_status_disconnected)
		intel_dp_unset_edid(intel_dp);

to the end of the function.

Ander

>  	intel_dp_set_edid(intel_dp);
> @@ -4854,7 +4860,33 @@ intel_dp_detect(struct drm_connector *connector, bool
> force)
>  
>  out:
>  	intel_dp_power_put(intel_dp, power_domain);
> -	return status;
> +	return;
> +}
> +
> +static enum drm_connector_status
> +intel_dp_detect(struct drm_connector *connector, bool force)
> +{
> +	struct intel_dp *intel_dp = intel_attached_dp(connector);
> +	struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
> +	struct intel_encoder *intel_encoder = &intel_dig_port->base;
> +	struct intel_connector *intel_connector =
> to_intel_connector(connector);
> +
> +	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
> +		      connector->base.id, connector->name);
> +
> +	if (intel_dp->is_mst) {
> +		/* MST devices are disconnected from a monitor POV */
> +		if (intel_encoder->type != INTEL_OUTPUT_EDP)
> +			intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
> +		return connector_status_disconnected;
> +	}
> +
> +	intel_dp_long_pulse(intel_dp->attached_connector);
> +
> +	if (intel_connector->detect_edid)
> +		return connector_status_connected;
> +	else
> +		return connector_status_disconnected;
>  }
>  
>  static void
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-16 13:40 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06 12:28 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
2015-11-06 12:28 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
2015-11-16 13:40   ` Ander Conselvan De Oliveira [this message]
2015-11-17  6:17     ` Shubhangi Shrivastava
2015-11-17  6:26       ` [PATCH] " Shubhangi Shrivastava
2015-11-20 14:18         ` Ander Conselvan De Oliveira
2015-11-17  9:22       ` [PATCH 1/6] " Ander Conselvan De Oliveira
2015-11-17 11:50         ` Shubhangi Shrivastava
2015-11-06 12:28 ` [PATCH 2/6] drm/i915: Cleaning up intel_dp_hpd_pulse Shubhangi Shrivastava
2015-11-16 14:33   ` Ander Conselvan De Oliveira
2015-11-16 14:46     ` Ander Conselvan De Oliveira
2015-11-17  6:53       ` Shubhangi Shrivastava
2015-11-17 12:42         ` Ander Conselvan De Oliveira
2015-11-17  6:44     ` Shubhangi Shrivastava
2015-11-17  6:47       ` [PATCH] " Shubhangi Shrivastava
2015-11-20 14:03         ` Ander Conselvan De Oliveira
2015-11-06 12:28 ` [PATCH 3/6] drm/i915: Splitting intel_dp_check_link_status Shubhangi Shrivastava
2015-11-06 12:28 ` [PATCH 4/6] drm/i915: Save sink_count for tracking changes to it Shubhangi Shrivastava
2015-11-06 12:28 ` [PATCH 5/6] drm/i915: read sink_count dpcd always Shubhangi Shrivastava
2015-11-06 12:28 ` [PATCH 6/6] drm/i915: force full detect on sink count change Shubhangi Shrivastava
  -- strict thread matches above, loose matches on Subject: below --
2016-01-05 12:50 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
2016-01-05 12:50 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
2016-01-13 11:20   ` Ander Conselvan De Oliveira
2016-01-13 13:33     ` Ander Conselvan De Oliveira
2016-01-14 13:50       ` Shubhangi Shrivastava
2016-01-15 10:07         ` Ander Conselvan De Oliveira
2016-01-19  8:51           ` Shubhangi Shrivastava
2015-11-02 12:55 [PATCH 0/6] Fixing sink count related detection over Shubhangi Shrivastava
2015-11-02 12:55 ` [PATCH 1/6] drm/i915: Splitting intel_dp_detect Shubhangi Shrivastava
2015-11-02 13:05   ` kbuild test robot

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=1447681225.2624.29.camel@gmail.com \
    --to=conselvan2@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shubhangi.shrivastava@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.