Skip to content

Commit 2477367

Browse files
ickledanvet
authored andcommitted
drm/i915: Try harder to complete DP training pattern 1
In commit cdb0e95 Author: Keith Packard <keithp@keithp.com> Date: Tue Nov 1 20:00:06 2011 -0700 drm/i915: Try harder during dp pattern 1 link training extra passes were made to retry the same voltage and then retry a full clock reset. However, as coverity pointed out, we never tried the full clock reset as we broke out of the loop early. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 7f66134 commit 2477367

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

drivers/gpu/drm/i915/intel_dp.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,8 +1798,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
17981798
if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
17991799
break;
18001800
if (i == intel_dp->lane_count && voltage_tries == 5) {
1801-
++loop_tries;
1802-
if (loop_tries == 5) {
1801+
if (++loop_tries == 5) {
18031802
DRM_DEBUG_KMS("too many full retries, give up\n");
18041803
break;
18051804
}
@@ -1809,15 +1808,11 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
18091808
}
18101809

18111810
/* Check to see if we've tried the same voltage 5 times */
1812-
if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
1813-
++voltage_tries;
1814-
if (voltage_tries == 5) {
1815-
DRM_DEBUG_KMS("too many voltage retries, give up\n");
1816-
break;
1817-
}
1818-
} else
1811+
if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) != voltage) {
1812+
voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
18191813
voltage_tries = 0;
1820-
voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
1814+
} else
1815+
++voltage_tries;
18211816

18221817
/* Compute new intel_dp->train_set as requested by target */
18231818
intel_get_adjust_train(intel_dp, link_status);

0 commit comments

Comments
 (0)