public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Try harder to complete DP training pattern 1
@ 2012-09-26 15:48 Chris Wilson
  2012-10-03 13:50 ` Lespiau, Damien
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-09-26 15:48 UTC (permalink / raw)
  To: intel-gfx

In commit cdb0e95bf571dccc1f75fef9bdad21b167ef0b37
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>
---
 drivers/gpu/drm/i915/intel_dp.c |   15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index a6ef745..46897f0 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1827,8 +1827,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
 			if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0)
 				break;
 		if (i == intel_dp->lane_count && voltage_tries == 5) {
-			++loop_tries;
-			if (loop_tries == 5) {
+			if (++loop_tries == 5) {
 				DRM_DEBUG_KMS("too many full retries, give up\n");
 				break;
 			}
@@ -1838,15 +1837,11 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
 		}
 
 		/* Check to see if we've tried the same voltage 5 times */
-		if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) {
-			++voltage_tries;
-			if (voltage_tries == 5) {
-				DRM_DEBUG_KMS("too many voltage retries, give up\n");
-				break;
-			}
-		} else
+		if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) != voltage) {
+			voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
 			voltage_tries = 0;
-		voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK;
+		} else
+			++voltage_tries;
 
 		/* Compute new intel_dp->train_set as requested by target */
 		intel_get_adjust_train(intel_dp, link_status);
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Try harder to complete DP training pattern 1
  2012-09-26 15:48 [PATCH] drm/i915: Try harder to complete DP training pattern 1 Chris Wilson
@ 2012-10-03 13:50 ` Lespiau, Damien
  2012-10-03 14:00   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Lespiau, Damien @ 2012-10-03 13:50 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Wed, Sep 26, 2012 at 4:48 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> In commit cdb0e95bf571dccc1f75fef9bdad21b167ef0b37
> 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.

Took me a while to wrap my head around this one, no wonder only
Coverity pointed out. I managed to convince myself the fix is correct
though.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Try harder to complete DP training pattern 1
  2012-10-03 13:50 ` Lespiau, Damien
@ 2012-10-03 14:00   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-10-03 14:00 UTC (permalink / raw)
  To: Lespiau, Damien; +Cc: intel-gfx

On Wed, Oct 03, 2012 at 02:50:19PM +0100, Lespiau, Damien wrote:
> On Wed, Sep 26, 2012 at 4:48 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > In commit cdb0e95bf571dccc1f75fef9bdad21b167ef0b37
> > 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.
> 
> Took me a while to wrap my head around this one, no wonder only
> Coverity pointed out. I managed to convince myself the fix is correct
> though.
> 
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

Picked up for -fixes, thanks for the patch.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-03 13:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-26 15:48 [PATCH] drm/i915: Try harder to complete DP training pattern 1 Chris Wilson
2012-10-03 13:50 ` Lespiau, Damien
2012-10-03 14:00   ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox