[PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector

Luca Ceresoli posted 41 patches 1 month, 3 weeks ago
drivers/gpu/drm/adp/adp_drv.c                     |  2 --
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c      |  2 --
drivers/gpu/drm/bridge/ite-it6263.c               |  2 --
drivers/gpu/drm/bridge/ti-sn65dsi86.c             |  2 --
drivers/gpu/drm/display/drm_bridge_connector.c    | 11 +++++++++--
drivers/gpu/drm/exynos/exynos_dp.c                |  2 +-
drivers/gpu/drm/imx/dc/dc-kms.c                   |  8 +-------
drivers/gpu/drm/imx/dcss/dcss-kms.c               |  2 --
drivers/gpu/drm/imx/ipuv3/imx-ldb.c               |  2 --
drivers/gpu/drm/imx/ipuv3/parallel-display.c      |  2 --
drivers/gpu/drm/imx/lcdc/imx-lcdc.c               |  2 --
drivers/gpu/drm/ingenic/ingenic-drm-drv.c         |  2 --
drivers/gpu/drm/kmb/kmb_dsi.c                     |  2 +-
drivers/gpu/drm/mediatek/mtk_dpi.c                |  1 -
drivers/gpu/drm/mediatek/mtk_dsi.c                |  1 -
drivers/gpu/drm/meson/meson_encoder_cvbs.c        |  2 --
drivers/gpu/drm/meson/meson_encoder_hdmi.c        |  2 --
drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c          |  7 -------
drivers/gpu/drm/msm/dp/dp_drm.c                   |  2 --
drivers/gpu/drm/msm/dsi/dsi_manager.c             |  4 ----
drivers/gpu/drm/msm/hdmi/hdmi.c                   |  2 --
drivers/gpu/drm/mxsfb/lcdif_drv.c                 |  6 ------
drivers/gpu/drm/omapdrm/omap_drv.c                |  2 --
drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c |  2 +-
drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  2 +-
drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 16 +++++++---------
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c   |  2 +-
drivers/gpu/drm/rockchip/cdn-dp-core.c            |  2 --
drivers/gpu/drm/rockchip/dw_dp-rockchip.c         |  2 +-
drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c    |  2 +-
drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c     |  2 +-
drivers/gpu/drm/rockchip/rk3066_hdmi.c            |  2 --
drivers/gpu/drm/rockchip/rockchip_lvds.c          |  6 ------
drivers/gpu/drm/rockchip/rockchip_rgb.c           |  9 ---------
drivers/gpu/drm/tegra/hdmi.c                      |  2 --
drivers/gpu/drm/tegra/rgb.c                       |  2 --
drivers/gpu/drm/tests/drm_bridge_test.c           |  2 --
drivers/gpu/drm/tidss/tidss_encoder.c             |  6 ------
drivers/gpu/drm/tilcdc/tilcdc_encoder.c           |  6 ------
drivers/gpu/drm/verisilicon/vs_bridge.c           |  1 -
drivers/gpu/drm/xlnx/zynqmp_kms.c                 |  6 ------
41 files changed, 25 insertions(+), 117 deletions(-)
[PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Luca Ceresoli 1 month, 3 weeks ago
This series simplifies using the bridge-connector by removing the need to
attach the newly created connector to the encoder.

== Series description

Currently all users of the bridge-connector must call
drm_connector_attach_encoder() immediately after a successful
drm_bridge_connector_init().

This is an unnecessary burden for users. Move the call to the end of
drm_bridge_connector_init() so all callers can be simplified.

 * Patch 1 adds a drm_connector_attach_encoder() call at the end of
   drm_bridge_connector_init()
 * The other patches remove drm_connector_attach_encoder() after all
   drm_bridge_connector_init() calls, ordered from the simplest ones
   (only the last one is somewhat non-obvious)

The Cc list is huge due to the many drivers touched. I sent v1 to a reduced
Cc list to ensure there is an agreement about the overall idea. That seems
to be the case, so now it's time to copy all drivers maintainers.

It would be nice to apply all of this series at once to avoid duplicated
calls to drm_connector_attach_encoder() in the interim. That would be
harmless beacuse drm_connector_attach_encoder() is idempotent, but
unpleasant.

== Additional rationale (for the curious)

Besides making the usage of the bridge-connector a bit simpler, this series
is in preparation for DRM bridge hotplug. Here's why, feel free to skip if
you don't care.

The old bridge hotplug proposals I have sent in the past [1] were based on
a hotplug-bridge driver to sit between the last fixed bridge and the first
hotplugged bridge. Discussion with the community led to the need of
removing the hotplug-bridge and let common DRM code handle hotplug. The
common place of code that appears the most suitable for hotplug handling is
the bridge-connector, which is by now the recommended way to handle
connector instantiation after a bridge chain.

So I'm in the process of extending the bridge-connector to be the central
point to handle bridge hotplug. Turns out the need to call
drm_connector_attach_encoder() after drm_bridge_connector_init() has
returned is adding big headaches to such work. So I'm send this long but
simple series to both simplify bridge-connector usage and remove one
obstacle from the bridge hotplug work. This series is relevant by itself
anyway.

[1] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-26-9d6f2c9c3058@bootlin.com/

== Grand plan

This is part of the work to support hotplug of DRM bridges. The grand plan
was discussed in [0].

Here's the work breakdown (➜ marks the current series):

 1. … add refcounting to DRM bridges struct drm_bridge,
      based on devm_drm_bridge_alloc()
    A. ✔ add new alloc API and refcounting (v6.16)
    B. ✔ convert all bridge drivers to new API (v6.17)
    C. ✔ kunit tests (v6.17)
    D. ✔ add get/put to drm_bridge_add/remove() + attach/detach()
         and warn on old allocation pattern (v6.17)
    E. … add get/put on drm_bridge accessors
       1. ✔ drm_bridge_chain_get_first_bridge(), add cleanup action (v6.18)
       2. ✔ drm_bridge_get_prev_bridge() (v6.18)
       3. ✔ drm_bridge_get_next_bridge() (v6.19)
       4. ✔ drm_for_each_bridge_in_chain() (v6.19)
       5. ✔ drm_bridge_connector_init (v6.19)
       6. ✔ protect encoder bridge chain with a mutex (v7.2)
       7. … of_drm_find_bridge
          a. ✔ add of_drm_get_bridge() (v7.0),
	       convert basic direct users (v7.0-v7.1)
	  b. ✔ convert direct of_drm_get_bridge() users, part 2 (v7.0)
	  c. ✔ convert direct of_drm_get_bridge() users, part 3 (v7.0)
	  d. ✔ convert direct of_drm_get_bridge() users, part 4 (v7.1-v7.2)
	  e. … convert bridge-only drm_of_find_panel_or_bridge() users
       8. drm_of_find_panel_or_bridge, *_of_get_bridge
       9. ✔ enforce drm_bridge_add before drm_bridge_attach (v6.19)
    F. ✔ debugfs improvements
       1. ✔ add top-level 'bridges' file (v6.16)
       2. ✔ show refcount and list lingering bridges (v6.19)
 2. … handle gracefully atomic updates during bridge removal
    A. ✔ Add drm_bridge_enter/exit() to protect device resources (v7.0)
    B. … protect private_obj removal from list
    C. ✔ Add drm_bridge_clear_and_put() (v7.1)
 3. … DSI host-device driver interaction
 4. ✔ removing the need for the "always-disconnected" connector
 5. ✔ Migrate i.MX LCDIF driver to bridge-connector (v7.2)
 6. ➜ DRM bridge hotplug
    A. ➜ Bridge hotplug management in the DRM core
       1. ➜ bridge-connector: attach encoder to the connector
    B.   Device tree description

[0] https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3058@bootlin.com/#t

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- patch 1: update kdoc
- patch 41: fix by rewriting it fully
- update cover letter
- Link to v1: https://patch.msgid.link/20260417-drm-bridge-connector-attach_encoder-v1-0-67b8b8fb872a@bootlin.com

To: Andrzej Hajda <andrzej.hajda@intel.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Robert Foss <rfoss@kernel.org>
To: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
To: Jonas Karlman <jonas@kwiboo.se>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Simona Vetter <simona@ffwll.ch>
To: Sasha Finkelstein <fnkl.kernel@gmail.com>
To: Janne Grunau <j@jannau.net>
To: Liu Ying <victor.liu@nxp.com>
To: Douglas Anderson <dianders@chromium.org>
To: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
To: Lucas Stach <l.stach@pengutronix.de>
To: Frank Li <Frank.Li@nxp.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
To: Pengutronix Kernel Team <kernel@pengutronix.de>
To: Fabio Estevam <festevam@gmail.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
To: Paul Cercueil <paul@crapouillou.net>
To: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
To: Matthias Brugger <matthias.bgg@gmail.com>
To: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Kevin Hilman <khilman@baylibre.com>
To: Jerome Brunet <jbrunet@baylibre.com>
To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
To: Rob Clark <robin.clark@oss.qualcomm.com>
To: Dmitry Baryshkov <lumag@kernel.org>
To: Abhinav Kumar <abhinav.kumar@linux.dev>
To: Jessica Zhang <jesszhan0024@gmail.com>
To: Sean Paul <sean@poorly.run>
To: Marijn Suijten <marijn.suijten@somainline.org>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Sandy Huang <hjc@rock-chips.com>
To: Heiko Stübner <heiko@sntech.de>
To: Andy Yan <andy.yan@rock-chips.com>
To: Thierry Reding <thierry.reding@gmail.com>
To: Mikko Perttunen <mperttunen@nvidia.com>
To: Jonathan Hunter <jonathanh@nvidia.com>
To: Icenowy Zheng <zhengxingda@iscas.ac.cn>
To: Jingoo Han <jingoohan1@gmail.com>
To: Inki Dae <inki.dae@samsung.com>
To: Seung-Woo Kim <sw0312.kim@samsung.com>
To: Kyungmin Park <kyungmin.park@samsung.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
To: Alim Akhtar <alim.akhtar@samsung.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
To: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Geert Uytterhoeven <geert+renesas@glider.be>
To: Magnus Damm <magnus.damm@gmail.com>
To: Biju Das <biju.das.jz@bp.renesas.com>
To: Marek Vasut <marex@denx.de>
To: Stefan Agner <stefan@agner.ch>
To: Jyri Sarha <jyri.sarha@iki.fi>
To: Michal Simek <michal.simek@amd.com>
Cc: Hui Pu <Hui.Pu@gehealthcare.com>
Cc: Ian Ray <ian.ray@gehealthcare.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Cc: asahi@lists.linux.dev
Cc: imx@lists.linux.dev
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mips@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org
Cc: linux-tegra@vger.kernel.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org

---
Luca Ceresoli (41):
      drm/display: bridge-connector: attach the encoder to the created connector
      drm: adp: remove now-redundant call to drm_connector_attach_encoder()
      drm/bridge: adv7511: remove now-redundant call to drm_connector_attach_encoder()
      drm/bridge: ite-it6263: remove now-redundant call to drm_connector_attach_encoder()
      drm/bridge: ti-sn65dsi86: remove now-redundant call to drm_connector_attach_encoder()
      drm/imx/dcss: remove now-redundant call to drm_connector_attach_encoder()
      drm/imx: ldb: remove now-redundant call to drm_connector_attach_encoder()
      drm/imx: parallel-display: remove now-redundant call to drm_connector_attach_encoder()
      drm/imx/lcdc: remove now-redundant call to drm_connector_attach_encoder()
      drm/ingenic: remove now-redundant call to drm_connector_attach_encoder()
      drm/kmb/dsi: remove now-redundant call to drm_connector_attach_encoder()
      drm/mediatek: mtk_dpi: remove now-redundant call to drm_connector_attach_encoder()
      drm/mediatek: mtk_dsi: remove now-redundant call to drm_connector_attach_encoder()
      drm/meson: encoder_cvbs: remove now-redundant call to drm_connector_attach_encoder()
      drm/meson: encoder_hdmi: remove now-redundant call to drm_connector_attach_encoder()
      drm/msm/dp: remove now-redundant call to drm_connector_attach_encoder()
      drm/msm/hdmi: remove now-redundant call to drm_connector_attach_encoder()
      drm/omapdrm: remove now-redundant call to drm_connector_attach_encoder()
      rm/rockchip: cdn-dp: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: rk3066_hdmi: remove now-redundant call to drm_connector_attach_encoder()
      drm/tegra: hdmi: remove now-redundant call to drm_connector_attach_encoder()
      drm/tegra: rgb: remove now-redundant call to drm_connector_attach_encoder()
      drm/tests: bridge: remove now-redundant call to drm_connector_attach_encoder()
      drm: verisilicon: remove now-redundant call to drm_connector_attach_encoder()
      drm/exynos: exynos_dp: remove now-redundant call to drm_connector_attach_encoder()
      drm: rcar-du: encoder: remove now-redundant call to drm_connector_attach_encoder()
      drm: renesas: rz-du: rzg2l_du_encoder: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: analogix_dp: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: dw_dp: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: dw_hdmi_qp: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: inno-hdmi: remove now-redundant call to drm_connector_attach_encoder()
      drm/msm/mdp4: remove now-redundant call to drm_connector_attach_encoder()
      drm/msm/dsi: remove now-redundant call to drm_connector_attach_encoder()
      drm/mxsfb/lcdif: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: lvds: remove now-redundant call to drm_connector_attach_encoder()
      drm/tidss: remove now-redundant call to drm_connector_attach_encoder()
      drm/tilcdc: remove now-redundant call to drm_connector_attach_encoder()
      drm: zynqmp_kms: remove now-redundant call to drm_connector_attach_encoder()
      drm/imx: remove now-redundant call to drm_connector_attach_encoder()
      drm/rockchip: rgb: remove now-redundant call to drm_connector_attach_encoder()
      drm: renesas: shmobile: remove now-redundant call to drm_connector_attach_encoder()

 drivers/gpu/drm/adp/adp_drv.c                     |  2 --
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c      |  2 --
 drivers/gpu/drm/bridge/ite-it6263.c               |  2 --
 drivers/gpu/drm/bridge/ti-sn65dsi86.c             |  2 --
 drivers/gpu/drm/display/drm_bridge_connector.c    | 11 +++++++++--
 drivers/gpu/drm/exynos/exynos_dp.c                |  2 +-
 drivers/gpu/drm/imx/dc/dc-kms.c                   |  8 +-------
 drivers/gpu/drm/imx/dcss/dcss-kms.c               |  2 --
 drivers/gpu/drm/imx/ipuv3/imx-ldb.c               |  2 --
 drivers/gpu/drm/imx/ipuv3/parallel-display.c      |  2 --
 drivers/gpu/drm/imx/lcdc/imx-lcdc.c               |  2 --
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c         |  2 --
 drivers/gpu/drm/kmb/kmb_dsi.c                     |  2 +-
 drivers/gpu/drm/mediatek/mtk_dpi.c                |  1 -
 drivers/gpu/drm/mediatek/mtk_dsi.c                |  1 -
 drivers/gpu/drm/meson/meson_encoder_cvbs.c        |  2 --
 drivers/gpu/drm/meson/meson_encoder_hdmi.c        |  2 --
 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c          |  7 -------
 drivers/gpu/drm/msm/dp/dp_drm.c                   |  2 --
 drivers/gpu/drm/msm/dsi/dsi_manager.c             |  4 ----
 drivers/gpu/drm/msm/hdmi/hdmi.c                   |  2 --
 drivers/gpu/drm/mxsfb/lcdif_drv.c                 |  6 ------
 drivers/gpu/drm/omapdrm/omap_drv.c                |  2 --
 drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c |  2 +-
 drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  2 +-
 drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 16 +++++++---------
 drivers/gpu/drm/rockchip/analogix_dp-rockchip.c   |  2 +-
 drivers/gpu/drm/rockchip/cdn-dp-core.c            |  2 --
 drivers/gpu/drm/rockchip/dw_dp-rockchip.c         |  2 +-
 drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c    |  2 +-
 drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c     |  2 +-
 drivers/gpu/drm/rockchip/rk3066_hdmi.c            |  2 --
 drivers/gpu/drm/rockchip/rockchip_lvds.c          |  6 ------
 drivers/gpu/drm/rockchip/rockchip_rgb.c           |  9 ---------
 drivers/gpu/drm/tegra/hdmi.c                      |  2 --
 drivers/gpu/drm/tegra/rgb.c                       |  2 --
 drivers/gpu/drm/tests/drm_bridge_test.c           |  2 --
 drivers/gpu/drm/tidss/tidss_encoder.c             |  6 ------
 drivers/gpu/drm/tilcdc/tilcdc_encoder.c           |  6 ------
 drivers/gpu/drm/verisilicon/vs_bridge.c           |  1 -
 drivers/gpu/drm/xlnx/zynqmp_kms.c                 |  6 ------
 41 files changed, 25 insertions(+), 117 deletions(-)
---
base-commit: 77fec37c895fcbdefbcec97cefd6d1f5cfdf1e3a
change-id: 20260416-drm-bridge-connector-attach_encoder-c651ac05705f

Best regards,
--  
Luca Ceresoli <luca.ceresoli@bootlin.com>

Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Dmitry Baryshkov 1 month, 3 weeks ago
On Thu, Apr 23, 2026 at 11:16:54AM +0200, Luca Ceresoli wrote:
> This series simplifies using the bridge-connector by removing the need to
> attach the newly created connector to the encoder.
> 
> == Series description
> 
> Currently all users of the bridge-connector must call
> drm_connector_attach_encoder() immediately after a successful
> drm_bridge_connector_init().
> 
> This is an unnecessary burden for users. Move the call to the end of
> drm_bridge_connector_init() so all callers can be simplified.
> 

I don't know which one is more correct in this situation, but let it be
R-B for the series:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

Feel free to take the msm patches through drm-misc-next (A-b).

-- 
With best wishes
Dmitry
Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Luca Ceresoli 1 month, 3 weeks ago
On Thu Apr 23, 2026 at 2:45 PM CEST, Dmitry Baryshkov wrote:
> On Thu, Apr 23, 2026 at 11:16:54AM +0200, Luca Ceresoli wrote:
>> This series simplifies using the bridge-connector by removing the need to
>> attach the newly created connector to the encoder.
>>
>> == Series description
>>
>> Currently all users of the bridge-connector must call
>> drm_connector_attach_encoder() immediately after a successful
>> drm_bridge_connector_init().
>>
>> This is an unnecessary burden for users. Move the call to the end of
>> drm_bridge_connector_init() so all callers can be simplified.
>>
>
> I don't know which one is more correct in this situation, but let it be
> R-B for the series:
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>
> Feel free to take the msm patches through drm-misc-next (A-b).

Meaning: Acked-by on the msm patches + Reviewed-by on all the series,
right?

Thank you very much!

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Icenowy Zheng 1 month, 3 weeks ago
在 2026-04-23四的 11:16 +0200,Luca Ceresoli写道:
> This series simplifies using the bridge-connector by removing the
> need to
> attach the newly created connector to the encoder.
> 
> == Series description
> 
> Currently all users of the bridge-connector must call
> drm_connector_attach_encoder() immediately after a successful
> drm_bridge_connector_init().
> 
> This is an unnecessary burden for users. Move the call to the end of
> drm_bridge_connector_init() so all callers can be simplified.
> 
>  * Patch 1 adds a drm_connector_attach_encoder() call at the end of
>    drm_bridge_connector_init()
>  * The other patches remove drm_connector_attach_encoder() after all
>    drm_bridge_connector_init() calls, ordered from the simplest ones
>    (only the last one is somewhat non-obvious)
> 
> The Cc list is huge due to the many drivers touched. I sent v1 to a
> reduced
> Cc list to ensure there is an agreement about the overall idea. That
> seems
> to be the case, so now it's time to copy all drivers maintainers.
> 
> It would be nice to apply all of this series at once to avoid
> duplicated
> calls to drm_connector_attach_encoder() in the interim. That would be
> harmless beacuse drm_connector_attach_encoder() is idempotent, but
> unpleasant.
> 
> == Additional rationale (for the curious)
> 
> Besides making the usage of the bridge-connector a bit simpler, this
> series
> is in preparation for DRM bridge hotplug. Here's why, feel free to
> skip if
> you don't care.
> 
> The old bridge hotplug proposals I have sent in the past [1] were
> based on
> a hotplug-bridge driver to sit between the last fixed bridge and the
> first
> hotplugged bridge. Discussion with the community led to the need of
> removing the hotplug-bridge and let common DRM code handle hotplug.
> The
> common place of code that appears the most suitable for hotplug
> handling is
> the bridge-connector, which is by now the recommended way to handle
> connector instantiation after a bridge chain.
> 
> So I'm in the process of extending the bridge-connector to be the
> central
> point to handle bridge hotplug. Turns out the need to call
> drm_connector_attach_encoder() after drm_bridge_connector_init() has
> returned is adding big headaches to such work. So I'm send this long
> but
> simple series to both simplify bridge-connector usage and remove one
> obstacle from the bridge hotplug work. This series is relevant by
> itself
> anyway.
> 
> [1]
> https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-26-9d6f2c9c3058@bootlin.com/
> 
> == Grand plan
> 
> This is part of the work to support hotplug of DRM bridges. The grand
> plan
> was discussed in [0].

Just see the bridge hotplugging thing, is it possible for DRM drivers
to declare bridges attached to themselves after this?

Loongson 7A1000 PCH can only output DPI signals, so nearly all products
with it are shipping with some kind of external bridges, but currently
drm/loongson does not support them (all display connectors are now seen
as DPI ones, and connectors behind non-transparent bridges won't work).

The bridges are going to be accessed by the DDC I2C busses of 7A1000,
and are not declared with device tree (systems with 7A1000 never ship
with device trees, and Linux currently matches a built-in device tree).
(Bridges being on the DDC I2C also introduces some dependency for them
to depend on the drm/loongson driver.)

Loongson have defined some kind of VBIOS declaring what bridge is
behind, and their non-mainline driver just contains driver codes for
all possible bridges. (Sui Jingfeng previously tried to mainline such
practice, and of course it's rejected because of code duplicity.)

Thanks,
Icenowy

> 
> Here's the work breakdown (➜ marks the current series):
> 
>  1. … add refcounting to DRM bridges struct drm_bridge,
>       based on devm_drm_bridge_alloc()
>     A. ✔ add new alloc API and refcounting (v6.16)
>     B. ✔ convert all bridge drivers to new API (v6.17)
>     C. ✔ kunit tests (v6.17)
>     D. ✔ add get/put to drm_bridge_add/remove() + attach/detach()
>          and warn on old allocation pattern (v6.17)
>     E. … add get/put on drm_bridge accessors
>        1. ✔ drm_bridge_chain_get_first_bridge(), add cleanup action
> (v6.18)
>        2. ✔ drm_bridge_get_prev_bridge() (v6.18)
>        3. ✔ drm_bridge_get_next_bridge() (v6.19)
>        4. ✔ drm_for_each_bridge_in_chain() (v6.19)
>        5. ✔ drm_bridge_connector_init (v6.19)
>        6. ✔ protect encoder bridge chain with a mutex (v7.2)
>        7. … of_drm_find_bridge
>           a. ✔ add of_drm_get_bridge() (v7.0),
> 	       convert basic direct users (v7.0-v7.1)
> 	  b. ✔ convert direct of_drm_get_bridge() users, part 2
> (v7.0)
> 	  c. ✔ convert direct of_drm_get_bridge() users, part 3
> (v7.0)
> 	  d. ✔ convert direct of_drm_get_bridge() users, part 4
> (v7.1-v7.2)
> 	  e. … convert bridge-only drm_of_find_panel_or_bridge()
> users
>        8. drm_of_find_panel_or_bridge, *_of_get_bridge
>        9. ✔ enforce drm_bridge_add before drm_bridge_attach (v6.19)
>     F. ✔ debugfs improvements
>        1. ✔ add top-level 'bridges' file (v6.16)
>        2. ✔ show refcount and list lingering bridges (v6.19)
>  2. … handle gracefully atomic updates during bridge removal
>     A. ✔ Add drm_bridge_enter/exit() to protect device resources
> (v7.0)
>     B. … protect private_obj removal from list
>     C. ✔ Add drm_bridge_clear_and_put() (v7.1)
>  3. … DSI host-device driver interaction
>  4. ✔ removing the need for the "always-disconnected" connector
>  5. ✔ Migrate i.MX LCDIF driver to bridge-connector (v7.2)
>  6. ➜ DRM bridge hotplug
>     A. ➜ Bridge hotplug management in the DRM core
>        1. ➜ bridge-connector: attach encoder to the connector
>     B.   Device tree description
> 
> [0]
> https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-0-9d6f2c9c3058@bootlin.com/#t
> 
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
> Changes in v2:
> - patch 1: update kdoc
> - patch 41: fix by rewriting it fully
> - update cover letter
> - Link to v1:
> https://patch.msgid.link/20260417-drm-bridge-connector-attach_encoder-v1-0-67b8b8fb872a@bootlin.com
> 
> To: Andrzej Hajda <andrzej.hajda@intel.com>
> To: Neil Armstrong <neil.armstrong@linaro.org>
> To: Robert Foss <rfoss@kernel.org>
> To: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
> To: Jonas Karlman <jonas@kwiboo.se>
> To: Jernej Skrabec <jernej.skrabec@gmail.com>
> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> To: Maxime Ripard <mripard@kernel.org>
> To: Thomas Zimmermann <tzimmermann@suse.de>
> To: David Airlie <airlied@gmail.com>
> To: Simona Vetter <simona@ffwll.ch>
> To: Sasha Finkelstein <fnkl.kernel@gmail.com>
> To: Janne Grunau <j@jannau.net>
> To: Liu Ying <victor.liu@nxp.com>
> To: Douglas Anderson <dianders@chromium.org>
> To: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
> To: Lucas Stach <l.stach@pengutronix.de>
> To: Frank Li <Frank.Li@nxp.com>
> To: Sascha Hauer <s.hauer@pengutronix.de>
> To: Pengutronix Kernel Team <kernel@pengutronix.de>
> To: Fabio Estevam <festevam@gmail.com>
> To: Philipp Zabel <p.zabel@pengutronix.de>
> To: Paul Cercueil <paul@crapouillou.net>
> To: Anitha Chrisanthus <anitha.chrisanthus@intel.com>
> To: Chun-Kuang Hu <chunkuang.hu@kernel.org>
> To: Matthias Brugger <matthias.bgg@gmail.com>
> To: AngeloGioacchino Del Regno
> <angelogioacchino.delregno@collabora.com>
> To: Kevin Hilman <khilman@baylibre.com>
> To: Jerome Brunet <jbrunet@baylibre.com>
> To: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> To: Rob Clark <robin.clark@oss.qualcomm.com>
> To: Dmitry Baryshkov <lumag@kernel.org>
> To: Abhinav Kumar <abhinav.kumar@linux.dev>
> To: Jessica Zhang <jesszhan0024@gmail.com>
> To: Sean Paul <sean@poorly.run>
> To: Marijn Suijten <marijn.suijten@somainline.org>
> To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> To: Sandy Huang <hjc@rock-chips.com>
> To: Heiko Stübner <heiko@sntech.de>
> To: Andy Yan <andy.yan@rock-chips.com>
> To: Thierry Reding <thierry.reding@gmail.com>
> To: Mikko Perttunen <mperttunen@nvidia.com>
> To: Jonathan Hunter <jonathanh@nvidia.com>
> To: Icenowy Zheng <zhengxingda@iscas.ac.cn>
> To: Jingoo Han <jingoohan1@gmail.com>
> To: Inki Dae <inki.dae@samsung.com>
> To: Seung-Woo Kim <sw0312.kim@samsung.com>
> To: Kyungmin Park <kyungmin.park@samsung.com>
> To: Krzysztof Kozlowski <krzk@kernel.org>
> To: Alim Akhtar <alim.akhtar@samsung.com>
> To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> To: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
> To: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> To: Geert Uytterhoeven <geert+renesas@glider.be>
> To: Magnus Damm <magnus.damm@gmail.com>
> To: Biju Das <biju.das.jz@bp.renesas.com>
> To: Marek Vasut <marex@denx.de>
> To: Stefan Agner <stefan@agner.ch>
> To: Jyri Sarha <jyri.sarha@iki.fi>
> To: Michal Simek <michal.simek@amd.com>
> Cc: Hui Pu <Hui.Pu@gehealthcare.com>
> Cc: Ian Ray <ian.ray@gehealthcare.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-kernel@vger.kernel.org
> Cc: asahi@lists.linux.dev
> Cc: imx@lists.linux.dev
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-mips@vger.kernel.org
> Cc: linux-mediatek@lists.infradead.org
> Cc: linux-amlogic@lists.infradead.org
> Cc: linux-arm-msm@vger.kernel.org
> Cc: freedreno@lists.freedesktop.org
> Cc: linux-rockchip@lists.infradead.org
> Cc: linux-tegra@vger.kernel.org
> Cc: linux-samsung-soc@vger.kernel.org
> Cc: linux-renesas-soc@vger.kernel.org
> 
> ---
> Luca Ceresoli (41):
>       drm/display: bridge-connector: attach the encoder to the
> created connector
>       drm: adp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/bridge: adv7511: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/bridge: ite-it6263: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/bridge: ti-sn65dsi86: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/imx/dcss: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/imx: ldb: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/imx: parallel-display: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/imx/lcdc: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/ingenic: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/kmb/dsi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/mediatek: mtk_dpi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/mediatek: mtk_dsi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/meson: encoder_cvbs: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/meson: encoder_hdmi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/msm/dp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/msm/hdmi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/omapdrm: remove now-redundant call to
> drm_connector_attach_encoder()
>       rm/rockchip: cdn-dp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: rk3066_hdmi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/tegra: hdmi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/tegra: rgb: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/tests: bridge: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm: verisilicon: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/exynos: exynos_dp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm: rcar-du: encoder: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm: renesas: rz-du: rzg2l_du_encoder: remove now-redundant
> call to drm_connector_attach_encoder()
>       drm/rockchip: analogix_dp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: dw_dp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: dw_hdmi_qp: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: inno-hdmi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/msm/mdp4: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/msm/dsi: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/mxsfb/lcdif: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: lvds: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/tidss: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/tilcdc: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm: zynqmp_kms: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/imx: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm/rockchip: rgb: remove now-redundant call to
> drm_connector_attach_encoder()
>       drm: renesas: shmobile: remove now-redundant call to
> drm_connector_attach_encoder()
> 
>  drivers/gpu/drm/adp/adp_drv.c                     |  2 --
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c      |  2 --
>  drivers/gpu/drm/bridge/ite-it6263.c               |  2 --
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c             |  2 --
>  drivers/gpu/drm/display/drm_bridge_connector.c    | 11 +++++++++--
>  drivers/gpu/drm/exynos/exynos_dp.c                |  2 +-
>  drivers/gpu/drm/imx/dc/dc-kms.c                   |  8 +-------
>  drivers/gpu/drm/imx/dcss/dcss-kms.c               |  2 --
>  drivers/gpu/drm/imx/ipuv3/imx-ldb.c               |  2 --
>  drivers/gpu/drm/imx/ipuv3/parallel-display.c      |  2 --
>  drivers/gpu/drm/imx/lcdc/imx-lcdc.c               |  2 --
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c         |  2 --
>  drivers/gpu/drm/kmb/kmb_dsi.c                     |  2 +-
>  drivers/gpu/drm/mediatek/mtk_dpi.c                |  1 -
>  drivers/gpu/drm/mediatek/mtk_dsi.c                |  1 -
>  drivers/gpu/drm/meson/meson_encoder_cvbs.c        |  2 --
>  drivers/gpu/drm/meson/meson_encoder_hdmi.c        |  2 --
>  drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c          |  7 -------
>  drivers/gpu/drm/msm/dp/dp_drm.c                   |  2 --
>  drivers/gpu/drm/msm/dsi/dsi_manager.c             |  4 ----
>  drivers/gpu/drm/msm/hdmi/hdmi.c                   |  2 --
>  drivers/gpu/drm/mxsfb/lcdif_drv.c                 |  6 ------
>  drivers/gpu/drm/omapdrm/omap_drv.c                |  2 --
>  drivers/gpu/drm/renesas/rcar-du/rcar_du_encoder.c |  2 +-
>  drivers/gpu/drm/renesas/rz-du/rzg2l_du_encoder.c  |  2 +-
>  drivers/gpu/drm/renesas/shmobile/shmob_drm_crtc.c | 16 +++++++------
> ---
>  drivers/gpu/drm/rockchip/analogix_dp-rockchip.c   |  2 +-
>  drivers/gpu/drm/rockchip/cdn-dp-core.c            |  2 --
>  drivers/gpu/drm/rockchip/dw_dp-rockchip.c         |  2 +-
>  drivers/gpu/drm/rockchip/dw_hdmi_qp-rockchip.c    |  2 +-
>  drivers/gpu/drm/rockchip/inno_hdmi-rockchip.c     |  2 +-
>  drivers/gpu/drm/rockchip/rk3066_hdmi.c            |  2 --
>  drivers/gpu/drm/rockchip/rockchip_lvds.c          |  6 ------
>  drivers/gpu/drm/rockchip/rockchip_rgb.c           |  9 ---------
>  drivers/gpu/drm/tegra/hdmi.c                      |  2 --
>  drivers/gpu/drm/tegra/rgb.c                       |  2 --
>  drivers/gpu/drm/tests/drm_bridge_test.c           |  2 --
>  drivers/gpu/drm/tidss/tidss_encoder.c             |  6 ------
>  drivers/gpu/drm/tilcdc/tilcdc_encoder.c           |  6 ------
>  drivers/gpu/drm/verisilicon/vs_bridge.c           |  1 -
>  drivers/gpu/drm/xlnx/zynqmp_kms.c                 |  6 ------
>  41 files changed, 25 insertions(+), 117 deletions(-)
> ---
> base-commit: 77fec37c895fcbdefbcec97cefd6d1f5cfdf1e3a
> change-id: 20260416-drm-bridge-connector-attach_encoder-c651ac05705f
> 
> Best regards,
> --  
> Luca Ceresoli <luca.ceresoli@bootlin.com>
Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Luca Ceresoli 1 month, 2 weeks ago
Hello Icenowy,

On Sat Apr 25, 2026 at 5:22 PM CEST, Icenowy Zheng wrote:
> 在 2026-04-23四的 11:16 +0200,Luca Ceresoli写道:
>> This series simplifies using the bridge-connector by removing the
>> need to
>> attach the newly created connector to the encoder.
>>
>> == Series description
>>
>> Currently all users of the bridge-connector must call
>> drm_connector_attach_encoder() immediately after a successful
>> drm_bridge_connector_init().
>>
>> This is an unnecessary burden for users. Move the call to the end of
>> drm_bridge_connector_init() so all callers can be simplified.
>>
>>  * Patch 1 adds a drm_connector_attach_encoder() call at the end of
>>    drm_bridge_connector_init()
>>  * The other patches remove drm_connector_attach_encoder() after all
>>    drm_bridge_connector_init() calls, ordered from the simplest ones
>>    (only the last one is somewhat non-obvious)
>>
>> The Cc list is huge due to the many drivers touched. I sent v1 to a
>> reduced
>> Cc list to ensure there is an agreement about the overall idea. That
>> seems
>> to be the case, so now it's time to copy all drivers maintainers.
>>
>> It would be nice to apply all of this series at once to avoid
>> duplicated
>> calls to drm_connector_attach_encoder() in the interim. That would be
>> harmless beacuse drm_connector_attach_encoder() is idempotent, but
>> unpleasant.
>>
>> == Additional rationale (for the curious)
>>
>> Besides making the usage of the bridge-connector a bit simpler, this
>> series
>> is in preparation for DRM bridge hotplug. Here's why, feel free to
>> skip if
>> you don't care.
>>
>> The old bridge hotplug proposals I have sent in the past [1] were
>> based on
>> a hotplug-bridge driver to sit between the last fixed bridge and the
>> first
>> hotplugged bridge. Discussion with the community led to the need of
>> removing the hotplug-bridge and let common DRM code handle hotplug.
>> The
>> common place of code that appears the most suitable for hotplug
>> handling is
>> the bridge-connector, which is by now the recommended way to handle
>> connector instantiation after a bridge chain.
>>
>> So I'm in the process of extending the bridge-connector to be the
>> central
>> point to handle bridge hotplug. Turns out the need to call
>> drm_connector_attach_encoder() after drm_bridge_connector_init() has
>> returned is adding big headaches to such work. So I'm send this long
>> but
>> simple series to both simplify bridge-connector usage and remove one
>> obstacle from the bridge hotplug work. This series is relevant by
>> itself
>> anyway.
>>
>> [1]
>> https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-26-9d6f2c9c3058@bootlin.com/
>>
>> == Grand plan
>>
>> This is part of the work to support hotplug of DRM bridges. The grand
>> plan
>> was discussed in [0].
>
> Just see the bridge hotplugging thing, is it possible for DRM drivers
> to declare bridges attached to themselves after this?
>
> Loongson 7A1000 PCH can only output DPI signals, so nearly all products
> with it are shipping with some kind of external bridges, but currently
> drm/loongson does not support them (all display connectors are now seen
> as DPI ones, and connectors behind non-transparent bridges won't work).
>
> The bridges are going to be accessed by the DDC I2C busses of 7A1000,
> and are not declared with device tree (systems with 7A1000 never ship
> with device trees, and Linux currently matches a built-in device tree).
> (Bridges being on the DDC I2C also introduces some dependency for them
> to depend on the drm/loongson driver.)
>
> Loongson have defined some kind of VBIOS declaring what bridge is
> behind, and their non-mainline driver just contains driver codes for
> all possible bridges. (Sui Jingfeng previously tried to mainline such
> practice, and of course it's rejected because of code duplicity.)

I'm afraid your question goes a bit beyond my knowledge, the hotplug work
I'm carrying on is focuses on DT platforms.

My limited understading of non-DT platforms is that a card driver must
instantiate all components and tie them together, which assumes it has to
know them somehow (ACPI, hardcoded, whatever). Others can probably comment
better about this.

As a general principle, when devices can be mixed and matched by the board
designer, hardcoding them is a bad design choice. Think of bad old board
files written in C, which were unmanageable and got replaced exactly by
device tree. So my opinion is that DRM encoders and bridges should know as
little as possible about the following bridge, connector or panel that
follows them.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Icenowy Zheng 1 month, 2 weeks ago
在 2026-04-28二的 15:39 +0200,Luca Ceresoli写道:
> Hello Icenowy,
> 
> On Sat Apr 25, 2026 at 5:22 PM CEST, Icenowy Zheng wrote:
> > 在 2026-04-23四的 11:16 +0200,Luca Ceresoli写道:
> > > This series simplifies using the bridge-connector by removing the
> > > need to
> > > attach the newly created connector to the encoder.
> > > 
> > > == Series description
> > > 
> > > Currently all users of the bridge-connector must call
> > > drm_connector_attach_encoder() immediately after a successful
> > > drm_bridge_connector_init().
> > > 
> > > This is an unnecessary burden for users. Move the call to the end
> > > of
> > > drm_bridge_connector_init() so all callers can be simplified.
> > > 
> > >  * Patch 1 adds a drm_connector_attach_encoder() call at the end
> > > of
> > >    drm_bridge_connector_init()
> > >  * The other patches remove drm_connector_attach_encoder() after
> > > all
> > >    drm_bridge_connector_init() calls, ordered from the simplest
> > > ones
> > >    (only the last one is somewhat non-obvious)
> > > 
> > > The Cc list is huge due to the many drivers touched. I sent v1 to
> > > a
> > > reduced
> > > Cc list to ensure there is an agreement about the overall idea.
> > > That
> > > seems
> > > to be the case, so now it's time to copy all drivers maintainers.
> > > 
> > > It would be nice to apply all of this series at once to avoid
> > > duplicated
> > > calls to drm_connector_attach_encoder() in the interim. That
> > > would be
> > > harmless beacuse drm_connector_attach_encoder() is idempotent,
> > > but
> > > unpleasant.
> > > 
> > > == Additional rationale (for the curious)
> > > 
> > > Besides making the usage of the bridge-connector a bit simpler,
> > > this
> > > series
> > > is in preparation for DRM bridge hotplug. Here's why, feel free
> > > to
> > > skip if
> > > you don't care.
> > > 
> > > The old bridge hotplug proposals I have sent in the past [1] were
> > > based on
> > > a hotplug-bridge driver to sit between the last fixed bridge and
> > > the
> > > first
> > > hotplugged bridge. Discussion with the community led to the need
> > > of
> > > removing the hotplug-bridge and let common DRM code handle
> > > hotplug.
> > > The
> > > common place of code that appears the most suitable for hotplug
> > > handling is
> > > the bridge-connector, which is by now the recommended way to
> > > handle
> > > connector instantiation after a bridge chain.
> > > 
> > > So I'm in the process of extending the bridge-connector to be the
> > > central
> > > point to handle bridge hotplug. Turns out the need to call
> > > drm_connector_attach_encoder() after drm_bridge_connector_init()
> > > has
> > > returned is adding big headaches to such work. So I'm send this
> > > long
> > > but
> > > simple series to both simplify bridge-connector usage and remove
> > > one
> > > obstacle from the bridge hotplug work. This series is relevant by
> > > itself
> > > anyway.
> > > 
> > > [1]
> > > https://lore.kernel.org/lkml/20250206-hotplug-drm-bridge-v6-26-9d6f2c9c3058@bootlin.com/
> > > 
> > > == Grand plan
> > > 
> > > This is part of the work to support hotplug of DRM bridges. The
> > > grand
> > > plan
> > > was discussed in [0].
> > 
> > Just see the bridge hotplugging thing, is it possible for DRM
> > drivers
> > to declare bridges attached to themselves after this?
> > 
> > Loongson 7A1000 PCH can only output DPI signals, so nearly all
> > products
> > with it are shipping with some kind of external bridges, but
> > currently
> > drm/loongson does not support them (all display connectors are now
> > seen
> > as DPI ones, and connectors behind non-transparent bridges won't
> > work).
> > 
> > The bridges are going to be accessed by the DDC I2C busses of
> > 7A1000,
> > and are not declared with device tree (systems with 7A1000 never
> > ship
> > with device trees, and Linux currently matches a built-in device
> > tree).
> > (Bridges being on the DDC I2C also introduces some dependency for
> > them
> > to depend on the drm/loongson driver.)
> > 
> > Loongson have defined some kind of VBIOS declaring what bridge is
> > behind, and their non-mainline driver just contains driver codes
> > for
> > all possible bridges. (Sui Jingfeng previously tried to mainline
> > such
> > practice, and of course it's rejected because of code duplicity.)
> 
> I'm afraid your question goes a bit beyond my knowledge, the hotplug
> work
> I'm carrying on is focuses on DT platforms.
> 
> My limited understading of non-DT platforms is that a card driver
> must
> instantiate all components and tie them together, which assumes it
> has to
> know them somehow (ACPI, hardcoded, whatever). Others can probably
> comment
> better about this.

Yes, there's some proprietary way defined by Loongson to declare which
device is attached.

The problem here is just to instantiate the attached devices (although
parsing of the Loongson VBIOS data is also a TODO now) and prevent
dependency loop.

Thanks,
Icenowy

> 
> As a general principle, when devices can be mixed and matched by the
> board
> designer, hardcoding them is a bad design choice. Think of bad old
> board
> files written in C, which were unmanageable and got replaced exactly
> by
> device tree. So my opinion is that DRM encoders and bridges should
> know as
> little as possible about the following bridge, connector or panel
> that
> follows them.
> 
> Luca
> 
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Re: [PATCH v2 00/41] drm/display: bridge-connector: attach encoder to the connector
Posted by Luca Ceresoli 1 month, 2 weeks ago
On Thu, 23 Apr 2026 11:16:54 +0200, Luca Ceresoli wrote:
> This series simplifies using the bridge-connector by removing the need to
> attach the newly created connector to the encoder.
> 
> == Series description
> 
> Currently all users of the bridge-connector must call
> drm_connector_attach_encoder() immediately after a successful
> drm_bridge_connector_init().
> 
> [...]

Applied, thanks!

[01/41] drm/display: bridge-connector: attach the encoder to the created connector
        commit: dcad6dd16e87a6dcc78ab05f64c704cec2809db9
[02/41] drm: adp: remove now-redundant call to drm_connector_attach_encoder()
        commit: f96e621e90dfeb35676604b223f42f721e7c364f
[03/41] drm/bridge: adv7511: remove now-redundant call to drm_connector_attach_encoder()
        commit: 4f88126e09160fa5c226e786982d433aba0345c4
[04/41] drm/bridge: ite-it6263: remove now-redundant call to drm_connector_attach_encoder()
        commit: 7ecf62396ed7883eda3bb949df7f95e5a1048b17
[05/41] drm/bridge: ti-sn65dsi86: remove now-redundant call to drm_connector_attach_encoder()
        commit: 1977688f60eab4c92dca15c8b7e6b19635902ee0
[06/41] drm/imx/dcss: remove now-redundant call to drm_connector_attach_encoder()
        commit: 4b29d25b55fc28ab6065500a60693b093ad05366
[07/41] drm/imx: ldb: remove now-redundant call to drm_connector_attach_encoder()
        commit: dd7784328061fba1fba919d8879ed65ea30feeae
[08/41] drm/imx: parallel-display: remove now-redundant call to drm_connector_attach_encoder()
        commit: 5c18883f8050b1f6fdb35050cf9dad64779f6ee9
[09/41] drm/imx/lcdc: remove now-redundant call to drm_connector_attach_encoder()
        commit: b490bc69f1c11d8335dbd628d5e32db8986f848c
[10/41] drm/ingenic: remove now-redundant call to drm_connector_attach_encoder()
        commit: bc9e6392403e316c9d6e337b7cf28543051cb28e
[11/41] drm/kmb/dsi: remove now-redundant call to drm_connector_attach_encoder()
        commit: d731d87126d43936ab74804785446f67a2d60d0c
[12/41] drm/mediatek: mtk_dpi: remove now-redundant call to drm_connector_attach_encoder()
        commit: c21f9adc83c5edf0b990cd068283d3c831b43074
[13/41] drm/mediatek: mtk_dsi: remove now-redundant call to drm_connector_attach_encoder()
        commit: 41bfe06bb3cae68c0b3e21c5181c49f68db67e18
[14/41] drm/meson: encoder_cvbs: remove now-redundant call to drm_connector_attach_encoder()
        commit: 82da98ea371dff7a9ece58083846556b043bec9a
[15/41] drm/meson: encoder_hdmi: remove now-redundant call to drm_connector_attach_encoder()
        commit: 013adec1a93dcd052c6eb1769609eee661983ca9
[16/41] drm/msm/dp: remove now-redundant call to drm_connector_attach_encoder()
        commit: 6108b5b7219e3f3f947922f4faa8ccbc570210d2
[17/41] drm/msm/hdmi: remove now-redundant call to drm_connector_attach_encoder()
        commit: f7ed1d3dde56b98e065b950d1044a0f655b194ba
[18/41] drm/omapdrm: remove now-redundant call to drm_connector_attach_encoder()
        commit: 7b229305be6300c90e6f005784f9f53d4d23d579
[19/41] rm/rockchip: cdn-dp: remove now-redundant call to drm_connector_attach_encoder()
        commit: 86909f184b4f045f4d85dd2ca957811c1184aa1c
[20/41] drm/rockchip: rk3066_hdmi: remove now-redundant call to drm_connector_attach_encoder()
        commit: d5304653b60edb79bfb71209ebbd4b57001ab003
[21/41] drm/tegra: hdmi: remove now-redundant call to drm_connector_attach_encoder()
        commit: c0670fc1e75782a9dd0cd94acb7b262077b3f720
[22/41] drm/tegra: rgb: remove now-redundant call to drm_connector_attach_encoder()
        commit: 04ce2e375f6dde267f53995d81c48ab31dc06b52
[23/41] drm/tests: bridge: remove now-redundant call to drm_connector_attach_encoder()
        commit: 6d303956b41f870240a23d4896ec12e420026637
[24/41] drm: verisilicon: remove now-redundant call to drm_connector_attach_encoder()
        commit: 6d65baa60f0d7c305eb63b738163c1e35d0eef20
[25/41] drm/exynos: exynos_dp: remove now-redundant call to drm_connector_attach_encoder()
        commit: d627f7e6318906da2b95ac60616af7501d5145a5
[26/41] drm: rcar-du: encoder: remove now-redundant call to drm_connector_attach_encoder()
        commit: fa38bb8dc2e852e2979593b965779b8cca532014
[27/41] drm: renesas: rz-du: rzg2l_du_encoder: remove now-redundant call to drm_connector_attach_encoder()
        commit: 88bcd924cd85a29658a60418f6e60a0f912f990c
[28/41] drm/rockchip: analogix_dp: remove now-redundant call to drm_connector_attach_encoder()
        commit: b7e25e250ea405f1c65256494b56e0f6443cc96a
[29/41] drm/rockchip: dw_dp: remove now-redundant call to drm_connector_attach_encoder()
        commit: 8015bfccca36672e412dae4240886c71278c5b3c
[30/41] drm/rockchip: dw_hdmi_qp: remove now-redundant call to drm_connector_attach_encoder()
        commit: 14a25df41b19aba228e66c0d9578e6e6b3cc58f9
[31/41] drm/rockchip: inno-hdmi: remove now-redundant call to drm_connector_attach_encoder()
        commit: 6db094d4ce87fb4caf90db9863bb6a8b427b15c9
[32/41] drm/msm/mdp4: remove now-redundant call to drm_connector_attach_encoder()
        commit: 4e833e078f3d40d4f4a24c162210a1b7855f1539
[33/41] drm/msm/dsi: remove now-redundant call to drm_connector_attach_encoder()
        commit: f9274ba1dff8b0adff22e8d877ec1e85bb14d0c3
[34/41] drm/mxsfb/lcdif: remove now-redundant call to drm_connector_attach_encoder()
        commit: da3918b645a5efe6fad2aa53b84a4d98c3df999c
[35/41] drm/rockchip: lvds: remove now-redundant call to drm_connector_attach_encoder()
        commit: 24202edb689ead20411568251792a31103b9bde0
[35/41] drm/rockchip: lvds: remove now-redundant call to drm_connector_attach_encoder()
        commit: 24202edb689ead20411568251792a31103b9bde0
[37/41] drm/tilcdc: remove now-redundant call to drm_connector_attach_encoder()
        commit: 055673da01cdb130732ee556db58f7408392c1b8
[38/41] drm: zynqmp_kms: remove now-redundant call to drm_connector_attach_encoder()
        commit: 42ccccb38ca8bac394faeb30c924ad542f5f1bee
[39/41] drm/imx: remove now-redundant call to drm_connector_attach_encoder()
        commit: 2b727270b955b72cf6f47c5883bdc6f997f0e06f
[40/41] drm/rockchip: rgb: remove now-redundant call to drm_connector_attach_encoder()
        commit: d5d8e04dc0557437b19039206012305166df2bf7
[41/41] drm: renesas: shmobile: remove now-redundant call to drm_connector_attach_encoder()
        commit: 6533278b0deb14de860035dd1913e1e55e781e60

Best regards,
-- 
Luca Ceresoli <luca.ceresoli@bootlin.com>