drm/msm/dpu: Fix slice_last_group_size calculation

Correct the math for slice_last_group_size so that it matches the
calculations downstream.

Fixes: c110cfd175 ("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>
This commit is contained in:
Jessica Zhang 2023-05-24 10:45:20 -07:00 committed by Dmitry Baryshkov
parent 44346191a2
commit c223059e6f
1 changed files with 3 additions and 2 deletions

View File

@ -56,9 +56,10 @@ static void dpu_hw_dsc_config(struct dpu_hw_dsc *hw_dsc,
if (is_cmd_mode) if (is_cmd_mode)
initial_lines += 1; 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 = (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 */ /* bpp is 6.4 format, 4 LSBs bits are for fractional part */
data |= (dsc->bits_per_pixel << 8); data |= (dsc->bits_per_pixel << 8);
data |= (dsc->block_pred_enable << 7); data |= (dsc->block_pred_enable << 7);