drm/nouveau/disp/dp: don't touch link config after success
authorBen Skeggs <bskeggs@redhat.com>
Mon, 16 Jun 2014 05:45:01 +0000 (15:45 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 17 Jun 2014 04:41:41 +0000 (14:41 +1000)
I don't know of anything this fixes, but it seems wrong anyway.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/engine/disp/dport.c

index 39562d4..5a5b59b 100644 (file)
@@ -241,7 +241,9 @@ dp_link_train_eq(struct dp_state *dp)
                dp_set_training_pattern(dp, 2);
 
        do {
-               if (dp_link_train_update(dp, dp->pc2, 400))
+               if ((tries &&
+                   dp_link_train_commit(dp, dp->pc2)) ||
+                   dp_link_train_update(dp, dp->pc2, 400))
                        break;
 
                eq_done = !!(dp->stat[2] & DPCD_LS04_INTERLANE_ALIGN_DONE);
@@ -253,9 +255,6 @@ dp_link_train_eq(struct dp_state *dp)
                            !(lane & DPCD_LS02_LANE0_SYMBOL_LOCKED))
                                eq_done = false;
                }
-
-               if (dp_link_train_commit(dp, dp->pc2))
-                       break;
        } while (!eq_done && cr_done && ++tries <= 5);
 
        return eq_done ? 0 : -1;