From: Icenowy Zheng <zhengxingda@iscas.ac.cn>
To: Andrzej Hajda <andrzej.hajda@intel.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Jonas Karlman <jonas@kwiboo.se>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Luca Ceresoli <luca.ceresoli@bootlin.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
Ondrej Jirman <megi@xff.cz>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/bridge: dw-mipi-dsi: fix cmd mode transition when disabling
Date: Thu, 19 Nov 2026 22:37:27 +0800 [thread overview]
Message-ID: <74dd76a7dd4fb3e627b22833b19fad70e52bf3e1.camel@iscas.ac.cn> (raw)
In-Reply-To: <20261030055806.4102994-1-zhengxingda@iscas.ac.cn>
在 2026-10-30五的 13:58 +0800,Icenowy Zheng写道:
> With pre_enable_prev_first flag set, the atomic_post_disable hook of the
> next bridge (which should be the DSI panel bridge and calls panel
> unprepare hook) is called before the hook of the DSI controller bridge,
> which leads to the switch to command mode happening after the panel
> unprepare. In this case some panels' unprepare hooks sliently fails
> because they expect the DSI controller to be in command mode.
>
> As the DSI controller atomic_disable hook happens after panel bridge
> atomic_disable but before panel bridge atomic_post_disable, it seems to
> be a good position for the transition to the command mode.
>
> Move the mode transition from the atomic_post_disable hook to a newly
> created atomic_disable hook.
>
> Fixes: 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller")
> Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Ping, would anyone take a look at this patch?
> ---
> Tested on Lichee Console 4A with a pending glue driver for T-Head TH1520
> DW MIPI DSI. This device has a always-powered panel (no switchable
> supply and no reset pin), so correct execution of unprepare commands is
> critical.
>
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 23 ++++++++++++-------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index 5dd475fcaacf8..49b6228ca69e5 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -944,14 +944,6 @@ static void dw_mipi_dsi_bridge_post_atomic_disable(struct drm_bridge *bridge,
> struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
> const struct dw_mipi_dsi_phy_ops *phy_ops = dsi->plat_data->phy_ops;
>
> - /*
> - * 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);
> -
> if (phy_ops->power_off)
> phy_ops->power_off(dsi->plat_data->priv_data);
>
> @@ -1058,6 +1050,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);
Sashiko says that the secondary controller needs to be put into command
mode too, is it the case?
If it is, I would add it to this hunk (although it's previously not
present).
Thanks,
Icenowy
> +}
> +
> static enum drm_mode_status
> dw_mipi_dsi_bridge_mode_valid(struct drm_bridge *bridge,
> const struct drm_display_info *info,
> @@ -1098,6 +1104,7 @@ static const struct drm_bridge_funcs dw_mipi_dsi_bridge_funcs = {
> .atomic_create_state = drm_atomic_helper_bridge_create_state,
> .atomic_pre_enable = dw_mipi_dsi_bridge_atomic_pre_enable,
> .atomic_enable = dw_mipi_dsi_bridge_atomic_enable,
> + .atomic_disable = dw_mipi_dsi_bridge_atomic_disable,
> .atomic_post_disable = dw_mipi_dsi_bridge_post_atomic_disable,
> .mode_set = dw_mipi_dsi_bridge_mode_set,
> .mode_valid = dw_mipi_dsi_bridge_mode_valid,
prev parent reply other threads:[~2026-11-19 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-30 5:58 Icenowy Zheng
2026-11-19 14:37 ` Icenowy Zheng [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=74dd76a7dd4fb3e627b22833b19fad70e52bf3e1.camel@iscas.ac.cn \
--to=zhengxingda@iscas.ac.cn \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=luca.ceresoli@bootlin.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=megi@xff.cz \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®