* [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
@ 2026-03-30 19:25 Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
` (9 more replies)
0 siblings, 10 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
This series modernizes the i.mx8mp LCDIF driver to use the
bridge-connector, which is the current best practice in DRM.
== Call for testing on i.MX8MP boards (especially those using HDMI)!
For who tested v1 (thanks!): some patches have changed so I had to drop
your Tested-by on them. A new round of test would still be useful.
This series applies changes to how video output devices are probed on
i.MX8MP, especially those using HDMI. Even though I have put care in not
breaking anything, there could potentially be pitfalls I haven't realized,
causing regressions on existing boards.
I have thus added in Cc all developers which appeared active on dts files
for imx8mp boards involving video. I would appreciate testing on as many
boards as possible, along with a Tested-by tag, or a report about any
issues encountered.
Thanks in advance to all testers!
== Review recommendation
I recommend reviewing patches in this order to be understood more
effectively:
* Cover letter
* Patches 1-6: small preliminary cleanups (can be applied independently)
* Patch 10: the goal of this series, but would not work alone
* Patch 9: lets patch 10 work; but in turn it can't work alone
* Patch 8: lets patch 9 work; but in turn it can't work alone
* Patch 7: lets patch 8 work
== Series description
This series is not strictly related to DRM bridge hotplug, it is rather a
preparation step. Introducing hotplug would need two different approaches:
one for the new way, for drivers using bridge-connector and
DRM_BRIDGE_ATTACH_NO_CONNECTOR, another for drivers using the "old, legacy
way" where the last bridge is supposed to instantiate the
drm_connector. Hotplug is complicated enough in one case, so it makes sense
to only support the new way.
The hardware I'm working on is an i.MX8MP, whose LCDIF driver is still
using the old way. So this series converts to the new way as a preparation
step.
Patch 10 does the conversion, which is simple. However this would introduce
a regression on some boards. Here's why:
There are 3 instances of the LCDIF in i.MX8MP:
* LCDIF1, driving the DSI output
* LCDIF2, driving the LVDS output
* LCDIF3, driving the HDMI output
The device drivers of peripherals connected to LCDIF1 and LCDIF2 already
support the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag. So far so good.
LCDIF3 is more tricky. The HDMI pipeline is:
LCDIF3 -> fsl,imx8mp-hdmi-pvi -> fsl,imx8mp-hdmi-tx -> HDMI connector
The fsl,imx8mp-hdmi-tx (hdmi-tx) does not support
DRM_BRIDGE_ATTACH_NO_CONNECTOR, but it is based on the dw-hdmi component
which supports it by simply changing a setting in the driver platform
data. Patch 9 does this switch.
However, for that switch to work, the device tree must describe the HDMI
connector (compatible = "hdmi-connector").
Unfortunately not all device trees in mainline have an hdmi-connector
node. Adding one is easy, but would break existing hardware upgrading to a
newer kernel without upgrading the device tree blob. This is addressed by
patch 8 reusing an existing approach to add such a node to the live device
tree at init time using a device tree overlay for boards which don't have
one.
Finally, patch 8 cannot work alone because of a bad interaction between
devlink and device tree overlays. Patch 7 solves that.
== 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
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
(some v7.1, some pending)
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
6. DRM bridge hotplug
A. Bridge hotplug management in the DRM core
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:
- Dropped patch removing the loop in lcdif_attach_bridge, adapted following
patches as needed, added patch to use __free on the ep pointer
- Added new cleanup patch (patch 6)
- Build the fixup module unconditionally
- patch 7: fix returned error codes
- patch 1: fix cleanup action
- Various minor improvements based on reviews, see per-patch changelog
- Removed bouncing recipients from Cc
- Link to v1: https://lore.kernel.org/r/20260320-drm-lcdif-dbanc-v1-0-479a04133e70@bootlin.com
---
Luca Ceresoli (10):
drm/mxsfb/lcdif: simplify remote pointer management using __free
drm/mxsfb/lcdif: simplify ep pointer management using __free
drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge
drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop
drm/bridge: dw-hdmi: document the output_port field
drm/bridge: dw-hdmi: warn on unsupported attach combination
drm/bridge: dw-hdmi: move next_bridge lookup to attach time
drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time
drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR
drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
drivers/gpu/drm/bridge/imx/Kconfig | 18 ++++++
drivers/gpu/drm/bridge/imx/Makefile | 2 +
.../bridge/imx/imx8mp-hdmi-tx-connector-fixup.c | 53 +++++++++++++++++
.../bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso | 56 ++++++++++++++++++
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 1 +
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 49 +++++++--------
drivers/gpu/drm/mxsfb/Kconfig | 2 +
drivers/gpu/drm/mxsfb/lcdif_drv.c | 69 +++++++++++-----------
include/drm/bridge/dw_hdmi.h | 6 ++
9 files changed, 193 insertions(+), 63 deletions(-)
---
base-commit: cb6fd48ab016a4b2245d805a5b766eea590e32dd
change-id: 20260306-drm-lcdif-dbanc-83dd948327de
Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>
^ permalink raw reply [flat|nested] 29+ messages in thread
* [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
` (8 subsequent siblings)
9 siblings, 0 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
Putting the remote device_node reference requires a of_node_put(remote) in
two places. Use a cleanup action to simplify the code.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- Use the correct cleanup action
- Fix commit message
- add missing cleanup.h include
---
drivers/gpu/drm/mxsfb/lcdif_drv.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 47da1d9336b9..7719629487da 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -5,6 +5,7 @@
* This code is based on drivers/gpu/drm/mxsfb/mxsfb*
*/
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
@@ -53,16 +54,13 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
int ret;
for_each_endpoint_of_node(dev->of_node, ep) {
- struct device_node *remote;
+ struct device_node *remote __free(device_node) =
+ of_graph_get_remote_port_parent(ep);
struct of_endpoint of_ep;
struct drm_encoder *encoder;
- remote = of_graph_get_remote_port_parent(ep);
- if (!of_device_is_available(remote)) {
- of_node_put(remote);
+ if (!of_device_is_available(remote))
continue;
- }
- of_node_put(remote);
ret = of_graph_parse_endpoint(ep, &of_ep);
if (ret < 0) {
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep pointer management using __free
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 3:50 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
` (7 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
Putting the ep device_node reference requires a of_node_put(ep) in many
return points. Use a cleanup action to simplify the code.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
This patch is new in v2
---
drivers/gpu/drm/mxsfb/lcdif_drv.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 7719629487da..8da8a265c05c 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -49,7 +49,7 @@ static const struct drm_encoder_funcs lcdif_encoder_funcs = {
static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
{
struct device *dev = lcdif->drm->dev;
- struct device_node *ep;
+ struct device_node *ep __free(device_node) = NULL;
struct drm_bridge *bridge;
int ret;
@@ -65,23 +65,19 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
ret = of_graph_parse_endpoint(ep, &of_ep);
if (ret < 0) {
dev_err(dev, "Failed to parse endpoint %pOF\n", ep);
- of_node_put(ep);
return ret;
}
bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, of_ep.id);
- if (IS_ERR(bridge)) {
- of_node_put(ep);
+ if (IS_ERR(bridge))
return dev_err_probe(dev, PTR_ERR(bridge),
"Failed to get bridge for endpoint%u\n",
of_ep.id);
- }
encoder = devm_kzalloc(dev, sizeof(*encoder), GFP_KERNEL);
if (!encoder) {
dev_err(dev, "Failed to allocate encoder for endpoint%u\n",
of_ep.id);
- of_node_put(ep);
return -ENOMEM;
}
@@ -91,17 +87,14 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
if (ret) {
dev_err(dev, "Failed to initialize encoder for endpoint%u: %d\n",
of_ep.id, ret);
- of_node_put(ep);
return ret;
}
ret = drm_bridge_attach(encoder, bridge, NULL, 0);
- if (ret) {
- of_node_put(ep);
+ if (ret)
return dev_err_probe(dev, ret,
"Failed to attach bridge for endpoint%u\n",
of_ep.id);
- }
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 3:52 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop Luca Ceresoli
` (6 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
lcdif_attach_bridge() uses dev_err_probe() in some error paths, dev_err() +
return in others. Use dev_err_probe() for all of them to make code
consistent, simpler and with bettere error reporting.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- rewrote after removal of previous patch removing loop
- not added review/test trailers as the code is a bit different
---
drivers/gpu/drm/mxsfb/lcdif_drv.c | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 8da8a265c05c..1c76709c4d94 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -63,10 +63,8 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
continue;
ret = of_graph_parse_endpoint(ep, &of_ep);
- if (ret < 0) {
- dev_err(dev, "Failed to parse endpoint %pOF\n", ep);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to parse endpoint %pOF\n", ep);
bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, of_ep.id);
if (IS_ERR(bridge))
@@ -75,20 +73,18 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
of_ep.id);
encoder = devm_kzalloc(dev, sizeof(*encoder), GFP_KERNEL);
- if (!encoder) {
- dev_err(dev, "Failed to allocate encoder for endpoint%u\n",
- of_ep.id);
- return -ENOMEM;
- }
+ if (!encoder)
+ return dev_err_probe(dev, -ENOMEM,
+ "Failed to allocate encoder for endpoint%u\n",
+ of_ep.id);
encoder->possible_crtcs = drm_crtc_mask(&lcdif->crtc);
ret = drm_encoder_init(lcdif->drm, encoder, &lcdif_encoder_funcs,
DRM_MODE_ENCODER_NONE, NULL);
- if (ret) {
- dev_err(dev, "Failed to initialize encoder for endpoint%u: %d\n",
- of_ep.id, ret);
- return ret;
- }
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to initialize encoder for endpoint%u\n",
+ of_ep.id);
ret = drm_bridge_attach(encoder, bridge, NULL, 0);
if (ret)
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (2 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 3:57 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
` (5 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
The bridge and ret variables are per-iteration variables, whose values
don't have to be carried to the next iteration or be used after the loop
end. Move their declaration inside the loop scope as a cleanup and to make
code clearer.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
This patch is new in v2
---
drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 1c76709c4d94..c8ba8f9b1da8 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -50,14 +50,14 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
{
struct device *dev = lcdif->drm->dev;
struct device_node *ep __free(device_node) = NULL;
- struct drm_bridge *bridge;
- int ret;
for_each_endpoint_of_node(dev->of_node, ep) {
struct device_node *remote __free(device_node) =
of_graph_get_remote_port_parent(ep);
struct of_endpoint of_ep;
+ struct drm_bridge *bridge;
struct drm_encoder *encoder;
+ int ret;
if (!of_device_is_available(remote))
continue;
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (3 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-03-31 7:21 ` Damon Ding
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
` (4 subsequent siblings)
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
The meaning of this flag may not be obvious at first sight.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- improved comment as suggested by Liu
---
include/drm/bridge/dw_hdmi.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
index 336f062e1f9d..8500dd4f99d8 100644
--- a/include/drm/bridge/dw_hdmi.h
+++ b/include/drm/bridge/dw_hdmi.h
@@ -126,6 +126,12 @@ struct dw_hdmi_phy_ops {
struct dw_hdmi_plat_data {
struct regmap *regm;
+ /*
+ * The HDMI output port number must be 1 if the port is described
+ * in the device tree. 0 if the device tree does not describe the
+ * next component (legacy mode, i.e. without
+ * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge).
+ */
unsigned int output_port;
unsigned long input_bus_encoding;
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (4 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-03-31 7:25 ` Damon Ding
2026-04-02 9:14 ` Damon Ding
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
` (3 subsequent siblings)
9 siblings, 2 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
dw-hdmi can operate in two different modes, depending on the platform data
as set by the driver:
A. hdmi->plat_data->output_port = 0:
the HDMI output (port@1) in device tree is not used
B. hdmi->plat_data->output_port = 1:
the HDMI output (port@1) is parsed to find the next bridge
Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is
passed to the attach callback. Emit a warning when this is violated. Also
return -EINVAL which would be returned by drm_bridge_attach() right after
anyway.
Reviewed-by: Liu Ying <victor.liu@nxp.com>
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Note: Returning when the warning triggers does not change the functional
behaviour of this function. It is not strictly necessary in this patch but
it will have to be done anyway in the following patch.
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index 0296e110ce65..ab1a6a8783cd 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
{
struct dw_hdmi *hdmi = bridge->driver_private;
+ /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */
+ if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
+ return -EINVAL;
+
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
bridge, flags);
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (5 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-03-31 7:24 ` Damon Ding
2026-04-02 3:59 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
` (2 subsequent siblings)
9 siblings, 2 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
This driver looks up the next_bridge at probe time and stores it in
hdmi->bridge.next_bridge, but only uses the stored value when attaching,
and only in the DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
This will be problematic with an upcoming change, adding an hdmi-connector
using a device tree overlay when not present. That change is in turn
necessary to migrate the i.MX LCDIF driver to the bridge-connector.
The problem is that, adding the hdmi-connector via an overlay, devlink
considers hdmi-connector a consumer of the dw-hdmi device, generating a
chicken-egg problem:
* hdmi-connector probe won't be tried until dw-hdmi is probed (devlink)
* dw-hdmi probe will defer until it finds the next_bridge (the
hdmi-connector wrapper bridge)
In preparation for those changes, move the next_bridge lookup from probe to
attach, when it is actually used. This allows dw-hdmi to probe, so that the
hdmi-connector can probe as well.
Also avoid storing the pointer in hdmi->bridge.next_bridge: the value is
computed when needed, thus a local variable is enough.
Finally, this also allows to slightly improve the code by not doing any DT
lookup in the !DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- Fix returned error codes
- Added missing cleanup.h include
---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 45 +++++++++++--------------------
1 file changed, 16 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ab1a6a8783cd..f4a1ebb79716 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -6,6 +6,8 @@
* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
* Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*/
+
+#include <linux/cleanup.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
@@ -2914,9 +2916,20 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
return -EINVAL;
- if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
- return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
- bridge, flags);
+ if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
+ struct device_node *remote __free(device_node) =
+ of_graph_get_remote_node(hdmi->dev->of_node,
+ hdmi->plat_data->output_port, -1);
+ if (!remote)
+ return -ENODEV;
+
+ struct drm_bridge *next_bridge __free(drm_bridge_put) =
+ of_drm_find_and_get_bridge(remote);
+ if (!next_bridge)
+ return -EPROBE_DEFER;
+
+ return drm_bridge_attach(encoder, next_bridge, bridge, flags);
+ }
return dw_hdmi_connector_create(hdmi);
}
@@ -3307,28 +3320,6 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi)
* Probe/remove API, used from platforms based on the DRM bridge API.
*/
-static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
-{
- struct device_node *remote;
-
- if (!hdmi->plat_data->output_port)
- return 0;
-
-
- remote = of_graph_get_remote_node(hdmi->dev->of_node,
- hdmi->plat_data->output_port,
- -1);
- if (!remote)
- return -ENODEV;
-
- hdmi->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
- of_node_put(remote);
- if (!hdmi->bridge.next_bridge)
- return -EPROBE_DEFER;
-
- return 0;
-}
-
bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi)
{
return hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format);
@@ -3373,10 +3364,6 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
mutex_init(&hdmi->cec_notifier_mutex);
spin_lock_init(&hdmi->audio_lock);
- ret = dw_hdmi_parse_dt(hdmi);
- if (ret < 0)
- return ERR_PTR(ret);
-
ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
if (ddc_node) {
hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node);
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (6 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 4:05 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
The imx8mp-hdmi-tx is one of many drivers based on dw-hdmi. dw-hdmi in turn
can operate in two different modes, depending on the platform data as set
by the driver:
A. hdmi->plat_data->output_port = 0:
the HDMI output (port@1) in device tree is not used [0]
B. hdmi->plat_data->output_port = 1:
the HDMI output (port@1) is parsed to find the next bridge
The imx8mp-hdmi-tx driver falls in case A. This implies next_bridge will
always be NULL, and so dw_hdmi_bridge_attach() [1] will always fail if
called with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag.
In fact case A assumes that DRM_BRIDGE_ATTACH_NO_CONNECTOR is not set and
in that case it adds an HDMI Type A connector programmatically at bridge
attach time.
Support for DRM_BRIDGE_ATTACH_NO_CONNECTOR is implemented by dw-hdmi.c in
case B. However switching to base B requires that port@1 is connected to a
"next bridge" DT node, typically the HDMI connector, because dw-hdmi won't
add the connector when using DRM_BRIDGE_ATTACH_NO_CONNECTOR.
Many dts files for imx8mp-based boards in the kernel have such a connector
described and linked to port@1, so the pipeline will be fully attached up
to a display-connector and a drm_connector added by the
bridge-connector. Sadly some of those dts files don't have the connector
described. Adding it would solve the problem easily, but this would break
existing devices which do not update the dtb when upgrading to a newer
kernel.
In preparation for switching to case B while preserving backward
compatibility for such devices, introduce a module adding the
hdmi-connector node to the live device tree at init time. This will allow
the dw-hdmi code to find the next bridge (the one wrapping the
hdmi-connector) and let the pipeline work as before.
The module is inserted only if there is no endpoint in port@1. So boards
whose device tree describe the connector will not have the device tre
modified, and will start isntantiating the correct HDMI connector type as
described in the device tree.
For boards lacking a connector description in DT the overlay will be added,
abd the HDMI connector will be Type A, which is a reasonable fallback and
is what the driver is currently doing.
[0] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L3310
[1] https://elixir.bootlin.com/linux/v7.0-rc1/source/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c#L2907
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- don't apply the overlay if the SoC is not i.MX8MP
- build unconditionally, but depend on DRM_IMX_LCDIF
- remove useless error check
- add missing cleanup.h and init.h includes, remove unneeded includes
- avoid dtc warnings on overlay
- fix typo in Kconfig help text
- not added the Tested-bys because the code has changed
- split the 'plat_data->output_port = 1' line to a separate patch
This patch is inspired by commit 0ff223d99147 ("drm/tilcdc: Convert legacy
panel binding via DT overlay at boot time")
---
drivers/gpu/drm/bridge/imx/Kconfig | 18 +++++++
drivers/gpu/drm/bridge/imx/Makefile | 2 +
.../bridge/imx/imx8mp-hdmi-tx-connector-fixup.c | 53 ++++++++++++++++++++
.../bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso | 56 ++++++++++++++++++++++
4 files changed, 129 insertions(+)
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index b9028a5e5a06..49f074559b00 100644
--- a/drivers/gpu/drm/bridge/imx/Kconfig
+++ b/drivers/gpu/drm/bridge/imx/Kconfig
@@ -18,6 +18,8 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
depends on OF
depends on COMMON_CLK
select DRM_DW_HDMI
+ select OF_OVERLAY
+ select DRM_DISPLAY_CONNECTOR
imply DRM_IMX8MP_HDMI_PAI
imply DRM_IMX8MP_HDMI_PVI
imply PHY_FSL_SAMSUNG_HDMI_PHY
@@ -25,6 +27,22 @@ config DRM_IMX8MP_DW_HDMI_BRIDGE
Choose this to enable support for the internal HDMI encoder found
on the i.MX8MP SoC.
+config DRM_IMX8MP_DW_HDMI_BRIDGE_CONNECTOR_FIXUP
+ bool
+ default y
+ depends on DRM_IMX_LCDIF
+ depends on DRM_IMX8MP_DW_HDMI_BRIDGE
+ depends on OF
+ help
+ Modifies at early boot the live device tree of boards using the
+ i.MX8MP fsl,imx8mp-hdmi-tx adding a hdmi-connector node linked to
+ the hdmi-tx. This is needed to support bridge-connector usage in
+ the i.MX8MP LCDIF driver.
+
+ You need this if you use the i.MX8MP HDMI output and your board
+ device tree file does not have an hdmi-connector node connected
+ to it.
+
config DRM_IMX8MP_HDMI_PAI
tristate "Freescale i.MX8MP HDMI PAI bridge support"
depends on OF
diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile
index 8d01fda25451..84499fe2e444 100644
--- a/drivers/gpu/drm/bridge/imx/Makefile
+++ b/drivers/gpu/drm/bridge/imx/Makefile
@@ -1,6 +1,8 @@
obj-$(CONFIG_DRM_IMX_LDB_HELPER) += imx-ldb-helper.o
obj-$(CONFIG_DRM_IMX_LEGACY_BRIDGE) += imx-legacy-bridge.o
obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE) += imx8mp-hdmi-tx.o
+obj-$(CONFIG_DRM_IMX8MP_DW_HDMI_BRIDGE_CONNECTOR_FIXUP) += imx8mp-hdmi-tx-connector-fixup.o \
+ imx8mp-hdmi-tx-connector-fixup.dtbo.o
obj-$(CONFIG_DRM_IMX8MP_HDMI_PAI) += imx8mp-hdmi-pai.o
obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) += imx8mp-hdmi-pvi.o
obj-$(CONFIG_DRM_IMX8QM_LDB) += imx8qm-ldb.o
diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c
new file mode 100644
index 000000000000..4c0a22bf416b
--- /dev/null
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.c
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Add an hdmi-connector node to boards using the imx8mp hdmi_tx which
+ * don't have one. This is needed for the i.MX LCDIF to work with
+ * DRM_BRIDGE_ATTACH_NO_CONNECTOR.
+ *
+ * Copyright (C) 2026 GE HealthCare
+ * Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
+ */
+
+#include <linux/cleanup.h>
+#include <linux/init.h>
+#include <linux/of.h>
+
+/* Embedded dtbo symbols created by cmd_wrap_S_dtb in scripts/Makefile.dtbs */
+extern char __dtbo_imx8mp_hdmi_tx_connector_fixup_begin[];
+extern char __dtbo_imx8mp_hdmi_tx_connector_fixup_end[];
+
+static int __init imx8mp_hdmi_tx_connector_fixup_init(void)
+{
+ struct device_node *soc __free(device_node) = NULL;
+ struct device_node *hdmi_tx __free(device_node) = NULL;
+ struct device_node *endpoint __free(device_node) = NULL;
+ struct device_node *hdmi_conn __free(device_node) = NULL;
+ void *dtbo_start;
+ u32 dtbo_size;
+ int ovcs_id;
+
+ soc = of_find_node_by_path("/soc@0");
+ if (!soc)
+ return 0;
+
+ /* This applies to i.MX8MP only, do nothing on other systems */
+ if (!of_device_is_compatible(soc, "fsl,imx8mp-soc"))
+ return 0;
+
+ hdmi_tx = of_find_node_by_path("/soc@0/bus@32c00000/hdmi@32fd8000");
+ if (!of_device_is_available(hdmi_tx))
+ return 0;
+
+ /* If endpoint exists, assume an hdmi-connector exists already */
+ endpoint = of_find_node_by_path("/soc@0/bus@32c00000/hdmi@32fd8000/ports/port@1/endpoint");
+ if (endpoint)
+ return 0;
+
+ dtbo_start = __dtbo_imx8mp_hdmi_tx_connector_fixup_begin;
+ dtbo_size = __dtbo_imx8mp_hdmi_tx_connector_fixup_end -
+ __dtbo_imx8mp_hdmi_tx_connector_fixup_begin;
+
+ return of_overlay_fdt_apply(dtbo_start, dtbo_size, &ovcs_id, NULL);
+}
+
+subsys_initcall(imx8mp_hdmi_tx_connector_fixup_init);
diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso
new file mode 100644
index 000000000000..5dbe06d5ffe7
--- /dev/null
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx-connector-fixup.dtso
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * DTS overlay adding an hdmi-connector node to boards using the imx8mp hdmi_tx
+ *
+ * Copyright (C) 2026 GE HealthCare
+ * Author: Luca Ceresoli <luca.ceresoli@bootlin.com>
+ */
+
+/dts-v1/;
+/plugin/;
+
+&{/} {
+ #address-cells = <2>;
+ #size-cells = <2>;
+
+ fixup-hdmi-connector {
+ compatible = "hdmi-connector";
+ label = "HDMI";
+ type = "a";
+
+ port {
+ fixup_hdmi_connector_in: endpoint {
+ remote-endpoint = <&hdmi_tx_out>;
+ };
+ };
+ };
+
+ soc@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0x0 0x0 0x0 0x3e000000>;
+
+ bus@32c00000 {
+ reg = <0x32c00000 0x400000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ hdmi@32fd8000 {
+ reg = <0x32fd8000 0x7eff>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ port@1 {
+ reg = <1>;
+
+ hdmi_tx_out: endpoint {
+ remote-endpoint = <&fixup_hdmi_connector_in>;
+ };
+ };
+ };
+ };
+ };
+ };
+};
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (7 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 4:08 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
The imx8mp-hdmi-tx one of many drivers based on dw-hdmi. dw-hdmi in turn
can operate in two different modes, depending on the platform data as set
by the driver:
A. hdmi->plat_data->output_port = 0:
the HDMI output (port@1) in device tree is not used [0]
B. hdmi->plat_data->output_port = 1:
the HDMI output (port@1) is parsed to find the next bridge
The imx8mp-hdmi-tx driver falls in case A. Switching to case B, which is
the current best practice, requires that the HDMI connector is always
described in the live device tree, and a previous commit ensured this is
always the case by adding an overlay in case the device tree does not
comply.
So now we can simply switch to the new mode and support
DRM_BRIDGE_ATTACH_NO_CONNECTOR.
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- new patch, split out of the previous patch
---
drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
index 32fd3554e267..8e8cfd66f23b 100644
--- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
@@ -138,6 +138,7 @@ static int imx8mp_dw_hdmi_probe(struct platform_device *pdev)
plat_data->phy_name = "SAMSUNG HDMI TX PHY";
plat_data->priv_data = hdmi;
plat_data->phy_force_vendor = true;
+ plat_data->output_port = 1;
platform_set_drvdata(pdev, hdmi);
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
` (8 preceding siblings ...)
2026-03-30 19:25 ` [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
@ 2026-03-30 19:25 ` Luca Ceresoli
2026-04-02 4:55 ` Liu Ying
9 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-03-30 19:25 UTC (permalink / raw)
To: Marek Vasut, Stefan Agner, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Frank Li,
Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares, Luca Ceresoli
Convert this driver to DRM_BRIDGE_ATTACH_NO_CONNECTOR and to the
drm_bridge_connector framework which is the current DRM bridge best
practice.
Tested-by: Martyn Welch <martyn.welch@collabora.com>
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- Added missing select DRM_DISPLAY_HELPER in Kconfig
- Rebased on previous patch changes
---
drivers/gpu/drm/mxsfb/Kconfig | 2 ++
drivers/gpu/drm/mxsfb/lcdif_drv.c | 16 +++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
index 264e74f45554..31db7a824a93 100644
--- a/drivers/gpu/drm/mxsfb/Kconfig
+++ b/drivers/gpu/drm/mxsfb/Kconfig
@@ -33,6 +33,8 @@ config DRM_IMX_LCDIF
select DRM_GEM_DMA_HELPER
select DRM_PANEL
select DRM_PANEL_BRIDGE
+ select DRM_DISPLAY_HELPER
+ select DRM_BRIDGE_CONNECTOR
help
Choose this option if you have an LCDIFv3 LCD controller.
Those devices are found in various i.MX SoC (i.MX8MP,
diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index c8ba8f9b1da8..7f07ae24e0dc 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -18,6 +18,7 @@
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_drv.h>
#include <drm/drm_encoder.h>
#include <drm/drm_fbdev_dma.h>
@@ -57,6 +58,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
struct of_endpoint of_ep;
struct drm_bridge *bridge;
struct drm_encoder *encoder;
+ struct drm_connector *connector;
int ret;
if (!of_device_is_available(remote))
@@ -86,11 +88,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
"Failed to initialize encoder for endpoint%u\n",
of_ep.id);
- ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+ ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret)
return dev_err_probe(dev, ret,
"Failed to attach bridge for endpoint%u\n",
of_ep.id);
+
+ connector = drm_bridge_connector_init(lcdif->drm, encoder);
+ if (IS_ERR(connector))
+ return dev_err_probe(dev, PTR_ERR(connector),
+ "Failed to init bridge_connector for endpoint%u\n",
+ of_ep.id);
+
+ ret = drm_connector_attach_encoder(connector, encoder);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Failed to attach connector for endpoint%u\n",
+ of_ep.id);
}
return 0;
--
2.53.0
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field
2026-03-30 19:25 ` [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
@ 2026-03-31 7:21 ` Damon Ding
2026-04-02 7:46 ` Luca Ceresoli
0 siblings, 1 reply; 29+ messages in thread
From: Damon Ding @ 2026-03-31 7:21 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
> The meaning of this flag may not be obvious at first sight.
>
> Reviewed-by: Liu Ying <victor.liu@nxp.com>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Changes in v2:
> - improved comment as suggested by Liu
> ---
> include/drm/bridge/dw_hdmi.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h
> index 336f062e1f9d..8500dd4f99d8 100644
> --- a/include/drm/bridge/dw_hdmi.h
> +++ b/include/drm/bridge/dw_hdmi.h
> @@ -126,6 +126,12 @@ struct dw_hdmi_phy_ops {
> struct dw_hdmi_plat_data {
> struct regmap *regm;
>
> + /*
> + * The HDMI output port number must be 1 if the port is described
> + * in the device tree. 0 if the device tree does not describe the
> + * next component (legacy mode, i.e. without
> + * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge).
> + */
> unsigned int output_port;
>
> unsigned long input_bus_encoding;
>
Tested-by: Damon Ding <damon.ding@rock-chips.com> (on rk3399)
Best regards,
Damon
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
@ 2026-03-31 7:24 ` Damon Ding
2026-04-02 3:59 ` Liu Ying
1 sibling, 0 replies; 29+ messages in thread
From: Damon Ding @ 2026-03-31 7:24 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
> This driver looks up the next_bridge at probe time and stores it in
> hdmi->bridge.next_bridge, but only uses the stored value when attaching,
> and only in the DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
>
> This will be problematic with an upcoming change, adding an hdmi-connector
> using a device tree overlay when not present. That change is in turn
> necessary to migrate the i.MX LCDIF driver to the bridge-connector.
>
> The problem is that, adding the hdmi-connector via an overlay, devlink
> considers hdmi-connector a consumer of the dw-hdmi device, generating a
> chicken-egg problem:
>
> * hdmi-connector probe won't be tried until dw-hdmi is probed (devlink)
> * dw-hdmi probe will defer until it finds the next_bridge (the
> hdmi-connector wrapper bridge)
>
> In preparation for those changes, move the next_bridge lookup from probe to
> attach, when it is actually used. This allows dw-hdmi to probe, so that the
> hdmi-connector can probe as well.
>
> Also avoid storing the pointer in hdmi->bridge.next_bridge: the value is
> computed when needed, thus a local variable is enough.
>
> Finally, this also allows to slightly improve the code by not doing any DT
> lookup in the !DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Changes in v2:
> - Fix returned error codes
> - Added missing cleanup.h include
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 45 +++++++++++--------------------
> 1 file changed, 16 insertions(+), 29 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index ab1a6a8783cd..f4a1ebb79716 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -6,6 +6,8 @@
> * Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
> * Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> */
> +
> +#include <linux/cleanup.h>
> #include <linux/clk.h>
> #include <linux/delay.h>
> #include <linux/err.h>
> @@ -2914,9 +2916,20 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
> return -EINVAL;
>
> - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> - return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
> - bridge, flags);
> + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> + struct device_node *remote __free(device_node) =
> + of_graph_get_remote_node(hdmi->dev->of_node,
> + hdmi->plat_data->output_port, -1);
> + if (!remote)
> + return -ENODEV;
> +
> + struct drm_bridge *next_bridge __free(drm_bridge_put) =
> + of_drm_find_and_get_bridge(remote);
> + if (!next_bridge)
> + return -EPROBE_DEFER;
> +
> + return drm_bridge_attach(encoder, next_bridge, bridge, flags);
> + }
>
> return dw_hdmi_connector_create(hdmi);
> }
> @@ -3307,28 +3320,6 @@ static void dw_hdmi_init_hw(struct dw_hdmi *hdmi)
> * Probe/remove API, used from platforms based on the DRM bridge API.
> */
>
> -static int dw_hdmi_parse_dt(struct dw_hdmi *hdmi)
> -{
> - struct device_node *remote;
> -
> - if (!hdmi->plat_data->output_port)
> - return 0;
> -
> -
> - remote = of_graph_get_remote_node(hdmi->dev->of_node,
> - hdmi->plat_data->output_port,
> - -1);
> - if (!remote)
> - return -ENODEV;
> -
> - hdmi->bridge.next_bridge = of_drm_find_and_get_bridge(remote);
> - of_node_put(remote);
> - if (!hdmi->bridge.next_bridge)
> - return -EPROBE_DEFER;
> -
> - return 0;
> -}
> -
> bool dw_hdmi_bus_fmt_is_420(struct dw_hdmi *hdmi)
> {
> return hdmi_bus_fmt_is_yuv420(hdmi->hdmi_data.enc_out_bus_format);
> @@ -3373,10 +3364,6 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
> mutex_init(&hdmi->cec_notifier_mutex);
> spin_lock_init(&hdmi->audio_lock);
>
> - ret = dw_hdmi_parse_dt(hdmi);
> - if (ret < 0)
> - return ERR_PTR(ret);
> -
> ddc_node = of_parse_phandle(np, "ddc-i2c-bus", 0);
> if (ddc_node) {
> hdmi->ddc = of_get_i2c_adapter_by_node(ddc_node);
>
Tested-by: Damon Ding <damon.ding@rock-chips.com> (on rk3399)
Best regards,
Damon
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
@ 2026-03-31 7:25 ` Damon Ding
2026-04-02 9:14 ` Damon Ding
1 sibling, 0 replies; 29+ messages in thread
From: Damon Ding @ 2026-03-31 7:25 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
> dw-hdmi can operate in two different modes, depending on the platform data
> as set by the driver:
>
> A. hdmi->plat_data->output_port = 0:
> the HDMI output (port@1) in device tree is not used
>
> B. hdmi->plat_data->output_port = 1:
> the HDMI output (port@1) is parsed to find the next bridge
>
> Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is
> passed to the attach callback. Emit a warning when this is violated. Also
> return -EINVAL which would be returned by drm_bridge_attach() right after
> anyway.
>
> Reviewed-by: Liu Ying <victor.liu@nxp.com>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
> Note: Returning when the warning triggers does not change the functional
> behaviour of this function. It is not strictly necessary in this patch but
> it will have to be done anyway in the following patch.
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 0296e110ce65..ab1a6a8783cd 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> {
> struct dw_hdmi *hdmi = bridge->driver_private;
>
> + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */
> + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
> + return -EINVAL;
> +
> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
> bridge, flags);
>
Tested-by: Damon Ding <damon.ding@rock-chips.com> (on rk3399)
Best regards,
Damon
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep pointer management using __free
2026-03-30 19:25 ` [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
@ 2026-04-02 3:50 ` Liu Ying
0 siblings, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 3:50 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Mon, Mar 30, 2026 at 09:25:43PM +0200, Luca Ceresoli wrote:
> Putting the ep device_node reference requires a of_node_put(ep) in many
> return points. Use a cleanup action to simplify the code.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> This patch is new in v2
> ---
> drivers/gpu/drm/mxsfb/lcdif_drv.c | 13 +++----------
> 1 file changed, 3 insertions(+), 10 deletions(-)
Reviewed-by: Liu Ying <victor.liu@nxp.com>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge
2026-03-30 19:25 ` [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
@ 2026-04-02 3:52 ` Liu Ying
0 siblings, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 3:52 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Mon, Mar 30, 2026 at 09:25:44PM +0200, Luca Ceresoli wrote:
> lcdif_attach_bridge() uses dev_err_probe() in some error paths, dev_err() +
> return in others. Use dev_err_probe() for all of them to make code
> consistent, simpler and with bettere error reporting.
s/bettere/better/
Reviewed-by: Liu Ying <victor.liu@nxp.com>
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop
2026-03-30 19:25 ` [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop Luca Ceresoli
@ 2026-04-02 3:57 ` Liu Ying
0 siblings, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 3:57 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Mon, Mar 30, 2026 at 09:25:45PM +0200, Luca Ceresoli wrote:
> The bridge and ret variables are per-iteration variables, whose values
> don't have to be carried to the next iteration or be used after the loop
> end. Move their declaration inside the loop scope as a cleanup and to make
> code clearer.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> This patch is new in v2
> ---
> drivers/gpu/drm/mxsfb/lcdif_drv.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Nit: change subject to:
drm/mxsfb/lcdif: move iteration-specific variables declaration inside loop in lcdif_attach_bridge
Reviewed-by: Liu Ying <victor.liu@nxp.com>
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-03-31 7:24 ` Damon Ding
@ 2026-04-02 3:59 ` Liu Ying
1 sibling, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 3:59 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Mon, Mar 30, 2026 at 09:25:48PM +0200, Luca Ceresoli wrote:
> This driver looks up the next_bridge at probe time and stores it in
> hdmi->bridge.next_bridge, but only uses the stored value when attaching,
> and only in the DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
>
> This will be problematic with an upcoming change, adding an hdmi-connector
> using a device tree overlay when not present. That change is in turn
> necessary to migrate the i.MX LCDIF driver to the bridge-connector.
>
> The problem is that, adding the hdmi-connector via an overlay, devlink
> considers hdmi-connector a consumer of the dw-hdmi device, generating a
> chicken-egg problem:
>
> * hdmi-connector probe won't be tried until dw-hdmi is probed (devlink)
> * dw-hdmi probe will defer until it finds the next_bridge (the
> hdmi-connector wrapper bridge)
>
> In preparation for those changes, move the next_bridge lookup from probe to
> attach, when it is actually used. This allows dw-hdmi to probe, so that the
> hdmi-connector can probe as well.
>
> Also avoid storing the pointer in hdmi->bridge.next_bridge: the value is
> computed when needed, thus a local variable is enough.
>
> Finally, this also allows to slightly improve the code by not doing any DT
> lookup in the !DRM_BRIDGE_ATTACH_NO_CONNECTOR case.
>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Changes in v2:
> - Fix returned error codes
> - Added missing cleanup.h include
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 45 +++++++++++--------------------
> 1 file changed, 16 insertions(+), 29 deletions(-)
Acked-by: Liu Ying <victor.liu@nxp.com>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time
2026-03-30 19:25 ` [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
@ 2026-04-02 4:05 ` Liu Ying
2026-04-02 7:30 ` Luca Ceresoli
0 siblings, 1 reply; 29+ messages in thread
From: Liu Ying @ 2026-04-02 4:05 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
Hi Luca,
On Mon, Mar 30, 2026 at 09:25:49PM +0200, Luca Ceresoli wrote:
[...]
> Changes in v2:
> - don't apply the overlay if the SoC is not i.MX8MP
> - build unconditionally, but depend on DRM_IMX_LCDIF
> - remove useless error check
> - add missing cleanup.h and init.h includes, remove unneeded includes
> - avoid dtc warnings on overlay
> - fix typo in Kconfig help text
> - not added the Tested-bys because the code has changed
> - split the 'plat_data->output_port = 1' line to a separate patch
v2 also changes commit mesg.
[...]
> +static int __init imx8mp_hdmi_tx_connector_fixup_init(void)
[...]
> + return of_overlay_fdt_apply(dtbo_start, dtbo_size, &ovcs_id, NULL);
Kernel doc of of_overlay_fdt_apply() says:
* On error return, the changeset may be partially applied. This is especially
* likely if an OF_OVERLAY_POST_APPLY notifier returns an error. In this case
* the caller should call of_overlay_remove() with the value in *@ret_ovcs_id.
Need a bailout?
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR
2026-03-30 19:25 ` [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
@ 2026-04-02 4:08 ` Liu Ying
0 siblings, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 4:08 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Mon, Mar 30, 2026 at 09:25:50PM +0200, Luca Ceresoli wrote:
> The imx8mp-hdmi-tx one of many drivers based on dw-hdmi. dw-hdmi in turn
> can operate in two different modes, depending on the platform data as set
> by the driver:
>
> A. hdmi->plat_data->output_port = 0:
> the HDMI output (port@1) in device tree is not used [0]
>
> B. hdmi->plat_data->output_port = 1:
> the HDMI output (port@1) is parsed to find the next bridge
>
> The imx8mp-hdmi-tx driver falls in case A. Switching to case B, which is
> the current best practice, requires that the HDMI connector is always
> described in the live device tree, and a previous commit ensured this is
> always the case by adding an overlay in case the device tree does not
> comply.
>
> So now we can simply switch to the new mode and support
> DRM_BRIDGE_ATTACH_NO_CONNECTOR.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Changes in v2:
> - new patch, split out of the previous patch
> ---
> drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Liu Ying <victor.liu@nxp.com>
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
2026-03-30 19:25 ` [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
@ 2026-04-02 4:55 ` Liu Ying
2026-04-02 5:07 ` Liu Ying
2026-04-02 8:28 ` Luca Ceresoli
0 siblings, 2 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 4:55 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
Hi Luca,
On Mon, Mar 30, 2026 at 09:25:51PM +0200, Luca Ceresoli wrote:
> Convert this driver to DRM_BRIDGE_ATTACH_NO_CONNECTOR and to the
> drm_bridge_connector framework which is the current DRM bridge best
> practice.
>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> ---
>
> Changes in v2:
> - Added missing select DRM_DISPLAY_HELPER in Kconfig
> - Rebased on previous patch changes
> ---
> drivers/gpu/drm/mxsfb/Kconfig | 2 ++
> drivers/gpu/drm/mxsfb/lcdif_drv.c | 16 +++++++++++++++-
> 2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/mxsfb/Kconfig b/drivers/gpu/drm/mxsfb/Kconfig
> index 264e74f45554..31db7a824a93 100644
> --- a/drivers/gpu/drm/mxsfb/Kconfig
> +++ b/drivers/gpu/drm/mxsfb/Kconfig
> @@ -33,6 +33,8 @@ config DRM_IMX_LCDIF
> select DRM_GEM_DMA_HELPER
> select DRM_PANEL
> select DRM_PANEL_BRIDGE
> + select DRM_DISPLAY_HELPER
> + select DRM_BRIDGE_CONNECTOR
> help
> Choose this option if you have an LCDIFv3 LCD controller.
> Those devices are found in various i.MX SoC (i.MX8MP,
> diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> index c8ba8f9b1da8..7f07ae24e0dc 100644
> --- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
> +++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
> @@ -18,6 +18,7 @@
> #include <drm/clients/drm_client_setup.h>
> #include <drm/drm_atomic_helper.h>
> #include <drm/drm_bridge.h>
> +#include <drm/drm_bridge_connector.h>
> #include <drm/drm_drv.h>
> #include <drm/drm_encoder.h>
> #include <drm/drm_fbdev_dma.h>
> @@ -57,6 +58,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> struct of_endpoint of_ep;
> struct drm_bridge *bridge;
> struct drm_encoder *encoder;
> + struct drm_connector *connector;
> int ret;
>
> if (!of_device_is_available(remote))
> @@ -86,11 +88,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
> "Failed to initialize encoder for endpoint%u\n",
> of_ep.id);
>
> - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
> + ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
It seems that only analogix-anx6345.c, analogix-anx78xx.c and analogix_dp_core.c
don't allow DRM_BRIDGE_ATTACH_NO_CONNECTOR, since they error out when attaching
the bridge with the flag:
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
}
Looks like i.MX8MP platforms don't use these drivers.
But, are we completely safe here by adding the flag? You also mentioned
"pitfalls" in commit mesg, which makes me a bit more worried.
Sorry for not bringing this up in v1.
> if (ret)
> return dev_err_probe(dev, ret,
> "Failed to attach bridge for endpoint%u\n",
> of_ep.id);
> +
> + connector = drm_bridge_connector_init(lcdif->drm, encoder);
Also, kernel doc of drm_bridge_connector.c says:
* To make use of this helper, all bridges in the chain shall report bridge
* operation flags (&drm_bridge->ops) and bridge output type
* (&drm_bridge->type), as well as the DRM_BRIDGE_ATTACH_NO_CONNECTOR attach
* flag (none of the bridges shall create a DRM connector directly).
Are you sure that we are safe to use this helper?
> + if (IS_ERR(connector))
> + return dev_err_probe(dev, PTR_ERR(connector),
> + "Failed to init bridge_connector for endpoint%u\n",
> + of_ep.id);
> +
> + ret = drm_connector_attach_encoder(connector, encoder);
> + if (ret)
> + return dev_err_probe(dev, ret,
> + "Failed to attach connector for endpoint%u\n",
> + of_ep.id);
> }
>
> return 0;
>
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
2026-04-02 4:55 ` Liu Ying
@ 2026-04-02 5:07 ` Liu Ying
2026-04-02 8:28 ` Luca Ceresoli
1 sibling, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-02 5:07 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
On Thu, Apr 02, 2026 at 12:55:32PM +0800, Liu Ying wrote:
> "pitfalls" in commit mesg, which makes me a bit more worried.
^^^^^^^^^^^ Typo, should be cover letter. Sorry.
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time
2026-04-02 4:05 ` Liu Ying
@ 2026-04-02 7:30 ` Luca Ceresoli
0 siblings, 0 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-04-02 7:30 UTC (permalink / raw)
To: Liu Ying, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
Hello Liu,
On Thu Apr 2, 2026 at 6:05 AM CEST, Liu Ying wrote:
> Hi Luca,
>
> On Mon, Mar 30, 2026 at 09:25:49PM +0200, Luca Ceresoli wrote:
>
> [...]
>
>> Changes in v2:
>> - don't apply the overlay if the SoC is not i.MX8MP
>> - build unconditionally, but depend on DRM_IMX_LCDIF
>> - remove useless error check
>> - add missing cleanup.h and init.h includes, remove unneeded includes
>> - avoid dtc warnings on overlay
>> - fix typo in Kconfig help text
>> - not added the Tested-bys because the code has changed
>> - split the 'plat_data->output_port = 1' line to a separate patch
>
> v2 also changes commit mesg.
Good to see someone looks at the changelog! :)
Im updating the v2 changelog in v3 to mention this.
>> + return of_overlay_fdt_apply(dtbo_start, dtbo_size, &ovcs_id, NULL);
>
> Kernel doc of of_overlay_fdt_apply() says:
>
> * On error return, the changeset may be partially applied. This is especially
> * likely if an OF_OVERLAY_POST_APPLY notifier returns an error. In this case
> * the caller should call of_overlay_remove() with the value in *@ret_ovcs_id.
>
> Need a bailout?
Indeed! I mistakenly removed it in v2, re-adding it in v3.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field
2026-03-31 7:21 ` Damon Ding
@ 2026-04-02 7:46 ` Luca Ceresoli
2026-04-02 9:05 ` Damon Ding
0 siblings, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-04-02 7:46 UTC (permalink / raw)
To: Damon Ding, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
Hello Damon,
On Tue Mar 31, 2026 at 9:21 AM CEST, Damon Ding wrote:
> On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
>> The meaning of this flag may not be obvious at first sight.
>>
>> Reviewed-by: Liu Ying <victor.liu@nxp.com>
>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Thanks for looking at this series!
>> @@ -126,6 +126,12 @@ struct dw_hdmi_phy_ops {
>> struct dw_hdmi_plat_data {
>> struct regmap *regm;
>>
>> + /*
>> + * The HDMI output port number must be 1 if the port is described
>> + * in the device tree. 0 if the device tree does not describe the
>> + * next component (legacy mode, i.e. without
>> + * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge).
>> + */
>> unsigned int output_port;
>>
>> unsigned long input_bus_encoding;
>>
>
> Tested-by: Damon Ding <damon.ding@rock-chips.com> (on rk3399)
Uhm, I'm not sure what can be tested in a patch only adding a comment. Did
you mean 'Reviewed-by' maybe?
Also, I _think_ the best syntax for a comment would be using a '#', not
parentheses, so that would be
| Tested-by: Damon Ding <damon.ding@rock-chips.com> # on rk3399
This is the recommended syntax for the 'Cc: stable' lines [0], at
least. Additionally b4 keeps comments with the '#' as those in [1], while
is discards the ones in parentheses.
[0] https://docs.kernel.org/process/stable-kernel-rules.html
[1] https://lore.kernel.org/all/2948177.mvXUDI8C0e@steina-w/
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
2026-04-02 4:55 ` Liu Ying
2026-04-02 5:07 ` Liu Ying
@ 2026-04-02 8:28 ` Luca Ceresoli
2026-04-03 9:48 ` Liu Ying
1 sibling, 1 reply; 29+ messages in thread
From: Luca Ceresoli @ 2026-04-02 8:28 UTC (permalink / raw)
To: Liu Ying, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
Hello Liu,
On Thu Apr 2, 2026 at 6:55 AM CEST, Liu Ying wrote:
> Hi Luca,
>
> On Mon, Mar 30, 2026 at 09:25:51PM +0200, Luca Ceresoli wrote:
>> Convert this driver to DRM_BRIDGE_ATTACH_NO_CONNECTOR and to the
>> drm_bridge_connector framework which is the current DRM bridge best
>> practice.
>>
>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>> @@ -86,11 +88,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
>> "Failed to initialize encoder for endpoint%u\n",
>> of_ep.id);
>>
>> - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>> + ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>
> It seems that only analogix-anx6345.c, analogix-anx78xx.c and analogix_dp_core.c
> don't allow DRM_BRIDGE_ATTACH_NO_CONNECTOR, since they error out when attaching
> the bridge with the flag:
>
> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
> DRM_ERROR("Fix bridge driver to make connector optional!");
> return -EINVAL;
> }
>
> Looks like i.MX8MP platforms don't use these drivers.
Exactly. I have checked all the drivers involved with the i.MX8MP and all
of the support DRM_BRIDGE_ATTACH_NO_CONNECTOR.
While converting all drivers is surely a good goal, converting all of them
at once is not realistically doable. So the approach I took was to convert
one specifically (lcdif_drv.c) plus all those which would break because
they are used with the LCDIF.
> But, are we completely safe here by adding the flag? You also mentioned
> "pitfalls" in commit mesg, which makes me a bit more worried.
I mentioned potential pitfalls in the cover letter mainly because of the DT
overlay insertion patch, which is somewhat tricky as it impacts many
boards.
Additionally it's not easy to spot all usages of this component by parsing
dozens of dts files, so I might have missed some.
So overall every patch sent has a potential for pitfalls, but for the
reasons above I think this series has a bit more.
Does this reassure you? :)
>> if (ret)
>> return dev_err_probe(dev, ret,
>> "Failed to attach bridge for endpoint%u\n",
>> of_ep.id);
>> +
>> + connector = drm_bridge_connector_init(lcdif->drm, encoder);
>
> Also, kernel doc of drm_bridge_connector.c says:
>
> * To make use of this helper, all bridges in the chain shall report bridge
> * operation flags (&drm_bridge->ops) and bridge output type
> * (&drm_bridge->type), as well as the DRM_BRIDGE_ATTACH_NO_CONNECTOR attach
> * flag (none of the bridges shall create a DRM connector directly).
>
> Are you sure that we are safe to use this helper?
Yes. I have checked all in-tree dts[i] files for all the 3 LCDIFs.
For the LCDIF3, the pipeline is:
LCDIF3 -> fsl,imx8mp-hdmi-pvi -> fsl,imx8mp-hdmi-tx -> HDMI connector
And the involved bridges are:
* fsl,imx8mp-hdmi-pvi has ops = 0 (it doesn't set it) because it
implements none the optional features mentioned by those flags, and it
honors the DRM_BRIDGE_ATTACH_NO_CONNECTOR by propagating it
* fsl,imx8mp-hdmi-tx is implemented based on dw-hdmi, which sets ops as
appropriate and also propagates the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag
* display-connector (enabled via the DT overlay if needed) sets ops and
makes DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory
The LCDIF2 involves the panel-bridge, display-connector and lvds-decoder
which also set ops as needed and propagate DRM_BRIDGE_ATTACH_NO_CONNECTOR
or make it mandatory.
The same applies to the drivers used with the LCDIF1: adv7511, tc358767 and
the panel bridge.
I assume this answers your doubts. Let me know if it doesn't.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field
2026-04-02 7:46 ` Luca Ceresoli
@ 2026-04-02 9:05 ` Damon Ding
0 siblings, 0 replies; 29+ messages in thread
From: Damon Ding @ 2026-04-02 9:05 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
Hi Luca,
On 4/2/2026 3:46 PM, Luca Ceresoli wrote:
> Hello Damon,
>
> On Tue Mar 31, 2026 at 9:21 AM CEST, Damon Ding wrote:
>> On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
>>> The meaning of this flag may not be obvious at first sight.
>>>
>>> Reviewed-by: Liu Ying <victor.liu@nxp.com>
>>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
> Thanks for looking at this series!
>
>>> @@ -126,6 +126,12 @@ struct dw_hdmi_phy_ops {
>>> struct dw_hdmi_plat_data {
>>> struct regmap *regm;
>>>
>>> + /*
>>> + * The HDMI output port number must be 1 if the port is described
>>> + * in the device tree. 0 if the device tree does not describe the
>>> + * next component (legacy mode, i.e. without
>>> + * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag when attaching bridge).
>>> + */
>>> unsigned int output_port;
>>>
>>> unsigned long input_bus_encoding;
>>>
>>
>> Tested-by: Damon Ding <damon.ding@rock-chips.com> (on rk3399)
>
> Uhm, I'm not sure what can be tested in a patch only adding a comment. Did
> you mean 'Reviewed-by' maybe?
>
> Also, I _think_ the best syntax for a comment would be using a '#', not
> parentheses, so that would be
>
> | Tested-by: Damon Ding <damon.ding@rock-chips.com> # on rk3399
>
> This is the recommended syntax for the 'Cc: stable' lines [0], at
> least. Additionally b4 keeps comments with the '#' as those in [1], while
> is discards the ones in parentheses.
>
> [0] https://docs.kernel.org/process/stable-kernel-rules.html
> [1] https://lore.kernel.org/all/2948177.mvXUDI8C0e@steina-w/
>
Indeed, '#' is much better.
I think we still need to further discuss the various cases around
DRM_BRIDGE_ATTACH_NO_CONNECTOR in [PATCH v2 06/10].
Best regards,
Damon
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
2026-03-31 7:25 ` Damon Ding
@ 2026-04-02 9:14 ` Damon Ding
2026-04-02 9:57 ` Luca Ceresoli
1 sibling, 1 reply; 29+ messages in thread
From: Damon Ding @ 2026-04-02 9:14 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
[-- Attachment #1: Type: text/plain, Size: 2768 bytes --]
Hi Luca,
On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
> dw-hdmi can operate in two different modes, depending on the platform data
> as set by the driver:
>
> A. hdmi->plat_data->output_port = 0:
> the HDMI output (port@1) in device tree is not used
>
> B. hdmi->plat_data->output_port = 1:
> the HDMI output (port@1) is parsed to find the next bridge
>
> Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is
> passed to the attach callback. Emit a warning when this is violated. Also
> return -EINVAL which would be returned by drm_bridge_attach() right after
> anyway.
>
> Reviewed-by: Liu Ying <victor.liu@nxp.com>
> Tested-by: Martyn Welch <martyn.welch@collabora.com>
> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> ---
> Note: Returning when the warning triggers does not change the functional
> behaviour of this function. It is not strictly necessary in this patch but
> it will have to be done anyway in the following patch.
> ---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> index 0296e110ce65..ab1a6a8783cd 100644
> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
> @@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
> {
> struct dw_hdmi *hdmi = bridge->driver_private;
>
> + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */
> + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
> + return -EINVAL;
> +
> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
> return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
> bridge, flags);
>
Since many older Rockchip platforms (RK3288, RK3399, etc.) lack a
hdmi-connector node linked to the HDMI DT node, which corresponds to
case A. Could we relax this restriction and treat cases where
DRM_BRIDGE_ATTACH_NO_CONNECTOR is set but hdmi->plat_data->output_port =
0 as a new case C?
For Rockchip platforms, the HDMI driver invokes dw_hdmi_bind() to attach
the Synopsys bridge. This sequence differs from that on the XNP
platform, but is similar to the Allwinner implementation.
If we treat the case where DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and
hdmi->plat_data->output_port = 0 as -EINVAL, I will have to modify the
HDMI DT configuration for all Rockchip platforms when adapting to the
bridge-connector framework.
The patch that adapts to the bridge-connector framework and has been
verified OK on RK3399 is attached.
Best regards,
Damon
[-- Attachment #2: dw_hdmi-rockchip_test_env_20260402.patch --]
[-- Type: text/plain, Size: 3041 bytes --]
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-evb-ind.dts b/arch/arm64/boot/dts/rockchip/rk3399-evb-ind.dts
index 70aee1ab904c..5a78e741f113 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-evb-ind.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-evb-ind.dts
@@ -17,6 +17,7 @@ aliases {
chosen {
stdout-path = "serial2:1500000n8";
+ bootargs = "root=PARTUUID=614e0000-0000 rootwait";
};
vcc5v0_sys: regulator-vcc5v0-sys {
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
index ada45e8b3e2c..0e97e183a8b3 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
@@ -2914,7 +2914,7 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
/* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */
if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
- return -EINVAL;
+ return 0;
if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
struct device_node *remote __free(device_node) =
@@ -3628,7 +3628,7 @@ struct dw_hdmi *dw_hdmi_bind(struct platform_device *pdev,
if (IS_ERR(hdmi))
return hdmi;
- ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL, 0);
+ ret = drm_bridge_attach(encoder, &hdmi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret) {
dw_hdmi_remove(hdmi);
return ERR_PTR(ret);
diff --git a/drivers/gpu/drm/rockchip/Kconfig b/drivers/gpu/drm/rockchip/Kconfig
index e7f49fe845ea..69b832d0c8c4 100644
--- a/drivers/gpu/drm/rockchip/Kconfig
+++ b/drivers/gpu/drm/rockchip/Kconfig
@@ -76,6 +76,7 @@ config ROCKCHIP_DW_DP
config ROCKCHIP_DW_HDMI
bool "Rockchip specific extensions for Synopsys DW HDMI"
+ select DRM_BRIDGE_CONNECTOR
help
This selects support for Rockchip SoC specific extensions
for the Synopsys DesignWare HDMI driver. If you want to
diff --git a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
index 0dc1eb5d2ae3..174a10c1d7c2 100644
--- a/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
@@ -13,6 +13,7 @@
#include <linux/regulator/consumer.h>
#include <drm/bridge/dw_hdmi.h>
+#include <drm/drm_bridge_connector.h>
#include <drm/drm_edid.h>
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
@@ -542,6 +543,7 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
struct drm_device *drm = data;
struct drm_encoder *encoder;
struct rockchip_hdmi *hdmi;
+ struct drm_connector *connector;
int ret;
if (!pdev->dev.of_node)
@@ -619,7 +621,14 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
goto err_bind;
}
- return 0;
+ connector = drm_bridge_connector_init(drm, encoder);
+ if (IS_ERR(connector)) {
+ ret = PTR_ERR(connector);
+ dev_err(hdmi->dev, "Failed to initialize bridge_connector\n");
+ goto err_bind;
+ }
+
+ return drm_connector_attach_encoder(connector, encoder);
err_bind:
drm_encoder_cleanup(encoder);
^ permalink raw reply related [flat|nested] 29+ messages in thread
* Re: [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination
2026-04-02 9:14 ` Damon Ding
@ 2026-04-02 9:57 ` Luca Ceresoli
0 siblings, 0 replies; 29+ messages in thread
From: Luca Ceresoli @ 2026-04-02 9:57 UTC (permalink / raw)
To: Damon Ding, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Liu Ying, Rob Herring,
Saravana Kannan
Cc: Kory Maincent (TI.com), Hervé Codina, Hui Pu, Ian Ray,
Thomas Petazzoni, dri-devel, imx, linux-arm-kernel, linux-kernel,
devicetree, Adam Ford, Alexander Stein, Christopher Obbard,
Daniel Scally, Emanuele Ghidoli, Fabio Estevam, Francesco Dolcini,
Frieder Schrempf, Gilles Talis, Goran Rađenović,
Heiko Schocher, Josua Mayer, Kieran Bingham, Marco Felsch,
Martyn Welch, Oleksij Rempel, Peng Fan, Richard Hu, Shengjiu Wang,
Stefan Eichenberger, Vitor Soares
Hello Damon,
On Thu Apr 2, 2026 at 11:14 AM CEST, Damon Ding wrote:
> Hi Luca,
>
> On 3/31/2026 3:25 AM, Luca Ceresoli wrote:
>> dw-hdmi can operate in two different modes, depending on the platform data
>> as set by the driver:
>>
>> A. hdmi->plat_data->output_port = 0:
>> the HDMI output (port@1) in device tree is not used
>>
>> B. hdmi->plat_data->output_port = 1:
>> the HDMI output (port@1) is parsed to find the next bridge
>>
>> Only case B is supported when the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag is
>> passed to the attach callback. Emit a warning when this is violated. Also
>> return -EINVAL which would be returned by drm_bridge_attach() right after
>> anyway.
>>
>> Reviewed-by: Liu Ying <victor.liu@nxp.com>
>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>> ---
>> Note: Returning when the warning triggers does not change the functional
>> behaviour of this function. It is not strictly necessary in this patch but
>> it will have to be done anyway in the following patch.
>> ---
>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> index 0296e110ce65..ab1a6a8783cd 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>> @@ -2910,6 +2910,10 @@ static int dw_hdmi_bridge_attach(struct drm_bridge *bridge,
>> {
>> struct dw_hdmi *hdmi = bridge->driver_private;
>>
>> + /* DRM_BRIDGE_ATTACH_NO_CONNECTOR requires a remote-endpoint to the next bridge */
>> + if (WARN_ON((flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) && !hdmi->plat_data->output_port))
>> + return -EINVAL;
>> +
>> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
>> return drm_bridge_attach(encoder, hdmi->bridge.next_bridge,
>> bridge, flags);
>>
>
> Since many older Rockchip platforms (RK3288, RK3399, etc.) lack a
> hdmi-connector node linked to the HDMI DT node, which corresponds to
> case A. Could we relax this restriction and treat cases where
> DRM_BRIDGE_ATTACH_NO_CONNECTOR is set but hdmi->plat_data->output_port =
> 0 as a new case C?
>
> For Rockchip platforms, the HDMI driver invokes dw_hdmi_bind() to attach
> the Synopsys bridge. This sequence differs from that on the XNP
> platform, but is similar to the Allwinner implementation.
>
> If we treat the case where DRM_BRIDGE_ATTACH_NO_CONNECTOR is set and
> hdmi->plat_data->output_port = 0 as -EINVAL, I will have to modify the
> HDMI DT configuration for all Rockchip platforms when adapting to the
> bridge-connector framework.
>
> The patch that adapts to the bridge-connector framework and has been
> verified OK on RK3399 is attached.
I saw this only after sending v3. Anyway, replying now.
I'm not sure I follow completely your reasoning, but one aspect is that we
can (and should) convert drivers in small groups independently as I'm doing
with this series for the i.MX8MP and involved drivers and you are doing for
the analogix_dp in another series. Converting all (or large sets) at once
would just be not doable realistically.
And so I suggest you send a separate series to convert the Rockchip drivers
based on dw-hdmi. Please Cc me, I'll be glad to review it.
Also, it's not clear to me why we need a case C. We already have two cases
(A and B, the old and new way) and we should convert to case B unless there
is a strong reason. If Rockchip dts are missing a hdmi-connector node you
can reuse the fixup module in patch 8.
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector
2026-04-02 8:28 ` Luca Ceresoli
@ 2026-04-03 9:48 ` Liu Ying
0 siblings, 0 replies; 29+ messages in thread
From: Liu Ying @ 2026-04-03 9:48 UTC (permalink / raw)
To: Luca Ceresoli, Marek Vasut, Stefan Agner, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Frank Li, Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Rob Herring, Saravana Kannan
Cc: Damon Ding, Kory Maincent (TI.com), Hervé Codina, Hui Pu,
Ian Ray, Thomas Petazzoni, dri-devel, imx, linux-arm-kernel,
linux-kernel, devicetree, Adam Ford, Alexander Stein,
Christopher Obbard, Daniel Scally, Emanuele Ghidoli,
Fabio Estevam, Francesco Dolcini, Frieder Schrempf, Gilles Talis,
Goran Rađenović, Heiko Schocher, Josua Mayer,
Kieran Bingham, Marco Felsch, Martyn Welch, Oleksij Rempel,
Peng Fan, Richard Hu, Shengjiu Wang, Stefan Eichenberger,
Vitor Soares
Hi Luca,
On Thu, Apr 02, 2026 at 10:28:45AM +0200, Luca Ceresoli wrote:
> Hello Liu,
>
> On Thu Apr 2, 2026 at 6:55 AM CEST, Liu Ying wrote:
>> Hi Luca,
>>
>> On Mon, Mar 30, 2026 at 09:25:51PM +0200, Luca Ceresoli wrote:
>>> Convert this driver to DRM_BRIDGE_ATTACH_NO_CONNECTOR and to the
>>> drm_bridge_connector framework which is the current DRM bridge best
>>> practice.
>>>
>>> Tested-by: Martyn Welch <martyn.welch@collabora.com>
>>> Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com> # TQMa8MPxL/MBa8MPxL
>>> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
>
>>> @@ -86,11 +88,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
>>> "Failed to initialize encoder for endpoint%u\n",
>>> of_ep.id);
>>>
>>> - ret = drm_bridge_attach(encoder, bridge, NULL, 0);
>>> + ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
>>
>> It seems that only analogix-anx6345.c, analogix-anx78xx.c and analogix_dp_core.c
>> don't allow DRM_BRIDGE_ATTACH_NO_CONNECTOR, since they error out when attaching
>> the bridge with the flag:
>>
>> if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
>> DRM_ERROR("Fix bridge driver to make connector optional!");
>> return -EINVAL;
>> }
>>
>> Looks like i.MX8MP platforms don't use these drivers.
>
> Exactly. I have checked all the drivers involved with the i.MX8MP and all
> of the support DRM_BRIDGE_ATTACH_NO_CONNECTOR.
Great...
>
> While converting all drivers is surely a good goal, converting all of them
> at once is not realistically doable. So the approach I took was to convert
> one specifically (lcdif_drv.c) plus all those which would break because
> they are used with the LCDIF.
>
>> But, are we completely safe here by adding the flag? You also mentioned
>> "pitfalls" in commit mesg, which makes me a bit more worried.
>
> I mentioned potential pitfalls in the cover letter mainly because of the DT
> overlay insertion patch, which is somewhat tricky as it impacts many
> boards.
>
> Additionally it's not easy to spot all usages of this component by parsing
> dozens of dts files, so I might have missed some.
>
> So overall every patch sent has a potential for pitfalls, but for the
> reasons above I think this series has a bit more.
>
> Does this reassure you? :)
... your check makes me a bit relaxed.
>
>>> if (ret)
>>> return dev_err_probe(dev, ret,
>>> "Failed to attach bridge for endpoint%u\n",
>>> of_ep.id);
>>> +
>>> + connector = drm_bridge_connector_init(lcdif->drm, encoder);
>>
>> Also, kernel doc of drm_bridge_connector.c says:
>>
>> * To make use of this helper, all bridges in the chain shall report bridge
>> * operation flags (&drm_bridge->ops) and bridge output type
>> * (&drm_bridge->type), as well as the DRM_BRIDGE_ATTACH_NO_CONNECTOR attach
>> * flag (none of the bridges shall create a DRM connector directly).
>>
>> Are you sure that we are safe to use this helper?
>
> Yes. I have checked all in-tree dts[i] files for all the 3 LCDIFs.
>
> For the LCDIF3, the pipeline is:
>
> LCDIF3 -> fsl,imx8mp-hdmi-pvi -> fsl,imx8mp-hdmi-tx -> HDMI connector
>
> And the involved bridges are:
>
> * fsl,imx8mp-hdmi-pvi has ops = 0 (it doesn't set it) because it
> implements none the optional features mentioned by those flags, and it
> honors the DRM_BRIDGE_ATTACH_NO_CONNECTOR by propagating it
>
> * fsl,imx8mp-hdmi-tx is implemented based on dw-hdmi, which sets ops as
> appropriate and also propagates the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag
>
> * display-connector (enabled via the DT overlay if needed) sets ops and
> makes DRM_BRIDGE_ATTACH_NO_CONNECTOR mandatory
>
> The LCDIF2 involves the panel-bridge, display-connector and lvds-decoder
> which also set ops as needed and propagate DRM_BRIDGE_ATTACH_NO_CONNECTOR
> or make it mandatory.
For now, LCDIF2 with LDB only supports LVDS panel, so display-connector and
lvds-decoder are not enabled yet, though they can be in DT.
>
> The same applies to the drivers used with the LCDIF1: adv7511, tc358767 and
> the panel bridge.
>
> I assume this answers your doubts. Let me know if it doesn't.
Your description here for each LCDIF is helpful for reviewer to understand
there will be no regression introduced by this commit, so I think it'd be
good to put it in commit message - it reflects your thought about avoiding
any regression and that it's not that easy to switch to the bridge connector
helper(as an example for other DRM drivers to do the switch).
With that done, I'll provide my R-b. Thanks.
>
> Luca
>
> --
> Luca Ceresoli, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com/
--
Regards,
Liu Ying
^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2026-04-03 9:47 UTC | newest]
Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 19:25 [PATCH v2 00/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 01/10] drm/mxsfb/lcdif: simplify remote pointer management using __free Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 02/10] drm/mxsfb/lcdif: simplify ep " Luca Ceresoli
2026-04-02 3:50 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 03/10] drm/mxsfb/lcdif: use dev_err_probe() consistently in lcdif_attach_bridge Luca Ceresoli
2026-04-02 3:52 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 04/10] drm/mxsfb/lcdif: lcdif_attach_bridge: move iteration-specific variables declaration inside loop Luca Ceresoli
2026-04-02 3:57 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 05/10] drm/bridge: dw-hdmi: document the output_port field Luca Ceresoli
2026-03-31 7:21 ` Damon Ding
2026-04-02 7:46 ` Luca Ceresoli
2026-04-02 9:05 ` Damon Ding
2026-03-30 19:25 ` [PATCH v2 06/10] drm/bridge: dw-hdmi: warn on unsupported attach combination Luca Ceresoli
2026-03-31 7:25 ` Damon Ding
2026-04-02 9:14 ` Damon Ding
2026-04-02 9:57 ` Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 07/10] drm/bridge: dw-hdmi: move next_bridge lookup to attach time Luca Ceresoli
2026-03-31 7:24 ` Damon Ding
2026-04-02 3:59 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 08/10] drm/bridge: imx8mp-hdmi-tx: add an hdmi-connector when missing using a DT overlay at boot time Luca Ceresoli
2026-04-02 4:05 ` Liu Ying
2026-04-02 7:30 ` Luca Ceresoli
2026-03-30 19:25 ` [PATCH v2 09/10] drm/bridge: imx8mp-hdmi-tx: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR Luca Ceresoli
2026-04-02 4:08 ` Liu Ying
2026-03-30 19:25 ` [PATCH v2 10/10] drm/mxsfb/lcdif: use DRM_BRIDGE_ATTACH_NO_CONNECTOR and the bridge-connector Luca Ceresoli
2026-04-02 4:55 ` Liu Ying
2026-04-02 5:07 ` Liu Ying
2026-04-02 8:28 ` Luca Ceresoli
2026-04-03 9:48 ` Liu Ying
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox