summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>2016-09-07 21:28:00 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2016-09-10 00:53:18 +0300
commit7bfaddf057f3ae774fa355cb7d87324ca67add94 (patch)
tree7e8d8d834bb557152ab3e1e4ed99fbefe5460cd0 /drivers/gpu/drm/i915
parentf169660ed4e57a03e6f6ed07fe192dbcb7687a0d (diff)
downloadlinux-7bfaddf057f3ae774fa355cb7d87324ca67add94.tar.xz
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: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: Manasi Navare <manasi.d.navare@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_dp_link_training.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp_link_training.c b/drivers/gpu/drm/i915/intel_dp_link_training.c
index 0deebed71a26..b9880cf0ae6c 100644
--- a/drivers/gpu/drm/i915/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/intel_dp_link_training.c
@@ -112,6 +112,18 @@ intel_dp_update_link_train(struct intel_dp *intel_dp)
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 */
static void
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 */
- for (i = 0; i < intel_dp->lane_count; i++)
- if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
- break;
- if (i == intel_dp->lane_count) {
+ if (intel_dp_link_max_vswing_reached(intel_dp)) {
++loop_tries;
if (loop_tries == 5) {
DRM_ERROR("too many full retries, give up\n");