From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: linux-kernel@vger.kernel.org
Cc: Amarula patchwork <linux-amarula@amarulasolutions.com>,
michael@amarulasolutions.com,
Dario Binacchi <dario.binacchi@amarulasolutions.com>,
Andrzej Hajda <andrzej.hajda@intel.com>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@gmail.com>,
Inki Dae <inki.dae@samsung.com>,
Jagan Teki <jagan@amarulasolutions.com>,
Jernej Skrabec <jernej.skrabec@gmail.com>,
Jonas Karlman <jonas@kwiboo.se>,
Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Maxime Ripard <mripard@kernel.org>,
Neil Armstrong <neil.armstrong@linaro.org>,
Robert Foss <rfoss@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
dri-devel@lists.freedesktop.org
Subject: [PATCH v4 03/10] drm: bridge: samsung-dsim: enter display mode in the enable() callback
Date: Tue, 5 Dec 2023 11:52:50 +0100 [thread overview]
Message-ID: <20231205105341.4100896-4-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20231205105341.4100896-1-dario.binacchi@amarulasolutions.com>
The synaptics-r63353 (panel-bridge) can only be configured in command mode.
So, samsung-dsim (bridge) must not be in display mode during the
prepare()/unprepare() of the panel-bridge. Setting the
"pre_enable_prev_first" flag to true allows the prepare() of the
panel-bridge to be called between the pre_enabled() and enabled() of the
bridge. So, the bridge can enter display mode only in the enabled().
The unprepare() of the panel-bridge is instead called between the disable()
and post_disable() of the bridge. So, the disable() must exit the display
mode (i .e. enter command mode) to allow the panel-bridge to receive DSI
commands.
samsung_dsim_atomic_pre_enable -> command mode
r63353_panel_prepare -> send DSI commands
samsung_dsim_atomic_enable -> enter display mode
samsung_dsim_atomic_disable -> exit display mode (command mode)
r63353_panel_unprepare -> send DSI commands
samsung_dsim_atomic_post_disable
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---
(no changes since v1)
drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index be5914caa17d..15bf05b2bbe4 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -1494,7 +1494,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge,
return;
samsung_dsim_set_display_mode(dsi);
- samsung_dsim_set_display_enable(dsi, true);
}
}
@@ -1507,6 +1506,7 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge,
samsung_dsim_set_display_mode(dsi);
samsung_dsim_set_display_enable(dsi, true);
} else {
+ samsung_dsim_set_display_enable(dsi, true);
samsung_dsim_set_stop_state(dsi, false);
}
@@ -1524,6 +1524,8 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge,
if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type))
samsung_dsim_set_stop_state(dsi, true);
+ samsung_dsim_set_display_enable(dsi, false);
+
dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
}
@@ -1532,7 +1534,8 @@ static void samsung_dsim_atomic_post_disable(struct drm_bridge *bridge,
{
struct samsung_dsim *dsi = bridge_to_dsi(bridge);
- samsung_dsim_set_display_enable(dsi, false);
+ if (!samsung_dsim_hw_is_exynos(dsi->plat_data->hw_type))
+ samsung_dsim_set_stop_state(dsi, true);
dsi->state &= ~DSIM_STATE_ENABLED;
pm_runtime_put_sync(dsi->dev);
--
2.43.0
next prev parent reply other threads:[~2023-12-05 10:54 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 10:52 [PATCH v4 00/10] Add displays support for bsh-smm-s2/pro boards Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 01/10] drm/bridge: Fix bridge disable logic Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 02/10] drm/bridge: Fix a use case in the " Dario Binacchi
2023-12-05 15:39 ` Dave Stevenson
2023-12-06 13:26 ` Dario Binacchi
2023-12-06 13:31 ` Jagan Teki
2023-12-06 13:57 ` Michael Nazzareno Trimarchi
2023-12-13 11:59 ` Dario Binacchi
2023-12-13 12:02 ` Jagan Teki
2023-12-13 12:17 ` Maxime Ripard
2023-12-05 10:52 ` Dario Binacchi [this message]
2023-12-05 10:52 ` [PATCH v4 04/10] drm: bridge: samsung-dsim: complete the CLKLANE_STOP setting Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 05/10] dt-bindings: display: panel: Add synaptics r63353 panel controller Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 06/10] drm/panel: Add Synaptics R63353 panel driver Dario Binacchi
2023-12-07 5:26 ` Dan Carpenter
2023-12-05 10:52 ` [PATCH v4 07/10] dt-bindings: display: panel: Add Ilitek ili9805 panel controller Dario Binacchi
2023-12-06 14:33 ` Rob Herring
2023-12-07 9:29 ` Krzysztof Kozlowski
2023-12-07 9:41 ` Maxime Ripard
2023-12-05 10:52 ` [PATCH v4 08/10] drm/panel: Add Ilitek ILI9805 panel driver Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 09/10] drm/panel: ilitek-ili9805: add support for Tianma TM041XDHG01 panel Dario Binacchi
2023-12-05 10:52 ` [PATCH v4 10/10] arm64: dts: imx8mn-bsh-smm-s2/pro: add display setup Dario Binacchi
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=20231205105341.4100896-4-dario.binacchi@amarulasolutions.com \
--to=dario.binacchi@amarulasolutions.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=inki.dae@samsung.com \
--cc=jagan@amarulasolutions.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=michael@amarulasolutions.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--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