* [RESEND][PATCH] drm/bridge: analogix-anx78xx: Fix drm_dp_link helper removal
@ 2020-02-18 15:57 Torsten Duwe
2020-02-18 19:12 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Torsten Duwe @ 2020-02-18 15:57 UTC (permalink / raw)
To: Thierry Reding, Daniel Vetter
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, David Airlie, Daniel Vetter, Maxime Ripard,
dri-devel, linux-kernel
drm_dp_link_rate_to_bw_code and ...bw_code_to_link_rate simply divide by
and multiply with 27000, respectively. Avoid an overflow in the u8 dpcd[0]
and the multiply+divide alltogether.
fixes: ff1e8fb68ea06027 ("analogix-anx78xx: Avoid drm_dp_link helpers")
Signed-off-by: Torsten Duwe <duwe@suse.de>
Reviewed-by: Thierry Reding <treding@nvidia.com>
---
https://patchwork.freedesktop.org/patch/343003/ (dropped the review mark)
https://lists.freedesktop.org/archives/dri-devel/2020-January/253535.html
---
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index 41867be03751..864423f59d66 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -722,10 +722,9 @@ 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]);
err = regmap_write(anx78xx->map[I2C_IDX_TX_P0],
- SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
+ SP_DP_MAIN_LINK_BW_SET_REG,
+ anx78xx->dpcd[DP_MAX_LINK_RATE]);
if (err)
return err;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RESEND][PATCH] drm/bridge: analogix-anx78xx: Fix drm_dp_link helper removal
2020-02-18 15:57 [RESEND][PATCH] drm/bridge: analogix-anx78xx: Fix drm_dp_link helper removal Torsten Duwe
@ 2020-02-18 19:12 ` Daniel Vetter
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2020-02-18 19:12 UTC (permalink / raw)
To: Torsten Duwe
Cc: Thierry Reding, Daniel Vetter, Andrzej Hajda, Neil Armstrong,
Laurent Pinchart, Jonas Karlman, Jernej Skrabec, David Airlie,
Maxime Ripard, dri-devel, linux-kernel
On Tue, Feb 18, 2020 at 04:57:44PM +0100, Torsten Duwe wrote:
> drm_dp_link_rate_to_bw_code and ...bw_code_to_link_rate simply divide by
> and multiply with 27000, respectively. Avoid an overflow in the u8 dpcd[0]
> and the multiply+divide alltogether.
>
> fixes: ff1e8fb68ea06027 ("analogix-anx78xx: Avoid drm_dp_link helpers")
> Signed-off-by: Torsten Duwe <duwe@suse.de>
Since same company I'm assuming Thomas Zimmermann will take care of these
patches for you. Or you need to ping maintainers again to push these for
you.
Also if you expect to regularlay contribut drm patches, just ask for
commit rights after 5-10 patches landed.
Cheers, Daniel
> Reviewed-by: Thierry Reding <treding@nvidia.com>
> ---
> https://patchwork.freedesktop.org/patch/343003/ (dropped the review mark)
> https://lists.freedesktop.org/archives/dri-devel/2020-January/253535.html
>
> ---
> diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> index 41867be03751..864423f59d66 100644
> --- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> +++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
> @@ -722,10 +722,9 @@ 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]);
> err = regmap_write(anx78xx->map[I2C_IDX_TX_P0],
> - SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
> + SP_DP_MAIN_LINK_BW_SET_REG,
> + anx78xx->dpcd[DP_MAX_LINK_RATE]);
> if (err)
> return err;
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RESEND][PATCH] drm/bridge: analogix-anx78xx: Fix drm_dp_link helper removal
@ 2020-02-18 15:47 Torsten Duwe
0 siblings, 0 replies; 3+ messages in thread
From: Torsten Duwe @ 2020-02-18 15:47 UTC (permalink / raw)
To: Thierry Reding, Daniel Vetter
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, David Airlie, Daniel Vetter, Maxime Ripard,
dri-devel, linux-kernel
drm_dp_link_rate_to_bw_code and ...bw_code_to_link_rate simply divide by
and multiply with 27000, respectively. Avoid an overflow in the u8 dpcd[0]
and the multiply+divide alltogether.
fixes: ff1e8fb68ea06027 ("analogix-anx78xx: Avoid drm_dp_link helpers")
Signed-off-by: Torsten Duwe <duwe@suse.de>
---
https://patchwork.freedesktop.org/patch/343003/
https://lists.freedesktop.org/archives/dri-devel/2020-January/253535.html
---
diff --git a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
index 41867be03751..864423f59d66 100644
--- a/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
+++ b/drivers/gpu/drm/bridge/analogix/analogix-anx78xx.c
@@ -722,10 +722,9 @@ 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]);
err = regmap_write(anx78xx->map[I2C_IDX_TX_P0],
- SP_DP_MAIN_LINK_BW_SET_REG, dpcd[0]);
+ SP_DP_MAIN_LINK_BW_SET_REG,
+ anx78xx->dpcd[DP_MAX_LINK_RATE]);
if (err)
return err;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-18 19:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 15:57 [RESEND][PATCH] drm/bridge: analogix-anx78xx: Fix drm_dp_link helper removal Torsten Duwe
2020-02-18 19:12 ` Daniel Vetter
-- strict thread matches above, loose matches on Subject: below --
2020-02-18 15:47 Torsten Duwe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®