]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/msm/dsi: fix hdisplay calculation for CMD mode panel
authorPengyu Luo <mitltlatltl@gmail.com>
Sat, 7 Mar 2026 11:12:49 +0000 (19:12 +0800)
committerDmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Wed, 25 Mar 2026 06:06:14 +0000 (08:06 +0200)
Commit ac47870fd795 ("drm/msm/dsi: fix hdisplay calculation when
programming dsi registers") incorrecly broke hdisplay calculation for
CMD mode by specifying incorrect number of bytes per transfer, fix it.

Fixes: ac47870fd795 ("drm/msm/dsi: fix hdisplay calculation when programming dsi registers")
Signed-off-by: Pengyu Luo <mitltlatltl@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/709917/
Link: https://lore.kernel.org/r/20260307111250.105772-2-mitltlatltl@gmail.com
[DB: fixed commit message]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
drivers/gpu/drm/msm/dsi/dsi_host.c

index 3efcc3f6c381c4e66add2dff5edfcb656945614c..1c0841a1c101334ce2b097408668fb448f9dd821 100644 (file)
@@ -1034,8 +1034,9 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
                /*
                 * DPU sends 3 bytes per pclk cycle to DSI. If widebus is
                 * enabled, MDP always sends out 48-bit compressed data per
-                * pclk and on average, DSI consumes an amount of compressed
-                * data equivalent to the uncompressed pixel depth per pclk.
+                * pclk and on average, for video mode, DSI consumes only an
+                * amount of compressed data equivalent to the uncompressed
+                * pixel depth per pclk.
                 *
                 * Calculate the number of pclks needed to transmit one line of
                 * the compressed data.
@@ -1047,10 +1048,14 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
                 * unused anyway.
                 */
                h_total -= hdisplay;
-               if (wide_bus_enabled)
-                       bits_per_pclk = dsc->bits_per_component * 3;
-               else
+               if (wide_bus_enabled) {
+                       if (msm_host->mode_flags & MIPI_DSI_MODE_VIDEO)
+                               bits_per_pclk = dsc->bits_per_component * 3;
+                       else
+                               bits_per_pclk = 48;
+               } else {
                        bits_per_pclk = 24;
+               }
 
                hdisplay = DIV_ROUND_UP(msm_dsc_get_bytes_per_line(msm_host->dsc) * 8, bits_per_pclk);