Skip to content

Commit 2be30d3

Browse files
IcenowyThomas Zimmermann
authored andcommitted
drm/bridge: analogix-anx6345: fix set of link bandwidth
Current code tries to store the link rate (in bps, which is a big number) in a u8, which surely overflow. Then it's converted back to bandwidth code (which is thus 0) and written to the chip. The code sometimes works because the chip will automatically fallback to the lowest possible DP link rate (1.62Gbps) when get the invalid value. However, on the eDP panel of Olimex TERES-I, which wants 2.7Gbps link, it failed. As we had already read the link bandwidth as bandwidth code in earlier code (to check whether it is supported), use it when setting bandwidth, instead of converting it to link rate and then converting back. Fixes: e1cff82 ("drm/bridge: fix anx6345 compilation for v5.5") Signed-off-by: Icenowy Zheng <[email protected]> Reviewed-by: Torsten Duwe <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Torsten Duwe <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Linus Walleij <[email protected]> Cc: Thomas Zimmermann <[email protected]> Cc: Icenowy Zheng <[email protected]> Cc: Stephen Rothwell <[email protected]> Signed-off-by: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8c8c062 commit 2be30d3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/bridge/analogix/analogix-anx6345.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,8 +210,7 @@ static int anx6345_dp_link_training(struct anx6345 *anx6345)
210210
if (err)
211211
return err;
212212

213-
dpcd[0] = drm_dp_max_link_rate(anx6345->dpcd);
214-
dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]);
213+
dpcd[0] = dp_bw;
215214
err = regmap_write(anx6345->map[I2C_IDX_DPTX],
216215
SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
217216
if (err)

0 commit comments

Comments
 (0)