[PATCH 25/37] drm/bridge: shutdown and cleanup on bridge unplug
Maxime Ripard
mripard at kernel.org
Mon Jun 8 05:07:16 PDT 2026
Hi,
On Tue, May 19, 2026 at 12:37:42PM +0200, Luca Ceresoli wrote:
> With the upcoming support for DRM bridge hot(un)plugging, bridges can be
> removed at any time withotu tearing down the entire card. When this
> happens, shutdown the pipeline and detach from the encoder chain the bridge
> being removed along with all the following ones.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli at bootlin.com>
> ---
> drivers/gpu/drm/drm_bridge.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
> index 7f2d1a81d730..d45fb74ec8c2 100644
> --- a/drivers/gpu/drm/drm_bridge.c
> +++ b/drivers/gpu/drm/drm_bridge.c
> @@ -462,9 +462,17 @@ EXPORT_SYMBOL(devm_drm_bridge_add);
> * it won't be found by users via of_drm_find_and_get_bridge(), and add it
> * to the lingering bridge list, to keep track of it until its allocated
> * memory is eventually freed.
> + *
> + * If the bridge is attached, also disable the active output and detach
> + * this bridge and the following ones.
> */
> void drm_bridge_remove(struct drm_bridge *bridge)
> {
> + if (bridge->encoder) {
> + drm_atomic_shutdown(bridge->dev);
> + drm_encoder_cleanup_from(bridge->encoder, bridge);
> + }
> +
> mutex_lock(&bridge_lock);
> list_move_tail(&bridge->list, &bridge_lingering_list);
> mutex_unlock(&bridge_lock);
I don't think this makes a lot of sense to disable the whole device at
once. The connector, encoder, and the CRTC might, but the whole device
doesn't.
Even then, I'm not sure we should disable anything. How does DP-MST
handles removal?
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260608/60545366/attachment.sig>
More information about the linux-arm-kernel
mailing list