[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <t3dkuckbko5lmkfezhdtcwrynnbcs4yfn5mtmdyirnktellc5a@ktab3j6rvf3u>
Date: Sun, 21 Apr 2024 13:09:04 +0200
From: Ondřej Jirman <megi@....cz>
To: Marek Vasut <marex@...x.de>
Cc: dri-devel@...ts.freedesktop.org,
Andrzej Hajda <andrzej.hajda@...el.com>, Biju Das <biju.das.jz@...renesas.com>,
Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>,
Douglas Anderson <dianders@...omium.org>, Jernej Skrabec <jernej.skrabec@...il.com>,
Jonas Karlman <jonas@...boo.se>, Laurent Pinchart <Laurent.pinchart@...asonboard.com>,
Liu Ying <victor.liu@....com>, Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Neil Armstrong <neil.armstrong@...aro.org>,
Rob Herring <robh@...nel.org>, Robert Foss <rfoss@...nel.org>, Sam Ravnborg <sam@...nborg.org>,
Thomas Zimmermann <tzimmermann@...e.de>, linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] drm: bridge: dw-mipi-dsi: Call modeset in modeset
callback
Hi,
On Sun, Apr 21, 2024 at 02:22:35AM GMT, Marek Vasut wrote:
> Doing modeset in .atomic_pre_enable callback instead of dedicated .mode_set
> callback does not seem right. Undo this change, which was added as part of
Actually no. If anything, mode_set callback should be dropped entirely:
See https://elixir.bootlin.com/linux/latest/source/include/drm/drm_bridge.h#L231
It's deprecated, and enable callback should just use adjusted_mode:
This is deprecated, do not use! New drivers shall set their mode in the
&drm_bridge_funcs.atomic_enable operation.
> commit 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI
> controller") as it breaks STM32MP15xx LTDC scanout (DSI)->TC358762 DSI-to-DPI
> bridge->PT800480 DPI panel pipeline. The original fix for HX8394 panel likely
> requires HX8394 panel side fix instead.
There's nothing wrong with the panel driver. And that commit is not fixing issue
with the panel driver, just like the subject hints at. Look at the referenced
commit, at "Before:" sequence specifically.
dw_mipi_dsi_mode_set may be named *_mode_set or whatever, but it's basically
an enable function that turns on clocks, initalizes phy, etc. etc.
https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c#L998
And if you check "Before:" sequence, you'll see that .mode_set callback is just
called once at boot and never again. And it's atomic(_pre)_enable/atomic(_post)_disable
callbacks that actually are called in ballanced way to enable/disable the
controller repeatedly ever after.
Function dw_mipi_dsi_bridge_post_atomic_disable is the inverse of
dw_mipi_dsi_mode_set, it undoes everything that dw_mipi_dsi_mode_set does.
You need to find root cause for your issue on STM32MP15xx instead of reverting
fixes for resource use bugs in this driver.
kind regards,
o.
> Fixes: 05aa61334592 ("drm: bridge: dw-mipi-dsi: Fix enable/disable of DSI controller")
> Signed-off-by: Marek Vasut <marex@...x.de>
> ---
> Cc: Andrzej Hajda <andrzej.hajda@...el.com>
> Cc: Biju Das <biju.das.jz@...renesas.com>
> Cc: Daniel Vetter <daniel@...ll.ch>
> Cc: David Airlie <airlied@...il.com>
> Cc: Douglas Anderson <dianders@...omium.org>
> Cc: Jernej Skrabec <jernej.skrabec@...il.com>
> Cc: Jonas Karlman <jonas@...boo.se>
> Cc: Laurent Pinchart <Laurent.pinchart@...asonboard.com>
> Cc: Liu Ying <victor.liu@....com>
> Cc: Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>
> Cc: Maxime Ripard <mripard@...nel.org>
> Cc: Neil Armstrong <neil.armstrong@...aro.org>
> Cc: Ondrej Jirman <megi@....cz>
> Cc: Rob Herring <robh@...nel.org>
> Cc: Robert Foss <rfoss@...nel.org>
> Cc: Sam Ravnborg <sam@...nborg.org>
> Cc: Thomas Zimmermann <tzimmermann@...e.de>
> Cc: dri-devel@...ts.freedesktop.org
> Cc: linux-kernel@...r.kernel.org
> ---
> drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 18 +++---------------
> 1 file changed, 3 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> index 824fb3c65742e..ca5894393dba4 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
> @@ -268,7 +268,6 @@ struct dw_mipi_dsi {
> struct dw_mipi_dsi *master; /* dual-dsi master ptr */
> struct dw_mipi_dsi *slave; /* dual-dsi slave ptr */
>
> - struct drm_display_mode mode;
> const struct dw_mipi_dsi_plat_data *plat_data;
> };
>
> @@ -1016,25 +1015,15 @@ static void dw_mipi_dsi_mode_set(struct dw_mipi_dsi *dsi,
> phy_ops->power_on(dsi->plat_data->priv_data);
> }
>
> -static void dw_mipi_dsi_bridge_atomic_pre_enable(struct drm_bridge *bridge,
> - struct drm_bridge_state *old_bridge_state)
> -{
> - struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
> -
> - /* Power up the dsi ctl into a command mode */
> - dw_mipi_dsi_mode_set(dsi, &dsi->mode);
> - if (dsi->slave)
> - dw_mipi_dsi_mode_set(dsi->slave, &dsi->mode);
> -}
> -
> static void dw_mipi_dsi_bridge_mode_set(struct drm_bridge *bridge,
> const struct drm_display_mode *mode,
> const struct drm_display_mode *adjusted_mode)
> {
> struct dw_mipi_dsi *dsi = bridge_to_dsi(bridge);
>
> - /* Store the display mode for later use in pre_enable callback */
> - drm_mode_copy(&dsi->mode, adjusted_mode);
> + dw_mipi_dsi_mode_set(dsi, adjusted_mode);
> + if (dsi->slave)
> + dw_mipi_dsi_mode_set(dsi->slave, adjusted_mode);
> }
>
> static void dw_mipi_dsi_bridge_atomic_enable(struct drm_bridge *bridge,
> @@ -1090,7 +1079,6 @@ static const struct drm_bridge_funcs dw_mipi_dsi_bridge_funcs = {
> .atomic_get_input_bus_fmts = dw_mipi_dsi_bridge_atomic_get_input_bus_fmts,
> .atomic_check = dw_mipi_dsi_bridge_atomic_check,
> .atomic_reset = drm_atomic_helper_bridge_reset,
> - .atomic_pre_enable = dw_mipi_dsi_bridge_atomic_pre_enable,
> .atomic_enable = dw_mipi_dsi_bridge_atomic_enable,
> .atomic_post_disable = dw_mipi_dsi_bridge_post_atomic_disable,
> .mode_set = dw_mipi_dsi_bridge_mode_set,
> --
> 2.43.0
>
Powered by blists - more mailing lists