]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/msm/dsi: Allow values of 10 and 12 for bits per component
authorEugene Lepshy <fekz115@gmail.com>
Mon, 17 Feb 2025 22:24:30 +0000 (01:24 +0300)
committerDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Wed, 26 Feb 2025 10:15:49 +0000 (12:15 +0200)
The DRM DSC helper has various bits_per_component values - not just 8.
But the DSC 1.1 block supports only 8, 10, and 12. Extend the guard
accordingly and add a comment noting this limitation.

Signed-off-by: Eugene Lepshy <fekz115@gmail.com>
Co-developed-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/637831/
Link: https://lore.kernel.org/r/20250217222431.82522-4-danila@jiaxyga.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
drivers/gpu/drm/msm/dsi/dsi_host.c

index b6ae9717a5d36d238769d1c2faf868ee354ea84c..5b245133a1d1948df59a3a340f0cd635573a012c 100644 (file)
@@ -1759,8 +1759,20 @@ static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc
                return -EINVAL;
        }
 
-       if (dsc->bits_per_component != 8) {
-               DRM_DEV_ERROR(&msm_host->pdev->dev, "DSI does not support bits_per_component != 8 yet\n");
+       switch (dsc->bits_per_component) {
+       case 8:
+       case 10:
+       case 12:
+               /*
+                * Only 8, 10, and 12 bpc are supported for DSC 1.1 block.
+                * If additional bpc values need to be supported, update
+                * this quard with the appropriate DSC version verification.
+                */
+               break;
+       default:
+               DRM_DEV_ERROR(&msm_host->pdev->dev,
+                             "Unsupported bits_per_component value: %d\n",
+                             dsc->bits_per_component);
                return -EOPNOTSUPP;
        }
 
@@ -1771,7 +1783,7 @@ static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc
        drm_dsc_set_const_params(dsc);
        drm_dsc_set_rc_buf_thresh(dsc);
 
-       /* handle only bpp = bpc = 8, pre-SCR panels */
+       /* DPU supports only pre-SCR panels */
        ret = drm_dsc_setup_rc_params(dsc, DRM_DSC_1_1_PRE_SCR);
        if (ret) {
                DRM_DEV_ERROR(&msm_host->pdev->dev, "could not find DSC RC parameters\n");