[PATCH] drm/i915: moved edid read from _force() to _get_modes()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Chrisanthus, Anitha" <anitha.chrisanthus@xxxxxxxxx>

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@xxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux