[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f110b0fa-f41f-47e8-a83b-30de2f2b128c@linaro.org>
Date: Fri, 8 Sep 2023 03:35:14 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: Abhinav Kumar <quic_abhinavk@...cinc.com>,
freedreno@...ts.freedesktop.org, Rob Clark <robdclark@...il.com>,
Sean Paul <sean@...rly.run>,
Marijn Suijten <marijn.suijten@...ainline.org>,
David Airlie <airlied@...il.com>,
Daniel Vetter <daniel@...ll.ch>,
Kalyan Thota <quic_kalyant@...cinc.com>
Cc: dri-devel@...ts.freedesktop.org, quic_jesszhan@...cinc.com,
quic_parellan@...cinc.com, nespera@...lia.com,
Rob Clark <robdclark@...omium.org>,
linux-arm-msm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drm/msm/dpu: change _dpu_plane_calc_bw() to use u64 to
avoid overflow
On 08/09/2023 03:32, Abhinav Kumar wrote:
> _dpu_plane_calc_bw() uses integer variables to calculate the bandwidth
> used during plane bandwidth calculations. However for high resolution
> displays this overflows easily and leads to below errors
Can we move the u64 conversion closer to the place where we actually
need it? Having u64 source width looks very strange.
>
> [dpu error]crtc83 failed performance check -7
>
> Promote the intermediate variables to u64 to avoid overflow.
>
> Fixes: c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display")
> Closes: https://gitlab.freedesktop.org/drm/msm/-/issues/32
> Signed-off-by: Abhinav Kumar <quic_abhinavk@...cinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index ae970af1154f..c6193131beec 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -118,7 +118,7 @@ static u64 _dpu_plane_calc_bw(const struct dpu_mdss_cfg *catalog,
> const struct drm_display_mode *mode,
> struct dpu_sw_pipe_cfg *pipe_cfg)
> {
> - int src_width, src_height, dst_height, fps;
> + u64 src_width, src_height, dst_height, fps;
> u64 plane_prefill_bw;
> u64 plane_bw;
> u32 hw_latency_lines;
--
With best wishes
Dmitry
Powered by blists - more mailing lists