mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Cc: michael@amarulasolutions.com, linux-amarula@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: Re: [RFC PATCH 2/8] drm/panel: Add sro_install hook
Date: Mon, 23 Nov 2026 11:58:04 +0100	[thread overview]
Message-ID: <awQb7eQd6P7NatX4@houat> (raw)
In-Reply-To: <20261122153032.2782768-3-dario.binacchi@amarulasolutions.com>

[-- Attachment #1: Type: text/plain, Size: 2912 bytes --]

Hi,

On Sun, Nov 22, 2026 at 04:30:02PM +0100, Dario Binacchi wrote:
> 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);

In the panel context, I'm not sure "install" is the better word here
since we don't have any state to install in the first place.
"sro_enable_resources" maybe?

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2026-11-23 10:58 UTC|newest]

Thread overview: 13+ 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-23 10:45   ` Maxime Ripard
2026-11-22 15:30 ` [RFC PATCH 2/8] drm/panel: Add sro_install hook Dario Binacchi
2026-11-23 10:58   ` Maxime Ripard [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-23 10:54   ` Maxime Ripard
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-23 11:07   ` Maxime Ripard
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=awQb7eQd6P7NatX4@houat \
    --to=mripard@kernel.org \
    --cc=airlied@gmail.com \
    --cc=dario.binacchi@amarulasolutions.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=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®