]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/bridge: add support for refcounting
authorLuca Ceresoli <luca.ceresoli@bootlin.com>
Wed, 26 Mar 2025 17:47:36 +0000 (18:47 +0100)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Mon, 7 Apr 2025 09:38:04 +0000 (11:38 +0200)
commit30d1b37d4c022b5e6c164c090a60a3be1a66876e
treea2ae4c064d59d7a6d996a639319237588172ace0
parent0cc6aadd7fc1e629b715ea3d1ba537ef2da95eec
drm/bridge: add support for refcounting

DRM bridges are currently considered as a fixed element of a DRM card, and
thus their lifetime is assumed to extend for as long as the card
exists. New use cases, such as hot-pluggable hardware with video bridges,
require DRM bridges to be added to and removed from a DRM card without
tearing the card down. This is possible for connectors already (used by DP
MST), it is now needed for DRM bridges as well.

As a first preliminary step, make bridges reference-counted to allow a
struct drm_bridge (along with the private driver structure embedding it) to
stay allocated even after the driver has been removed, until the last
reference is put.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250326-drm-bridge-refcount-v9-2-5e0661fe1f84@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/drm_bridge.c
include/drm/drm_bridge.h