[PATCH] drm/i915/display/dp: Add fallback on LT failure for DP2.0

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

 



For DP2.0 as per the Spec on LT failure we need to reduce the lane count
if the lane count is not equal to 1. If lane count is 1 then need to
retry with reducing the link rate.

Signed-off-by: Arun R Murthy <arun.r.murthy@xxxxxxxxx>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 54ddc953e5bc..2b12ca45596d 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -657,8 +657,20 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
 				    "Retrying Link training for eDP with same parameters\n");
 			return 0;
 		}
-		intel_dp->max_link_rate = intel_dp_common_rate(intel_dp, index - 1);
-		intel_dp->max_link_lane_count = lane_count;
+		if (intel_dp->dpcd[DP_MAIN_LINK_CHANNEL_CODING] & DP_CAP_ANSI_128B132B) {
+			if (lane_count > 1) {
+				/* Reduce the lane count */
+				intel_dp->max_link_lane_count = lane_count >> 1;
+				intel_dp->max_link_rate = intel_dp_common_rate(intel_dp, index);
+			} else {
+				/* Reduce the link rate */
+				intel_dp->max_link_rate = intel_dp_common_rate(intel_dp, index - 1);
+				intel_dp->max_link_lane_count = intel_dp_max_common_lane_count(intel_dp);
+			}
+		} else {
+			intel_dp->max_link_rate = intel_dp_common_rate(intel_dp, index - 1);
+			intel_dp->max_link_lane_count = lane_count;
+		}
 	} else if (lane_count > 1) {
 		if (intel_dp_is_edp(intel_dp) &&
 		    !intel_dp_can_link_train_fallback_for_edp(intel_dp,
@@ -675,6 +687,10 @@ int intel_dp_get_link_train_fallback_values(struct intel_dp *intel_dp,
 		return -1;
 	}
 
+	drm_dbg_kms(&i915->drm,
+		    "Retrying Link training with link rate %d and lane count %d\n",
+		    intel_dp->max_link_rate, intel_dp->max_link_lane_count);
+
 	return 0;
 }
 
-- 
2.25.1




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux