aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarijn Suijten <[email protected]>2022-10-26 20:28:17 +0200
committerDmitry Baryshkov <[email protected]>2022-11-04 17:39:41 +0300
commit1e8196103bd02a396b45c8f6188541634a47fce2 (patch)
tree4cc5d2684bff8d42652d1c9845d919f8ae3a32a8
parent170ffca836dd9f1a0219c4f67554d408fa2b5912 (diff)
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: b9080324d6ca ("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]>
-rw-r--r--drivers/gpu/drm/msm/dsi/dsi_host.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index d94832504d0f..88c8aa5c6b80 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -1807,9 +1807,7 @@ static int dsi_populate_dsc_params(struct drm_dsc_config *dsc)
* params are calculated
*/
groups_per_line = DIV_ROUND_UP(dsc->slice_width, 3);
- dsc->slice_chunk_size = dsc->slice_width * dsc->bits_per_pixel / 8;
- if ((dsc->slice_width * dsc->bits_per_pixel) % 8)
- dsc->slice_chunk_size++;
+ dsc->slice_chunk_size = DIV_ROUND_UP(dsc->slice_width * dsc->bits_per_pixel, 8);
/* rbs-min */
min_rate_buffer_size = dsc->rc_model_size - dsc->initial_offset +