Skip to content

Commit

Permalink
drm/nouveau/dp: fix bad comparison in dp_link_train_commit()
Browse files Browse the repository at this point in the history
The comparison (lpre == DP_TRAIN_PRE_EMPHASIS_9_5) is always false:
lpre is initialized as (lane & 0x0c) >> 2, which is at most 3, while
DP_TRAIN_PRE_EMPHASIS_9_5 is defined as (3 << 3).

Signed-off-by: Xi Wang <[email protected]>
Signed-off-by: Ben Skeggs <[email protected]>
  • Loading branch information
xiw authored and Ben Skeggs committed Mar 13, 2012
1 parent 84ddfda commit 44ab8cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ dp_link_train_commit(struct drm_device *dev, struct dp_state *dp)
dp->conf[i] = (lpre << 3) | lvsw;
if (lvsw == DP_TRAIN_VOLTAGE_SWING_1200)
dp->conf[i] |= DP_TRAIN_MAX_SWING_REACHED;
if (lpre == DP_TRAIN_PRE_EMPHASIS_9_5)
if ((lpre << 3) == DP_TRAIN_PRE_EMPHASIS_9_5)
dp->conf[i] |= DP_TRAIN_MAX_PRE_EMPHASIS_REACHED;

NV_DEBUG_KMS(dev, "config lane %d %02x\n", i, dp->conf[i]);
Expand Down

0 comments on commit 44ab8cc

Please sign in to comment.