public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: moved edid read from _force() to _get_modes()
Date: Thu, 22 Dec 2016 14:27:22 +0200	[thread overview]
Message-ID: <20161222122722.GK31595@intel.com> (raw)
In-Reply-To: <1482360550-7909-1-git-send-email-anitha.chrisanthus@intel.com>

On Wed, Dec 21, 2016 at 02:49:10PM -0800, Anitha Chrisanthus wrote:
> From: "Chrisanthus, Anitha" <anitha.chrisanthus@intel.com>
> 
> When the connector is forced ON and firmware EDID is provided,
> driver still tries to read the EDID from the sink device, this can increase
> the driver's start up time by ~25ms per attempt.
> This change is to fix this problem.
> By moving the point where we attempt to read EDID from the hdmi and dp
> _force functions to the corresponding _get_modes() functions we only
> attempt to read EDID if EDID firmware is not provided or if there is no
> valid EDID.
> This change should have no effect on the general case where the EDID is
> normally read during the hdmi or dp _detect() call.

Someone should just move the EDID override stuff to happen at a 
lower level so that _all_ EDID parsing will see the override EDID.

> 
> Signed-off-by: Chrisanthus, Anitha <anitha.chrisanthus@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c   | 31 +++++++++++++++++++++----------
>  drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++------
>  2 files changed, 29 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 66b5bc8..0fcecc9 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -4563,23 +4563,13 @@ intel_dp_force(struct drm_connector *connector)
>  {
>  	struct intel_dp *intel_dp = intel_attached_dp(connector);
>  	struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
> -	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
> -	enum intel_display_power_domain power_domain;
>  
>  	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
>  		      connector->base.id, connector->name);
> -	intel_dp_unset_edid(intel_dp);
>  
>  	if (connector->status != connector_status_connected)
>  		return;
>  
> -	power_domain = intel_display_port_aux_power_domain(intel_encoder);
> -	intel_display_power_get(dev_priv, power_domain);
> -
> -	intel_dp_set_edid(intel_dp);
> -
> -	intel_display_power_put(dev_priv, power_domain);
> -
>  	if (intel_encoder->type != INTEL_OUTPUT_EDP)
>  		intel_encoder->type = INTEL_OUTPUT_DP;
>  }
> @@ -4588,8 +4578,29 @@ static int intel_dp_get_modes(struct drm_connector *connector)
>  {
>  	struct intel_connector *intel_connector = to_intel_connector(connector);
>  	struct edid *edid;
> +	struct intel_dp *intel_dp = intel_attached_dp(connector);
> +	struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base;
> +	struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev);
> +	enum intel_display_power_domain power_domain;
>  
>  	edid = intel_connector->detect_edid;
> +	if ((edid == NULL) &&
> +	    (connector->status == connector_status_connected)) {
> +
> +		intel_dp_unset_edid(intel_dp);
> +
> +		power_domain =
> +			intel_display_port_aux_power_domain(intel_encoder);
> +		intel_display_power_get(dev_priv, power_domain);
> +
> +		intel_dp_detect_dpcd(intel_dp);
> +
> +		intel_dp_set_edid(intel_dp);
> +
> +		intel_display_power_put(dev_priv, power_domain);
> +
> +		edid = intel_connector->detect_edid;
> +	}
>  	if (edid) {
>  		int ret = intel_connector_update_modes(connector, edid);
>  		if (ret)
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 0bcfead..e2f8bde 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1520,12 +1520,9 @@ intel_hdmi_force(struct drm_connector *connector)
>  	DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
>  		      connector->base.id, connector->name);
>  
> -	intel_hdmi_unset_edid(connector);
> -
>  	if (connector->status != connector_status_connected)
>  		return;
>  
> -	intel_hdmi_set_edid(connector);
>  	hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI;
>  }
>  
> @@ -1534,9 +1531,14 @@ static int intel_hdmi_get_modes(struct drm_connector *connector)
>  	struct edid *edid;
>  
>  	edid = to_intel_connector(connector)->detect_edid;
> -	if (edid == NULL)
> -		return 0;
> -
> +	if ((edid == NULL) &&
> +	    (connector->status == connector_status_connected)) {
> +		intel_hdmi_unset_edid(connector);
> +		intel_hdmi_set_edid(connector);
> +		edid = to_intel_connector(connector)->detect_edid;
> +		if (edid == NULL)
> +			return 0;
> +	}
>  	return intel_connector_update_modes(connector, edid);
>  }
>  
> -- 
> 2.5.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

      parent reply	other threads:[~2016-12-22 12:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 22:49 [PATCH] drm/i915: moved edid read from _force() to _get_modes() Anitha Chrisanthus
2016-12-21 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
2016-12-22 12:27 ` Ville Syrjälä [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=20161222122722.GK31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=anitha.chrisanthus@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox