From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Jessica Zhang <quic_jesszhan@quicinc.com>,
freedreno@lists.freedesktop.org
Cc: Marijn Suijten <marijn.suijten@somainline.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>,
Daniel Vetter <daniel@ffwll.ch>, Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <quic_abhinavk@quicinc.com>,
Sean Paul <sean@poorly.run>,
dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH RFC v2 4/6] drm/msm/dpu: Fix slice_last_group_size calculation
Date: Sun, 2 Apr 2023 14:27:58 +0300 [thread overview]
Message-ID: <b3a9fecd-0677-482b-7066-03465d5f0dd0@linaro.org> (raw)
In-Reply-To: <20230329-rfc-msm-dsc-helper-v2-4-3c13ced536b2@quicinc.com>
On 31/03/2023 21:49, Jessica Zhang wrote:
> Correct the math for slice_last_group_size so that it matches the
> calculations downstream.
>
> Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC")
> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
> index b952f7d2b7f5..9312a8d7fbd9 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
> @@ -56,7 +56,11 @@ static void dpu_hw_dsc_config(struct dpu_hw_dsc *hw_dsc,
> if (is_cmd_mode)
> initial_lines += 1;
>
> - slice_last_group_size = 3 - (dsc->slice_width % 3);
> + slice_last_group_size = dsc->slice_width % 3;
> +
> + if (slice_last_group_size == 0)
> + slice_last_group_size = 3;
Hmm. As I went on checking this against techpack:
mod = dsc->slice_width % 3
mod | techpack | old | your_patch
0 | 2 | 3 | 3
1 | 0 | 2 | 1
2 | 1 | 1 | 2
So, obviously neither old nor new code match the calculations of the
techpack. If we assume that sde_dsc_helper code is correct (which I have
no reasons to doubt), then the proper code should be:
slice_last_group_size = (dsc->slice_width + 2) % 3;
Could you please doublecheck and adjust.
> +
> data = (initial_lines << 20);
> data |= ((slice_last_group_size - 1) << 18);
> /* bpp is 6.4 format, 4 LSBs bits are for fractional part */
>
--
With best wishes
Dmitry
next prev parent reply other threads:[~2023-04-02 11:28 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-31 18:49 [PATCH RFC v2 0/6] Introduce MSM-specific DSC helpers Jessica Zhang
2023-03-31 18:49 ` [PATCH RFC v2 1/6] drm/display/dsc: Add flatness and initial scale value calculations Jessica Zhang
2023-04-01 10:01 ` Dmitry Baryshkov
2023-03-31 18:49 ` [PATCH RFC v2 2/6] drm/msm: Add MSM-specific DSC helper methods Jessica Zhang
2023-04-02 11:21 ` Dmitry Baryshkov
2023-04-03 21:38 ` Jessica Zhang
2023-04-04 0:33 ` Dmitry Baryshkov
2023-04-04 16:29 ` Jessica Zhang
2023-04-04 16:34 ` Dmitry Baryshkov
2023-04-04 17:05 ` Jessica Zhang
2023-03-31 18:49 ` [PATCH RFC v2 3/6] drm/msm/dpu: Use DRM DSC helper for det_thresh_flatness Jessica Zhang
2023-04-02 11:21 ` Dmitry Baryshkov
2023-03-31 18:49 ` [PATCH RFC v2 4/6] drm/msm/dpu: Fix slice_last_group_size calculation Jessica Zhang
2023-04-02 11:27 ` Dmitry Baryshkov [this message]
2023-04-03 21:45 ` Jessica Zhang
2023-04-03 21:51 ` Dmitry Baryshkov
2023-04-03 22:13 ` [Freedreno] " Jessica Zhang
2023-03-31 18:49 ` [PATCH RFC v2 5/6] drm/msm/dsi: Use MSM and DRM DSC helper methods Jessica Zhang
2023-04-02 11:29 ` Dmitry Baryshkov
2023-04-03 21:46 ` Jessica Zhang
2023-03-31 18:49 ` [PATCH RFC v2 6/6] drm/msm/dsi: Fix calculations for eol_byte_num and pkt_per_line Jessica Zhang
2023-04-02 11:34 ` Dmitry Baryshkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3a9fecd-0677-482b-7066-03465d5f0dd0@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_jesszhan@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox