All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: moved edid read from _force() to _get_modes()
@ 2016-12-21 22:49 Anitha Chrisanthus
  2016-12-21 23:16 ` ✓ Fi.CI.BAT: success for " Patchwork
  2016-12-22 12:27 ` [PATCH] " Ville Syrjälä
  0 siblings, 2 replies; 3+ messages in thread
From: Anitha Chrisanthus @ 2016-12-21 22:49 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chrisanthus, Anitha

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.

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: moved edid read from _force() to _get_modes()
  2016-12-21 22:49 [PATCH] drm/i915: moved edid read from _force() to _get_modes() Anitha Chrisanthus
@ 2016-12-21 23:16 ` Patchwork
  2016-12-22 12:27 ` [PATCH] " Ville Syrjälä
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2016-12-21 23:16 UTC (permalink / raw)
  To: Anitha Chrisanthus; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: moved edid read from _force() to _get_modes()
URL   : https://patchwork.freedesktop.org/series/17112/
State : success

== Summary ==

Series 17112v1 drm/i915: moved edid read from _force() to _get_modes()
https://patchwork.freedesktop.org/api/1.0/series/17112/revisions/1/mbox/

Test kms_force_connector_basic:
        Subgroup force-connector-state:
                dmesg-warn -> PASS       (fi-ivb-3770)

fi-bdw-5557u     total:247  pass:233  dwarn:0   dfail:0   fail:0   skip:14 
fi-bsw-n3050     total:247  pass:208  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:247  pass:225  dwarn:1   dfail:0   fail:0   skip:21 
fi-bxt-t5700     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-j1900     total:247  pass:220  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-hsw-4770r     total:247  pass:228  dwarn:0   dfail:0   fail:0   skip:19 
fi-ilk-650       total:247  pass:195  dwarn:0   dfail:0   fail:0   skip:52 
fi-ivb-3520m     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-ivb-3770      total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-kbl-7500u     total:247  pass:226  dwarn:0   dfail:0   fail:0   skip:21 
fi-skl-6260u     total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-skl-6700hq    total:247  pass:227  dwarn:0   dfail:0   fail:0   skip:20 
fi-skl-6700k     total:247  pass:224  dwarn:3   dfail:0   fail:0   skip:20 
fi-skl-6770hq    total:247  pass:234  dwarn:0   dfail:0   fail:0   skip:13 
fi-snb-2520m     total:247  pass:216  dwarn:0   dfail:0   fail:0   skip:31 
fi-snb-2600      total:247  pass:215  dwarn:0   dfail:0   fail:0   skip:32 

f45701ec502e5ee9682561be7578bd39741ad4bb drm-tip: 2016y-12m-21d-11h-52m-22s UTC integration manifest
591821d drm/i915: moved edid read from _force() to _get_modes()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3363/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: moved edid read from _force() to _get_modes()
  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ä
  1 sibling, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2016-12-22 12:27 UTC (permalink / raw)
  To: Anitha Chrisanthus; +Cc: intel-gfx

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-22 12:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH] " Ville Syrjälä

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.