diff mbox series

[v2,4/4] drm/i915/dp: Check eDP fallback link BW against downclock mode

Message ID 20180912225719.17574-4-manasi.d.navare@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2,1/4] drm/i915/dp: Link train Fallback on eDP only if fallback link BW can fit panel's native mode | expand

Commit Message

Navare, Manasi Sept. 12, 2018, 10:57 p.m. UTC
If link training fails on eDP then we fallback to lower link rate
and lane count. If the fallback link BW cannot fit the panel's native
mode and if the downclock mode exists then we should check if the fallback
BW can fit this downclock mode.

Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Manasi Navare <manasi.d.navare@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 0e400629e85c..bfc56e778d0f 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -562,12 +562,21 @@  static bool intel_dp_can_link_train_fallback_for_edp(struct intel_dp *intel_dp,
 						     uint8_t lane_count)
 {
 	struct drm_display_mode *fixed_mode = intel_dp->attached_connector->panel.fixed_mode;
+	struct drm_display_mode *downclock_mode =
+		intel_dp->attached_connector->panel.downclock_mode;
 	int mode_rate, max_rate;
 
 	mode_rate = intel_dp_link_required(fixed_mode->clock, 18);
 	max_rate = intel_dp_max_data_rate(link_rate, lane_count);
-	if (mode_rate > max_rate)
+	if (mode_rate > max_rate) {
+		if (downclock_mode) {
+			mode_rate = intel_dp_link_required(downclock_mode->clock,
+							   18);
+			if (mode_rate > max_rate)
+				return false;
+		}
 		return false;
+	}
 
 	return true;
 }