drm/i915/edp: Do not do link training fallback or prune modes on EDP

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/a306343bcd7df89d9d45a601929e26866e7b7a81
Commit:     a306343bcd7df89d9d45a601929e26866e7b7a81
Parent:     9965db26ac0548648309f506dc155a92daa2158f
Refname:    refs/heads/master
Author:     Manasi Navare <[email protected]>
AuthorDate: Thu Oct 12 12:13:38 2017 -0700
Committer:  Rodrigo Vivi <[email protected]>
CommitDate: Thu Feb 1 07:32:54 2018 -0800

    drm/i915/edp: Do not do link training fallback or prune modes on EDP
    
    In case of eDP because the panel has a fixed mode, the link rate
    and lane count at which it is trained corresponds to the link BW
    required to support the native resolution of the panel. In case of
    panles with lower resolutions where fewer lanes are hooked up internally,
    that number is reflected in the MAX_LANE_COUNT DPCD register of the panel.
    So it is pointless to fallback to lower link rate/lane count in case
    of link training failure on eDP connector since the lower link BW
    will not support the native resolution of the panel and we cannot
    prune the preferred mode on the eDP connector.
    
    In case of Link training failure on the eDP panel, something is wrong
    in the HW internally and hence driver errors out with a loud
    and clear DRM_ERROR message.
    
    v2:
    * Fix the DEBUG_ERROR and add {} in else (Ville Syrjala)
    
    Cc: Clinton Taylor <[email protected]>
    Cc: Jim Bride <[email protected]>
    Cc: Jani Nikula <[email protected]>
    Cc: Ville Syrjala <[email protected]>
    Cc: Dave Airlie <[email protected]>
    Cc: Daniel Vetter <[email protected]>
    Signed-off-by: Manasi Navare <[email protected]>
    Reviewed-by: Ville Syrjala <[email protected]>
    Reference: https://bugs.freedesktop.org/show_bug.cgi?id=103369
    Signed-off-by: Imre Deak <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    (cherry picked from commit c0cfb10d9e1de490e36d3b9d4228c0ea0ca30677)
    Signed-off-by: Rodrigo Vivi <[email protected]>
---
 drivers/gpu/drm/i915/intel_dp_link_training.c | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
index 05907fa8a553..cf8fef8b6f58 100644
--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
@@ -328,14 +328,22 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
 	return;
 
  failure_handling:
-	DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d",
-		      intel_connector->base.base.id,
-		      intel_connector->base.name,
-		      intel_dp->link_rate, intel_dp->lane_count);
-	if (!intel_dp_get_link_train_fallback_values(intel_dp,
-						     intel_dp->link_rate,
-						     intel_dp->lane_count))
-		/* Schedule a Hotplug Uevent to userspace to start modeset */
-		schedule_work(&intel_connector->modeset_retry_work);
+	/* Dont fallback and prune modes if its eDP */
+	if (!intel_dp_is_edp(intel_dp)) {
+		DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d",
+			      intel_connector->base.base.id,
+			      intel_connector->base.name,
+			      intel_dp->link_rate, intel_dp->lane_count);
+		if (!intel_dp_get_link_train_fallback_values(intel_dp,
+							     intel_dp->link_rate,
+							     intel_dp->lane_count))
+			/* Schedule a Hotplug Uevent to userspace to start modeset */
+			schedule_work(&intel_connector->modeset_retry_work);
+	} else {
+		DRM_ERROR("[CONNECTOR:%d:%s] Link Training failed at link rate = %d, lane count = %d",
+			  intel_connector->base.base.id,
+			  intel_connector->base.name,
+			  intel_dp->link_rate, intel_dp->lane_count);
+	}
 	return;
 }
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.