Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/msm/dsi: fix hdisplay calculation when programming dsi registers

Recently, the hdisplay calculation is working for 3:1 compressed ratio
only. If we have a video panel with DSC BPP = 8, and BPC = 10, we still
use the default bits_per_pclk = 24, then we get the wrong hdisplay. We
can draw the conclusion by cross-comparing the calculation with the
calculation in dsi_adjust_pclk_for_compression().

Since CMD mode does not use this, we can remove
!(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO) safely.

Fixes: efcbd6f9cdeb ("drm/msm/dsi: Enable widebus for DSI")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Patchwork: https://patchwork.freedesktop.org/patch/704822/
Link: https://lore.kernel.org/r/20260214105145.105308-1-mitltlatltl@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

authored by

Pengyu Luo and committed by
Dmitry Baryshkov
ac47870f 5886cc8f

+8 -6
+8 -6
drivers/gpu/drm/msm/dsi/dsi_host.c
··· 993 993 994 994 if (msm_host->dsc) { 995 995 struct drm_dsc_config *dsc = msm_host->dsc; 996 - u32 bytes_per_pclk; 996 + u32 bits_per_pclk; 997 997 998 998 /* update dsc params with timing params */ 999 999 if (!dsc || !mode->hdisplay || !mode->vdisplay) { ··· 1015 1015 1016 1016 /* 1017 1017 * DPU sends 3 bytes per pclk cycle to DSI. If widebus is 1018 - * enabled, bus width is extended to 6 bytes. 1018 + * enabled, MDP always sends out 48-bit compressed data per 1019 + * pclk and on average, DSI consumes an amount of compressed 1020 + * data equivalent to the uncompressed pixel depth per pclk. 1019 1021 * 1020 1022 * Calculate the number of pclks needed to transmit one line of 1021 1023 * the compressed data. ··· 1029 1027 * unused anyway. 1030 1028 */ 1031 1029 h_total -= hdisplay; 1032 - if (wide_bus_enabled && !(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO)) 1033 - bytes_per_pclk = 6; 1030 + if (wide_bus_enabled) 1031 + bits_per_pclk = mipi_dsi_pixel_format_to_bpp(msm_host->format); 1034 1032 else 1035 - bytes_per_pclk = 3; 1033 + bits_per_pclk = 24; 1036 1034 1037 - hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc), bytes_per_pclk); 1035 + hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc) * 8, bits_per_pclk); 1038 1036 1039 1037 h_total += hdisplay; 1040 1038 ha_end = ha_start + hdisplay;