All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: "Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Hervé Codina" <herve.codina@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-doc@vger.kernel.org,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Paul Kocialkowski" <contact@paulk.fr>,
	dri-devel@lists.freedesktop.org,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"David Airlie" <airlied@gmail.com>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Robert Foss" <rfoss@kernel.org>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Daniel Thompson" <danielt@kernel.org>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Jessica Zhang" <quic_jesszhan@quicinc.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Will Deacon" <will@kernel.org>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Inki Dae" <inki.dae@samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Boris Brezillon" <bbrezillon@kernel.org>,
	linux-kernel@vger.kernel.org,
	"Paul Kocialkowski" <paul.kocialkowski@bootlin.com>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Shawn Guo" <shawnguo@kernel.org>
Subject: Re: [PATCH v6 13/26] drm/encoder: add drm_encoder_cleanup_from()
Date: Fri, 7 Feb 2025 09:53:18 +0100	[thread overview]
Message-ID: <20250207095318.2fc8d54e@booty> (raw)
In-Reply-To: <spxzxwcs27uv2ttt5mh3r2767ihczvzzrtov6afdmex2ye7lam@r6kdqv5ocg5h>

On Fri, 7 Feb 2025 05:03:13 +0200
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:

> On Thu, Feb 06, 2025 at 07:14:28PM +0100, Luca Ceresoli wrote:
> > Supporting hardware whose final part of the DRM pipeline can be physically
> > removed requires the ability to detach all bridges from a given point to
> > the end of the pipeline.
> > 
> > Introduce a variant of drm_encoder_cleanup() for this.
> > 
> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > 
> > ---
> > 
> > Changes in v6: none
> > Changes in v5: none
> > Changes in v4: none
> > Changes in v3: none
> > 
> > Changed in v2:
> >  - fix a typo in a comment
> > ---
> >  drivers/gpu/drm/drm_encoder.c | 21 +++++++++++++++++++++
> >  include/drm/drm_encoder.h     |  1 +
> >  2 files changed, 22 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c
> > index 8f2bc6a28482229fd0b030a1958f87753ad7885f..472dfbefe2960924a4e83bec425af8c7ef5f5265 100644
> > --- a/drivers/gpu/drm/drm_encoder.c
> > +++ b/drivers/gpu/drm/drm_encoder.c
> > @@ -207,6 +207,27 @@ void drm_encoder_cleanup(struct drm_encoder *encoder)
> >  }
> >  EXPORT_SYMBOL(drm_encoder_cleanup);
> >  
> > +/**
> > + * drm_encoder_cleanup_from - remove a given bridge and all the following
> > + * @encoder: encoder whole list of bridges shall be pruned
> > + * @bridge: first bridge to remove
> > + *
> > + * Removes from an encoder all the bridges starting with a given bridge
> > + * and until the end of the chain.
> > + *
> > + * This should not be used in "normal" DRM pipelines. It is only useful for
> > + * devices whose final part of the DRM chain can be physically removed and
> > + * later reconnected (possibly with different hardware).
> > + */
> > +void drm_encoder_cleanup_from(struct drm_encoder *encoder, struct drm_bridge *bridge)
> > +{
> > +	struct drm_bridge *next;
> > +
> > +	list_for_each_entry_safe_from(bridge, next, &encoder->bridge_chain, chain_node)
> > +		drm_bridge_detach(bridge);
> > +}
> > +EXPORT_SYMBOL(drm_encoder_cleanup_from);  
> 
> Shouldn't drm_encoder_cleanup() also use this function?

Sure. I'll do it in v7.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


WARNING: multiple messages have this Message-ID (diff)
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: "Simona Vetter" <simona@ffwll.ch>,
	"Inki Dae" <inki.dae@samsung.com>,
	"Jagan Teki" <jagan@amarulasolutions.com>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Catalin Marinas" <catalin.marinas@arm.com>,
	"Will Deacon" <will@kernel.org>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Daniel Thompson" <danielt@kernel.org>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Jonathan Corbet" <corbet@lwn.net>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Boris Brezillon" <bbrezillon@kernel.org>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Jessica Zhang" <quic_jesszhan@quicinc.com>,
	"Paul Kocialkowski" <contact@paulk.fr>,
	"Maxime Ripard" <mripard@kernel.org>,
	"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>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Hervé Codina" <herve.codina@bootlin.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	"Paul Kocialkowski" <paul.kocialkowski@bootlin.com>
Subject: Re: [PATCH v6 13/26] drm/encoder: add drm_encoder_cleanup_from()
Date: Fri, 7 Feb 2025 09:53:18 +0100	[thread overview]
Message-ID: <20250207095318.2fc8d54e@booty> (raw)
In-Reply-To: <spxzxwcs27uv2ttt5mh3r2767ihczvzzrtov6afdmex2ye7lam@r6kdqv5ocg5h>

On Fri, 7 Feb 2025 05:03:13 +0200
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> wrote:

> On Thu, Feb 06, 2025 at 07:14:28PM +0100, Luca Ceresoli wrote:
> > Supporting hardware whose final part of the DRM pipeline can be physically
> > removed requires the ability to detach all bridges from a given point to
> > the end of the pipeline.
> > 
> > Introduce a variant of drm_encoder_cleanup() for this.
> > 
> > Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > 
> > ---
> > 
> > Changes in v6: none
> > Changes in v5: none
> > Changes in v4: none
> > Changes in v3: none
> > 
> > Changed in v2:
> >  - fix a typo in a comment
> > ---
> >  drivers/gpu/drm/drm_encoder.c | 21 +++++++++++++++++++++
> >  include/drm/drm_encoder.h     |  1 +
> >  2 files changed, 22 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c
> > index 8f2bc6a28482229fd0b030a1958f87753ad7885f..472dfbefe2960924a4e83bec425af8c7ef5f5265 100644
> > --- a/drivers/gpu/drm/drm_encoder.c
> > +++ b/drivers/gpu/drm/drm_encoder.c
> > @@ -207,6 +207,27 @@ void drm_encoder_cleanup(struct drm_encoder *encoder)
> >  }
> >  EXPORT_SYMBOL(drm_encoder_cleanup);
> >  
> > +/**
> > + * drm_encoder_cleanup_from - remove a given bridge and all the following
> > + * @encoder: encoder whole list of bridges shall be pruned
> > + * @bridge: first bridge to remove
> > + *
> > + * Removes from an encoder all the bridges starting with a given bridge
> > + * and until the end of the chain.
> > + *
> > + * This should not be used in "normal" DRM pipelines. It is only useful for
> > + * devices whose final part of the DRM chain can be physically removed and
> > + * later reconnected (possibly with different hardware).
> > + */
> > +void drm_encoder_cleanup_from(struct drm_encoder *encoder, struct drm_bridge *bridge)
> > +{
> > +	struct drm_bridge *next;
> > +
> > +	list_for_each_entry_safe_from(bridge, next, &encoder->bridge_chain, chain_node)
> > +		drm_bridge_detach(bridge);
> > +}
> > +EXPORT_SYMBOL(drm_encoder_cleanup_from);  
> 
> Shouldn't drm_encoder_cleanup() also use this function?

Sure. I'll do it in v7.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2025-02-07  8:58 UTC|newest]

Thread overview: 131+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-06 18:14 [PATCH v6 00/26] Add support for hot-pluggable DRM bridges Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 01/26] drm/debugfs: fix printk format for bridge index Luca Ceresoli
2025-02-07  2:06   ` Dmitry Baryshkov
2025-02-07  2:06     ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 02/26] drm: of: drm_of_find_panel_or_bridge: move misplaced comment Luca Ceresoli
2025-02-07  2:20   ` Dmitry Baryshkov
2025-02-07  2:20     ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 03/26] drm/bridge: panel: use drm_bridge_is_panel() instead of open code Luca Ceresoli
2025-02-07  2:21   ` Dmitry Baryshkov
2025-02-07  2:21     ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 04/26] drm/bridge: panel: drm_panel_bridge_remove: warn when called on non-panel bridge Luca Ceresoli
2025-02-07  2:22   ` Dmitry Baryshkov
2025-02-07  2:22     ` Dmitry Baryshkov
2025-02-07  8:59     ` Luca Ceresoli
2025-02-07  8:59       ` Luca Ceresoli
2025-02-07  7:25   ` Maxime Ripard
2025-02-07  7:25     ` Maxime Ripard
2025-02-06 18:14 ` [PATCH v6 05/26] drm/debugfs: add top-level 'bridges' file showing all added bridges Luca Ceresoli
2025-02-07  2:41   ` Dmitry Baryshkov
2025-02-07  2:41     ` Dmitry Baryshkov
2025-02-07  8:54     ` Luca Ceresoli
2025-02-07  8:54       ` Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 06/26] drm/panel: move all code into bridge/panel.c Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 07/26] drm/bridge: panel: forbid initializing a panel with unknown connector type Luca Ceresoli
2025-02-07  2:44   ` Dmitry Baryshkov
2025-02-07  2:44     ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 08/26] drm/bridge: panel: add a panel_bridge to every panel Luca Ceresoli
2025-02-07  2:49   ` Dmitry Baryshkov
2025-02-07  2:49     ` Dmitry Baryshkov
2025-02-07  8:54     ` Luca Ceresoli
2025-02-07  8:54       ` Luca Ceresoli
2025-02-07 19:43       ` Dmitry Baryshkov
2025-02-07 19:43         ` Dmitry Baryshkov
2025-02-10 17:11         ` Luca Ceresoli
2025-02-10 17:11           ` Luca Ceresoli
2025-02-10 18:34   ` Maxime Ripard
2025-02-10 18:34     ` Maxime Ripard
2025-02-18  9:43     ` Chen-Yu Tsai
2025-02-18  9:43       ` Chen-Yu Tsai
2025-02-18 10:17       ` Maxime Ripard
2025-02-18 10:17         ` Maxime Ripard
2025-02-06 18:14 ` [PATCH v6 09/26] drm/bridge: move devm_drm_of_get_bridge and drmm_of_get_bridge to drm_bridge.c Luca Ceresoli
2025-02-07  2:52   ` Dmitry Baryshkov
2025-02-07  2:52     ` Dmitry Baryshkov
2025-02-07  8:54     ` Luca Ceresoli
2025-02-07  8:54       ` Luca Ceresoli
2025-02-07 19:47       ` Dmitry Baryshkov
2025-02-07 19:47         ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 10/26] drm/bridge: add devm_drm_of_get_bridge_by_node() Luca Ceresoli
2025-02-07  2:53   ` Dmitry Baryshkov
2025-02-07  2:53     ` Dmitry Baryshkov
2025-02-07  8:54     ` Luca Ceresoli
2025-02-07  8:54       ` Luca Ceresoli
2025-02-10 18:22   ` Maxime Ripard
2025-02-10 18:22     ` Maxime Ripard
2025-02-06 18:14 ` [PATCH v6 11/26] drm/bridge: samsung-dsim: use devm_drm_of_get_bridge[_by_node] to find the out_bridge Luca Ceresoli
2025-02-07  2:55   ` Dmitry Baryshkov
2025-02-07  2:55     ` Dmitry Baryshkov
2025-02-07  8:54     ` Luca Ceresoli
2025-02-07  8:54       ` Luca Ceresoli
2025-02-10 18:23   ` Maxime Ripard
2025-02-10 18:23     ` Maxime Ripard
2025-02-06 18:14 ` [PATCH v6 12/26] drm/bridge: allow bridges to be informed about added and removed bridges Luca Ceresoli
2025-02-07  3:01   ` Dmitry Baryshkov
2025-02-07  3:01     ` Dmitry Baryshkov
2025-02-06 18:14 ` [PATCH v6 13/26] drm/encoder: add drm_encoder_cleanup_from() Luca Ceresoli
2025-02-07  3:03   ` Dmitry Baryshkov
2025-02-07  3:03     ` Dmitry Baryshkov
2025-02-07  8:53     ` Luca Ceresoli [this message]
2025-02-07  8:53       ` Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 14/26] drm/bridge: add support for refcounted DRM bridges Luca Ceresoli
2025-02-07 11:47   ` Maxime Ripard
2025-02-07 11:47     ` Maxime Ripard
2025-02-07 19:54     ` Dmitry Baryshkov
2025-02-07 19:54       ` Dmitry Baryshkov
2025-02-10 12:31       ` Maxime Ripard
2025-02-10 12:31         ` Maxime Ripard
2025-02-10 14:23         ` Dmitry Baryshkov
2025-02-10 14:23           ` Dmitry Baryshkov
2025-02-10 17:12           ` Luca Ceresoli
2025-02-10 17:12             ` Luca Ceresoli
2025-02-10 18:16             ` Maxime Ripard
2025-02-10 18:16               ` Maxime Ripard
2025-02-10 18:17           ` Maxime Ripard
2025-02-10 18:17             ` Maxime Ripard
2025-02-10 17:12       ` Luca Ceresoli
2025-02-10 17:12         ` Luca Ceresoli
2025-02-10 23:14         ` Dmitry Baryshkov
2025-02-10 23:14           ` Dmitry Baryshkov
2025-02-11  8:48           ` Maxime Ripard
2025-02-11  8:48             ` Maxime Ripard
2025-02-12  0:55             ` Dmitry Baryshkov
2025-02-12  0:55               ` Dmitry Baryshkov
2025-02-12 10:08               ` Maxime Ripard
2025-02-12 10:08                 ` Maxime Ripard
2025-02-10 17:12     ` Luca Ceresoli
2025-02-10 17:12       ` Luca Ceresoli
2025-02-11 13:10       ` Maxime Ripard
2025-02-11 13:10         ` Maxime Ripard
2025-02-26 14:28         ` Luca Ceresoli
2025-02-26 14:28           ` Luca Ceresoli
2025-02-27  9:32           ` Maxime Ripard
2025-02-27  9:32             ` Maxime Ripard
2025-02-27 11:31             ` Luca Ceresoli
2025-02-27 11:31               ` Luca Ceresoli
2025-02-27 14:39               ` Maxime Ripard
2025-02-27 14:39                 ` Maxime Ripard
2025-03-13 11:56     ` Luca Ceresoli
2025-03-13 18:07       ` Maxime Ripard
2025-03-14  8:11         ` Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 15/26] drm/bridge: devm_drm_of_get_bridge and drmm_of_get_bridge: automatically put the bridge Luca Ceresoli
2025-02-07  3:17   ` Dmitry Baryshkov
2025-02-07  3:17     ` Dmitry Baryshkov
2025-02-07 10:44     ` Luca Ceresoli
2025-02-07 10:44       ` Luca Ceresoli
2025-02-07 19:57       ` Dmitry Baryshkov
2025-02-07 19:57         ` Dmitry Baryshkov
2025-02-10 18:00         ` Luca Ceresoli
2025-02-10 18:00           ` Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 16/26] drm/bridge: increment refcount in of_drm_find_bridge() Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 17/26] drm/bridge: add devm_drm_put_bridge() and devm_drm_put_and_clear_bridge() Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 18/26] drm/bridge: add documentation of refcounted bridges Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 19/26] drm/tests: bridge: add KUnit tests for DRM bridges (init and destroy) Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 20/26] drm/debugfs: bridges_show: show refcount Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 21/26] drm/bridge: add list of removed refcounted bridges Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 22/26] drm/debugfs: show removed bridges Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 23/26] drm/bridge: samsung-dsim: use refcounting for the out_bridge Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 24/26] drm/bridge: panel: use dynamic lifetime management Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 25/26] drm/bridge: ti-sn65dsi83: " Luca Ceresoli
2025-02-06 18:14 ` [PATCH v6 26/26] drm/bridge: hotplug-bridge: add driver to support hot-pluggable DSI bridges Luca Ceresoli
2025-02-07  9:01 ` [PATCH v6 00/26] Add support for hot-pluggable DRM bridges Luca Ceresoli

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=20250207095318.2fc8d54e@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrzej.hajda@intel.com \
    --cc=bbrezillon@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=contact@paulk.fr \
    --cc=corbet@lwn.net \
    --cc=danielt@kernel.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=festevam@gmail.com \
    --cc=herve.codina@bootlin.com \
    --cc=inki.dae@samsung.com \
    --cc=jagan@amarulasolutions.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=quic_jesszhan@quicinc.com \
    --cc=rfoss@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sam@ravnborg.org \
    --cc=shawnguo@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.