]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/msm/dpu: Fix slice_last_group_size calculation
authorJessica Zhang <quic_jesszhan@quicinc.com>
Wed, 24 May 2023 17:45:20 +0000 (10:45 -0700)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Mon, 2 Oct 2023 15:19:46 +0000 (17:19 +0200)
BugLink: https://bugs.launchpad.net/bugs/2034469
[ Upstream commit c223059e6f8340f7eac2319470984cbfc39c433b ]

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")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/539269/
Link: https://lore.kernel.org/r/20230329-rfc-msm-dsc-helper-v14-7-bafc7be95691@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c

index 3662df698dae5206dbbf7c312341c65c10be8212..c8f14555834a8377baa712d306494a92b08ca8bc 100644 (file)
@@ -52,9 +52,10 @@ 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 + 2) % 3;
+
        data = (initial_lines << 20);
-       data |= ((slice_last_group_size - 1) << 18);
+       data |= (slice_last_group_size << 18);
        /* bpp is 6.4 format, 4 LSBs bits are for fractional part */
        data |= (dsc->bits_per_pixel << 8);
        data |= (dsc->block_pred_enable << 7);