[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20200308152238.1294229-2-t.schramm@manjaro.org>
Date: Sun, 8 Mar 2020 16:22:38 +0100
From: Tobias Schramm <t.schramm@...jaro.org>
To: Andrzej Hajda <a.hajda@...sung.com>,
Neil Armstrong <narmstrong@...libre.com>,
Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Jonas Karlman <jonas@...boo.se>,
Jernej Skrabec <jernej.skrabec@...l.net>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>
Cc: Brian Masney <masneyb@...tation.org>,
Linus Walleij <linus.walleij@...aro.org>,
Maxime Ripard <maxime@...no.tech>,
Icenowy Zheng <icenowy@...c.io>,
Thomas Gleixner <tglx@...utronix.de>,
Sam Ravnborg <sam@...nborg.org>,
Thierry Reding <treding@...dia.com>,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
Tobias Schramm <t.schramm@...jaro.org>
Subject: [PATCH v2 1/1] drm/bridge: anx78xx: fix calculation of dp link rate
commit ff1e8fb68ea0 ("drm/bridge: analogix-anx78xx: Avoid drm_dp_link helpers")
changed the link training logic to remove use of drm_dp_link helpers.
However the new logic stores the maximum link rate in a u8, overflowing
it.
This commit changes the logic to store the bw code directly, avoiding any
overflows.
Fixes: ff1e8fb68ea0 ("drm/bridge: analogix-anx78xx: Avoid drm_dp_link helpers")
Signed-off-by: Tobias Schramm <t.schramm@...jaro.org>
---
drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index 41867be03751..0c6b049b5753 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -722,8 +722,7 @@ static int anx78xx_dp_link_training(struct anx78xx *anx78xx)
if (err)
return err;
- dpcd[0] = drm_dp_max_link_rate(anx78xx->dpcd);
- dpcd[0] = drm_dp_link_rate_to_bw_code(dpcd[0]);
+ dpcd[0] = anx78xx->dpcd[DP_MAX_LINK_RATE];
err = regmap_write(anx78xx->map[I2C_IDX_TX_P0],
SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
if (err)
--
2.24.1
Powered by blists - more mailing lists