Skip to content

Commit 1e81961

Browse files
MarijnS95lumag
authored andcommitted
drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo
This exact same math is used to compute bytes_in_slice above in dsi_update_dsc_timing(), also used to fill slice_chunk_size. Fixes: b908032 ("drm/msm/dsi: add support for dsc data") Reviewed-by: Abhinav Kumar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Marijn Suijten <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/508935/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 170ffca commit 1e81961

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/gpu/drm/msm/dsi/dsi_host.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,9 +1807,7 @@ static int dsi_populate_dsc_params(struct drm_dsc_config *dsc)
18071807
* params are calculated
18081808
*/
18091809
groups_per_line = DIV_ROUND_UP(dsc->slice_width, 3);
1810-
dsc->slice_chunk_size = dsc->slice_width * dsc->bits_per_pixel / 8;
1811-
if ((dsc->slice_width * dsc->bits_per_pixel) % 8)
1812-
dsc->slice_chunk_size++;
1810+
dsc->slice_chunk_size = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8);
18131811

18141812
/* rbs-min */
18151813
min_rate_buffer_size = dsc->rc_model_size - dsc->initial_offset +

0 commit comments

Comments
 (0)