提交 7bfaddf0 编写于 作者: D Dhinakaran Pandiyan 提交者: Rodrigo Vivi

drm/i915/dp: Move max. vswing check to it's own function

Wrap the max. vswing check in a separate function.
This makes the clock recovery phase of DP link training cleaner

v3:
Fixed the paranthesis warning (Mika Kahola)
v2:
Fixed the Compiler warning (Mika Kahola)
Signed-off-by: NDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Signed-off-by: NManasi Navare <manasi.d.navare@intel.com>
Reviewed-by: NMika Kahola <mika.kahola@intel.com>
Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
上级 f169660e
...@@ -112,6 +112,18 @@ intel_dp_update_link_train(struct intel_dp *intel_dp) ...@@ -112,6 +112,18 @@ intel_dp_update_link_train(struct intel_dp *intel_dp)
return ret == intel_dp->lane_count; return ret == intel_dp->lane_count;
} }
static bool intel_dp_link_max_vswing_reached(struct intel_dp *intel_dp)
{
int lane;
for (lane = 0; lane < intel_dp->lane_count; lane++)
if ((intel_dp->train_set[lane] &
DP_TRAIN_MAX_SWING_REACHED) == 0)
return false;
return true;
}
/* Enable corresponding port and start training pattern 1 */ /* Enable corresponding port and start training pattern 1 */
static void static void
intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp) intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
...@@ -170,10 +182,7 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp) ...@@ -170,10 +182,7 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp)
} }
/* Check to see if we've tried the max voltage */ /* Check to see if we've tried the max voltage */
for (i = 0; i < intel_dp->lane_count; i++) if (intel_dp_link_max_vswing_reached(intel_dp)) {
if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
break;
if (i == intel_dp->lane_count) {
++loop_tries; ++loop_tries;
if (loop_tries == 5) { if (loop_tries == 5) {
DRM_ERROR("too many full retries, give up\n"); DRM_ERROR("too many full retries, give up\n");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册