Skip to content

Commit 21bf617

Browse files
Jessica Zhanglumag
authored andcommitted
msm/drm/dsi: Round up DSC hdisplay calculation
Currently, when compression is enabled, hdisplay is reduced via integer division. This causes issues for modes where the original hdisplay is not a multiple of 3. To fix this, use DIV_ROUND_UP to divide hdisplay. Suggested-by: Marijn Suijten <marijn.suijten@somainline.org> Fixes: 08802f5 ("drm/msm/dsi: Add support for DSC configuration") Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com> Patchwork: https://patchwork.freedesktop.org/patch/541970/ Link: https://lore.kernel.org/r/20230405-add-dsc-support-v6-1-95eab864d1b6@quicinc.com Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
1 parent 0d1b10c commit 21bf617

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
949949
* pulse width same
950950
*/
951951
h_total -= hdisplay;
952-
hdisplay = msm_dsc_get_bytes_per_line(msm_host->dsc) / 3;
952+
hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc), 3);
953953
h_total += hdisplay;
954954
ha_end = ha_start + hdisplay;
955955
}

0 commit comments

Comments
 (0)