On Mon, Jul 27, 2026 at 04:08:41PM +0800, Jun Nie wrote:
> Some panels require multiple slice to be sent in a single DSC packet. And
> this feature is a must for specific panels, such as Sharp ls026b3sa06. Add
> a dsc_slice_per_pkt member into struct drm_dsc_config and support the
> feature in msm mdss driver.
> 
> Co-developed-by: Jonathan Marek <[email protected]>
> Signed-off-by: Jonathan Marek <[email protected]>
> Signed-off-by: Jun Nie <[email protected]>
> ---
>  drivers/gpu/drm/msm/dsi/dsi_host.c | 27 ++++++++++++---------------
>  include/drm/display/drm_dsc.h      |  7 +++++++
>  2 files changed, 19 insertions(+), 15 deletions(-)
> 
> @@ -1719,8 +1709,14 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
>       msm_host->lanes = dsi->lanes;
>       msm_host->format = dsi->format;
>       msm_host->mode_flags = dsi->mode_flags;
> -     if (dsi->dsc)
> +     if (dsi->dsc) {
>               msm_host->dsc = dsi->dsc;
> +             /* for backwards compatibility, assume 1 if not set */
> +             msm_host->dsc_slice_per_pkt = dsi->dsc->dsc_slice_per_pkt ?: 1;
> +     } else {
> +             msm_host->dsc = NULL;
> +             msm_host->dsc_slice_per_pkt = 0;
> +     }

Why do you need the else branch? Isn't it already NULL / 0 by default?

>  
>       if (msm_host->format == MIPI_DSI_FMT_RGB101010) {
>               if (!msm_dsi_host_version_geq(msm_host, MSM_DSI_VER_MAJOR_6G,
> @@ -1757,6 +1753,7 @@ static int dsi_host_detach(struct mipi_dsi_host *host,
>       struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
>  
>       dsi_dev_detach(msm_host->pdev);
> +     msm_host->dsc = NULL;

If you are fixing something, it should come as a separate commit.

>  
>       DBG("id=%d", msm_host->id);
>  
> diff --git a/include/drm/display/drm_dsc.h b/include/drm/display/drm_dsc.h
> index bbbe7438473d3..c522ab3d71853 100644
> --- a/include/drm/display/drm_dsc.h
> +++ b/include/drm/display/drm_dsc.h
> @@ -267,6 +267,13 @@ struct drm_dsc_config {
>        * Offset adjustment for second line in Native 4:2:0 mode
>        */
>       u16 second_line_offset_adj;
> +
> +     /**
> +      * @dsc_slice_per_pkt:
> +      * Number of DSC slices to be sent in a single packet. This is not
> +      * part of DSC standard, and only used in some DSI panels so far.
> +      */
> +     unsigned int dsc_slice_per_pkt;

If it's not a part of the standard, I think, it should not be a part of
drm_dsc_config. In the end, drm_dsc_config is also being used by other
parties, e.g. DP or HDMI. A year ago I saw a version of this patch,
having this field in the struct mipi_dsi_device. I think it's a more
correct place.

-- 
With best wishes
Dmitry

Reply via email to