All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Shashank Sharma <shashank.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org, joseph.salisbury@canonical.com,
	daniel.vetter@intel.com
Subject: Re: [PATCH v2] drm/i915: Restrict usage of live status check
Date: Wed, 20 Apr 2016 17:48:59 +0300	[thread overview]
Message-ID: <20160420144859.GD4329@intel.com> (raw)
In-Reply-To: <1461154371-1292-1-git-send-email-shashank.sharma@intel.com>

On Wed, Apr 20, 2016 at 05:42:51PM +0530, Shashank Sharma wrote:
> This patch restricts usage of live status check for HDMI detection.
> While testing certain (monitor + cable) combinations with various
> intel  platforms, it seems that live status register is not reliable
> on some older devices. So limit the live_status check from VLV onwards.
> 
> This fixes regression added by patch:
> 	'commit 237ed86c693d ("drm/i915: Check live status before reading edid")'
> 
> ===
> V2
> ===
> Ville:
> - Add live_status =  true in the end of delay loop.
> 
> Jani:
> - Initialize bool live_status with false;
> - Change regression reference in the commit message.
> - Use dev_priv instead of dev
> - Move declaration of try at the loop
> 
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 31 ++++++++++++++++++++++++-------
>  1 file changed, 24 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index b199ede..98f5ae0 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1398,22 +1398,39 @@ intel_hdmi_detect(struct drm_connector *connector, bool force)
>  	struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector);
>  	struct drm_i915_private *dev_priv = to_i915(connector->dev);
>  	bool live_status = false;
> -	unsigned int try;
>  
>  	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
>  		      connector->base.id, connector->name);
>  
>  	intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS);
>  
> -	for (try = 0; !live_status && try < 9; try++) {
> -		if (try)
> -			msleep(10);
> -		live_status = intel_digital_port_connected(dev_priv,
> +	/*
> +	* Live status check for HDMI detection is not very
> +	* reliable on older platforms. So insist the live
> +	* status check for EDID read from VLV onwards.
> +	*/
> +	if (INTEL_INFO(dev_priv)->gen >= 7 && !IS_IVYBRIDGE(dev_priv)) {
> +		unsigned int try;
> +
> +		for (try = 0; !live_status && try < 9; try++) {
> +			if (try)
> +				msleep(10);
> +			live_status = intel_digital_port_connected(dev_priv,
>  				hdmi_to_dig_port(intel_hdmi));
> +		}
>  	}
>  
> -	if (!live_status)
> -		DRM_DEBUG_KMS("Live status not up!");
> +	if (!live_status) {
> +		/*
> +		* TODO: Replace this with some magic code.
> +		* Even after giving enough delay, live status is not up.
> +		* Lets read EDID and decide if HDMI is available. We
> +		* have to do this not to break old platforms, but ideally
> +		* should read EDID only when live_status reg allows us.
> +		*/
> +		DRM_DEBUG_KMS("Live status down, making it up\n");
> +		live_status = true;
> +	}

Hmm. This is still not what I suggested earlier. Was there some problem
with my idea?

>  
>  	intel_hdmi_unset_edid(connector);
>  
> -- 
> 1.9.1

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-04-20 14:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-17  7:59 [PATCH] drm/i915: Restrict usage of live status check Shashank Sharma
2016-03-17  9:25 ` Jani Nikula
2016-03-17 10:19   ` Sharma, Shashank
2016-04-20 12:12   ` [PATCH v2] " Shashank Sharma
2016-04-20 14:48     ` Ville Syrjälä [this message]
2016-04-21  3:55       ` Sharma, Shashank
2016-04-21  4:45         ` Sharma, Shashank
2016-03-17 13:04 ` [PATCH] " Ville Syrjälä
2016-03-17 15:45   ` Sharma, Shashank
2016-03-17 15:57     ` Chris Wilson
2016-03-17 16:01     ` Ville Syrjälä
2016-03-17 16:05       ` Sharma, Shashank
2016-03-17 16:21         ` Ville Syrjälä
2016-03-17 16:33           ` Sharma, Shashank
2016-03-17 16:47             ` Ville Syrjälä
2016-03-18  3:21               ` Sharma, Shashank
2016-03-18 12:28                 ` Ville Syrjälä
2016-03-17 17:59             ` Jani Nikula
2016-03-18  3:23               ` Sharma, Shashank
2016-03-17 14:02 ` ✗ Fi.CI.BAT: failure for drm/i915: Restrict usage of live status check (rev3) Patchwork
2016-04-20 17:24 ` ✓ Fi.CI.BAT: success for drm/i915: Restrict usage of live status check (rev4) Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2016-03-10 13:16 [PATCH v2] drm/i915: Restrict usage of live status check Shashank Sharma
2016-03-11  8:48 ` Jani Nikula

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=20160420144859.GD4329@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joseph.salisbury@canonical.com \
    --cc=shashank.sharma@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.