mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dario Binacchi <dario.binacchi@amarulasolutions.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: michael@amarulasolutions.com, linux-amarula@amarulasolutions.com,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	David Airlie <airlied@gmail.com>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Simona Vetter <simona@ffwll.ch>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 2/8] drm/panel: Add sro_install hook
Date: Sun, 22 Nov 2026 16:30:02 +0100	[thread overview]
Message-ID: <20261122153032.2782768-3-dario.binacchi@amarulasolutions.com> (raw)
In-Reply-To: <20261122153032.2782768-1-dario.binacchi@amarulasolutions.com>

The panel bridge assumes the panel is enabled whenever its pipeline
is read out as active, but the panel is left marked as unprepared and
disabled. The following disable is then skipped, and the panel driver
never gets the chance to acquire the resources it will release when
unprepared.

Add the sro_install hook, called when the state read out from the
hardware is installed. On success the panel is marked as prepared and
enabled.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

 drivers/gpu/drm/drm_panel.c | 16 ++++++++++++++++
 include/drm/drm_panel.h     | 10 ++++++++++
 2 files changed, 26 insertions(+)

diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c
index bef0e6af73ba..daccf98e5513 100644
--- a/drivers/gpu/drm/drm_panel.c
+++ b/drivers/gpu/drm/drm_panel.c
@@ -346,6 +346,21 @@ panel_bridge_connector_readout(struct drm_bridge *bridge,
 	return 0;
 }
 
+static void panel_bridge_install_state(struct drm_bridge *bridge,
+				       struct drm_bridge_state *bridge_state)
+{
+	struct drm_panel *panel = drm_bridge_to_panel(bridge);
+
+	if (!panel->funcs || !panel->funcs->sro_install)
+		return;
+
+	if (panel->funcs->sro_install(panel))
+		return;
+
+	panel->prepared = true;
+	panel->enabled = true;
+}
+
 static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
 	.attach = panel_bridge_attach,
 	.detach = panel_bridge_detach,
@@ -360,6 +375,7 @@ static const struct drm_bridge_funcs panel_bridge_bridge_funcs = {
 	.atomic_get_input_bus_fmts = drm_atomic_helper_bridge_propagate_bus_fmt,
 	.debugfs_init = panel_bridge_debugfs_init,
 	.atomic_sro_readout_state = panel_bridge_readout_state,
+	.atomic_sro_install_state = panel_bridge_install_state,
 	.atomic_sro_compare_state = drm_atomic_helper_bridge_compare_state,
 	.atomic_sro_connector_readout = panel_bridge_connector_readout,
 };
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h
index 58113ea7d63a..66f9fc0828f1 100644
--- a/include/drm/drm_panel.h
+++ b/include/drm/drm_panel.h
@@ -148,6 +148,16 @@ struct drm_panel_funcs {
 	 * Allows panels to create panels-specific debugfs files.
 	 */
 	void (*debugfs_init)(struct drm_panel *panel, struct dentry *root);
+
+	/**
+	 * @sro_install:
+	 *
+	 * Acquire the resources of a panel found enabled when the hardware
+	 * state was read out, without touching the hardware.
+	 *
+	 * This function is optional.
+	 */
+	int (*sro_install)(struct drm_panel *panel);
 };
 
 struct drm_panel_follower_funcs {
-- 
2.43.0


  parent reply	other threads:[~2026-11-22 15:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 15:30 [RFC PATCH 0/8] drm: State readout for the i.MX8MN display pipeline Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 1/8] drm/bridge: Add atomic_sro_install_state hook Dario Binacchi
2026-11-22 15:30 ` Dario Binacchi [this message]
2026-11-22 15:30 ` [RFC PATCH 3/8] drm/mxsfb: Use the bridge connector Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 4/8] drm/mxsfb: Switch to drm_mode_config_create_initial_state() Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 5/8] drm/mxsfb: Stop the controller in hw_reset Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 6/8] drm/mxsfb: Implement hw state readout Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 7/8] drm/bridge: samsung-dsim: " Dario Binacchi
2026-11-22 15:30 ` [RFC PATCH 8/8] drm/panel: synaptics-r63353: Support " 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=20261122153032.2782768-3-dario.binacchi@amarulasolutions.com \
    --to=dario.binacchi@amarulasolutions.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=michael@amarulasolutions.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.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®