Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] drm/bridge: dw-mipi-dsi: missing dsi->slave cmd mode switch in 
atomic_disable()
--

commit 99d2bade79250c503a435eb9a6a3898d6ebd22f7
Author: Icenowy Zheng <[email protected]>

drm/bridge: dw-mipi-dsi: fix cmd mode transition when disabling

This commit moves the command mode transition from the atomic_post_disable
hook into a new atomic_disable hook so that the DSI controller switches to
command mode before the panel bridge runs its atomic_post_disable and
panel unprepare callbacks.

> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c 
> b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index 22d1b8cbe1d57..7cd0ca76b86ee 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c

[ ... ]

> @@ -1057,6 +1049,20 @@ static void dw_mipi_dsi_bridge_atomic_enable(struct 
> drm_bridge *bridge,
>               dw_mipi_dsi_set_mode(dsi->slave, MIPI_DSI_MODE_VIDEO);
>  }
>  
> +static void dw_mipi_dsi_bridge_atomic_disable(struct drm_bridge *bridge,
> +                                           struct drm_atomic_commit *state)
> +{
> +     struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
> +
> +     /*
> +      * Switch to command mode before panel-bridge post_disable &
> +      * panel unprepare.
> +      * Note: panel-bridge disable & panel disable has been called
> +      * before by the drm framework.
> +      */
> +     dw_mipi_dsi_set_mode(dsi, 0);
> +}

[Severity: Medium]
Should dw_mipi_dsi_bridge_atomic_disable() also switch dsi->slave to command
mode when operating in a dual-DSI configuration?

In dw_mipi_dsi_bridge_atomic_enable(), both the master and slave controllers
are switched to video mode:

        dw_mipi_dsi_set_mode(dsi, MIPI_DSI_MODE_VIDEO);
        if (dsi->slave)
                dw_mipi_dsi_set_mode(dsi->slave, MIPI_DSI_MODE_VIDEO);

And when the panel subsequently sends DSI commands during unprepare,
dw_mipi_dsi_host_transfer() transmits the packet through both controllers:

        dw_mipi_message_config(dsi, msg);
        if (dsi->slave)
                dw_mipi_message_config(dsi->slave, msg);

        ret = dw_mipi_dsi_write(dsi, &packet);
        if (ret)
                return ret;
        if (dsi->slave) {
                ret = dw_mipi_dsi_write(dsi->slave, &packet);
                if (ret)
                        return ret;
        }

Without switching dsi->slave back to command mode in
dw_mipi_dsi_bridge_atomic_disable(), won't commands sent during panel
unprepare reach the slave controller while it is still in video mode?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=1

Reply via email to