[PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use

Damon Ding posted 18 patches 1 month, 3 weeks ago
Only 14 patches received!
[PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Damon Ding 1 month, 3 weeks ago
As suggested by Dmitry, the DRM legacy bridge driver can be pulled
out of imx/ subdir for multi-platform use. The driver is also renamed
to make it more generic and suitable for platforms other than i.MX.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

---

Changes in v7:
- Rename legacy-bridge to of-display-mode-bridge.
- Remove unnecessary API drm_bridge_is_legacy().
---
 drivers/gpu/drm/bridge/Kconfig                | 10 ++
 drivers/gpu/drm/bridge/Makefile               |  1 +
 drivers/gpu/drm/bridge/imx/Kconfig            | 10 --
 drivers/gpu/drm/bridge/imx/Makefile           |  1 -
 .../gpu/drm/bridge/imx/imx-legacy-bridge.c    | 91 ------------------
 .../gpu/drm/bridge/of-display-mode-bridge.c   | 93 +++++++++++++++++++
 drivers/gpu/drm/imx/ipuv3/Kconfig             |  4 +-
 drivers/gpu/drm/imx/ipuv3/imx-ldb.c           |  6 +-
 drivers/gpu/drm/imx/ipuv3/parallel-display.c  |  5 +-
 include/drm/bridge/imx.h                      | 17 ----
 include/drm/bridge/of-display-mode-bridge.h   | 17 ++++
 11 files changed, 129 insertions(+), 126 deletions(-)
 delete mode 100644 drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
 create mode 100644 drivers/gpu/drm/bridge/of-display-mode-bridge.c
 delete mode 100644 include/drm/bridge/imx.h
 create mode 100644 include/drm/bridge/of-display-mode-bridge.h

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index a250afd8d662..65784f6db797 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
 	help
 	  NXP PTN3460 eDP-LVDS bridge chip driver.
 
+config DRM_OF_DISPLAY_MODE_BRIDGE
+	tristate
+	depends on DRM_BRIDGE && OF
+	help
+	  This is a DRM bridge implementation that uses of_get_drm_display_mode
+	  to acquire display mode.
+
+	  Newer designs should not use this bridge and should use proper panel
+	  driver instead.
+
 config DRM_PARADE_PS8622
 	tristate "Parade eDP/LVDS bridge"
 	depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index c7dc03182e59..41146faef91a 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -20,6 +20,7 @@ obj-$(CONFIG_DRM_LVDS_CODEC) += lvds-codec.o
 obj-$(CONFIG_DRM_MEGACHIPS_STDPXXXX_GE_B850V3_FW) += megachips-stdpxxxx-ge-b850v3-fw.o
 obj-$(CONFIG_DRM_MICROCHIP_LVDS_SERIALIZER) += microchip-lvds.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
+obj-$(CONFIG_DRM_OF_DISPLAY_MODE_BRIDGE) += of-display-mode-bridge.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
 obj-$(CONFIG_DRM_PARADE_PS8640) += parade-ps8640.o
 obj-$(CONFIG_DRM_SAMSUNG_DSIM) += samsung-dsim.o
diff --git a/drivers/gpu/drm/bridge/imx/Kconfig b/drivers/gpu/drm/bridge/imx/Kconfig
index b9028a5e5a06..8877b9789868 100644
--- a/drivers/gpu/drm/bridge/imx/Kconfig
+++ b/drivers/gpu/drm/bridge/imx/Kconfig
@@ -3,16 +3,6 @@ if ARCH_MXC || COMPILE_TEST
 config DRM_IMX_LDB_HELPER
 	tristate
 
-config DRM_IMX_LEGACY_BRIDGE
-	tristate
-	depends on DRM_IMX
-	help
-	  This is a DRM bridge implementation for the DRM i.MX IPUv3 driver,
-	  that uses of_get_drm_display_mode to acquire display mode.
-
-	  Newer designs should not use this bridge and should use proper panel
-	  driver instead.
-
 config DRM_IMX8MP_DW_HDMI_BRIDGE
 	tristate "Freescale i.MX8MP HDMI-TX bridge support"
 	depends on OF
diff --git a/drivers/gpu/drm/bridge/imx/Makefile b/drivers/gpu/drm/bridge/imx/Makefile
index 8d01fda25451..69d9f9abbe36 100644
--- a/drivers/gpu/drm/bridge/imx/Makefile
+++ b/drivers/gpu/drm/bridge/imx/Makefile
@@ -1,5 +1,4 @@
 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_HDMI_PAI) += imx8mp-hdmi-pai.o
 obj-$(CONFIG_DRM_IMX8MP_HDMI_PVI) += imx8mp-hdmi-pvi.o
diff --git a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c b/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
deleted file mode 100644
index 0e31d5000e7c..000000000000
--- a/drivers/gpu/drm/bridge/imx/imx-legacy-bridge.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Freescale i.MX drm driver
- *
- * bridge driver for legacy DT bindings, utilizing display-timings node
- */
-
-#include <linux/export.h>
-
-#include <drm/drm_bridge.h>
-#include <drm/drm_modes.h>
-#include <drm/drm_probe_helper.h>
-#include <drm/bridge/imx.h>
-
-#include <video/of_display_timing.h>
-#include <video/of_videomode.h>
-
-struct imx_legacy_bridge {
-	struct drm_bridge base;
-
-	struct drm_display_mode mode;
-	u32 bus_flags;
-};
-
-#define to_imx_legacy_bridge(bridge)	container_of(bridge, struct imx_legacy_bridge, base)
-
-static int imx_legacy_bridge_attach(struct drm_bridge *bridge,
-				    struct drm_encoder *encoder,
-				    enum drm_bridge_attach_flags flags)
-{
-	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
-		return -EINVAL;
-
-	return 0;
-}
-
-static int imx_legacy_bridge_get_modes(struct drm_bridge *bridge,
-				       struct drm_connector *connector)
-{
-	struct imx_legacy_bridge *imx_bridge = to_imx_legacy_bridge(bridge);
-	int ret;
-
-	ret = drm_connector_helper_get_modes_fixed(connector, &imx_bridge->mode);
-	if (ret)
-		return ret;
-
-	connector->display_info.bus_flags = imx_bridge->bus_flags;
-
-	return 0;
-}
-
-struct drm_bridge_funcs imx_legacy_bridge_funcs = {
-	.attach = imx_legacy_bridge_attach,
-	.get_modes = imx_legacy_bridge_get_modes,
-};
-
-struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
-					      struct device_node *np,
-					      int type)
-{
-	struct imx_legacy_bridge *imx_bridge;
-	int ret;
-
-	imx_bridge = devm_drm_bridge_alloc(dev, struct imx_legacy_bridge,
-					   base, &imx_legacy_bridge_funcs);
-	if (IS_ERR(imx_bridge))
-		return ERR_CAST(imx_bridge);
-
-	ret = of_get_drm_display_mode(np,
-				      &imx_bridge->mode,
-				      &imx_bridge->bus_flags,
-				      OF_USE_NATIVE_MODE);
-	if (ret)
-		return ERR_PTR(ret);
-
-	imx_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
-
-	imx_bridge->base.of_node = np;
-	imx_bridge->base.ops = DRM_BRIDGE_OP_MODES;
-	imx_bridge->base.type = type;
-
-	ret = devm_drm_bridge_add(dev, &imx_bridge->base);
-	if (ret)
-		return ERR_PTR(ret);
-
-	return &imx_bridge->base;
-}
-EXPORT_SYMBOL_GPL(devm_imx_drm_legacy_bridge);
-
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Freescale i.MX DRM bridge driver for legacy DT bindings");
diff --git a/drivers/gpu/drm/bridge/of-display-mode-bridge.c b/drivers/gpu/drm/bridge/of-display-mode-bridge.c
new file mode 100644
index 000000000000..cb15713f3a79
--- /dev/null
+++ b/drivers/gpu/drm/bridge/of-display-mode-bridge.c
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ *
+ * bridge driver for legacy DT bindings, utilizing display-timings node
+ *
+ * Author: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+ */
+
+#include <linux/export.h>
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/bridge/of-display-mode-bridge.h>
+
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+
+struct of_display_mode_bridge {
+	struct drm_bridge base;
+
+	struct drm_display_mode mode;
+	u32 bus_flags;
+};
+
+#define to_of_display_mode_bridge(bridge) container_of(bridge, struct of_display_mode_bridge, base)
+
+static int of_display_mode_bridge_attach(struct drm_bridge *bridge,
+					 struct drm_encoder *encoder,
+					 enum drm_bridge_attach_flags flags)
+{
+	if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR))
+		return -EINVAL;
+
+	return 0;
+}
+
+static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge,
+					    struct drm_connector *connector)
+{
+	struct of_display_mode_bridge *of_bridge = to_of_display_mode_bridge(bridge);
+	int ret;
+
+	ret = drm_connector_helper_get_modes_fixed(connector, &of_bridge->mode);
+	if (ret)
+		return ret;
+
+	connector->display_info.bus_flags = of_bridge->bus_flags;
+
+	return 0;
+}
+
+struct drm_bridge_funcs of_display_mode_bridge_funcs = {
+	.attach = of_display_mode_bridge_attach,
+	.get_modes = of_display_mode_bridge_get_modes,
+};
+
+struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev,
+						   struct device_node *np,
+						   int type)
+{
+	struct of_display_mode_bridge *of_bridge;
+	int ret;
+
+	of_bridge = devm_drm_bridge_alloc(dev, struct of_display_mode_bridge,
+					  base, &of_display_mode_bridge_funcs);
+	if (IS_ERR(of_bridge))
+		return ERR_CAST(of_bridge);
+
+	ret = of_get_drm_display_mode(np,
+				      &of_bridge->mode,
+				      &of_bridge->bus_flags,
+				      OF_USE_NATIVE_MODE);
+	if (ret)
+		return ERR_PTR(ret);
+
+	of_bridge->mode.type |= DRM_MODE_TYPE_DRIVER;
+
+	of_bridge->base.of_node = np;
+	of_bridge->base.ops = DRM_BRIDGE_OP_MODES;
+	of_bridge->base.type = type;
+
+	ret = devm_drm_bridge_add(dev, &of_bridge->base);
+	if (ret)
+		return ERR_PTR(ret);
+
+	return &of_bridge->base;
+}
+EXPORT_SYMBOL_GPL(devm_drm_of_display_mode_bridge);
+
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("DRM bridge driver for legacy DT bindings");
diff --git a/drivers/gpu/drm/imx/ipuv3/Kconfig b/drivers/gpu/drm/imx/ipuv3/Kconfig
index acaf25089001..e98f8d35efaa 100644
--- a/drivers/gpu/drm/imx/ipuv3/Kconfig
+++ b/drivers/gpu/drm/imx/ipuv3/Kconfig
@@ -15,7 +15,7 @@ config DRM_IMX_PARALLEL_DISPLAY
 	depends on DRM_IMX
 	select DRM_BRIDGE
 	select DRM_BRIDGE_CONNECTOR
-	select DRM_IMX_LEGACY_BRIDGE
+	select DRM_OF_DISPLAY_MODE_BRIDGE
 	select DRM_PANEL_BRIDGE
 	select VIDEOMODE_HELPERS
 
@@ -36,7 +36,7 @@ config DRM_IMX_LDB
 	select DRM_BRIDGE
 	select DRM_BRIDGE_CONNECTOR
 	select DRM_PANEL_BRIDGE
-	select DRM_IMX_LEGACY_BRIDGE
+	select DRM_OF_DISPLAY_MODE_BRIDGE
 	help
 	  Choose this to enable the internal LVDS Display Bridge (LDB)
 	  found on i.MX53 and i.MX6 processors.
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index 626d410d9150..730caf883e83 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -28,7 +28,7 @@
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/bridge/imx.h>
+#include <drm/bridge/of-display-mode-bridge.h>
 
 #include "imx-drm.h"
 
@@ -605,8 +605,8 @@ static int imx_ldb_probe(struct platform_device *pdev)
 		 * checking the bus_format property.
 		 */
 		if (!channel->bridge) {
-			channel->bridge = devm_imx_drm_legacy_bridge(dev, child,
-								     DRM_MODE_CONNECTOR_LVDS);
+			channel->bridge = devm_drm_of_display_mode_bridge(dev, child,
+									  DRM_MODE_CONNECTOR_LVDS);
 			if (IS_ERR(channel->bridge)) {
 				ret = PTR_ERR(channel->bridge);
 				goto free_child;
diff --git a/drivers/gpu/drm/imx/ipuv3/parallel-display.c b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
index 61fab3698807..b17d2b06b0e6 100644
--- a/drivers/gpu/drm/imx/ipuv3/parallel-display.c
+++ b/drivers/gpu/drm/imx/ipuv3/parallel-display.c
@@ -19,7 +19,7 @@
 #include <drm/drm_of.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/bridge/imx.h>
+#include <drm/bridge/of-display-mode-bridge.h>
 
 #include "imx-drm.h"
 
@@ -235,7 +235,8 @@ static int imx_pd_probe(struct platform_device *pdev)
 	/* port@1 is the output port */
 	imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0);
 	if (imxpd->next_bridge == ERR_PTR(-ENODEV))
-		imxpd->next_bridge = devm_imx_drm_legacy_bridge(dev, np, DRM_MODE_CONNECTOR_DPI);
+		imxpd->next_bridge = devm_drm_of_display_mode_bridge(dev, np,
+								     DRM_MODE_CONNECTOR_DPI);
 	if (IS_ERR(imxpd->next_bridge)) {
 		ret = PTR_ERR(imxpd->next_bridge);
 		return ret;
diff --git a/include/drm/bridge/imx.h b/include/drm/bridge/imx.h
deleted file mode 100644
index b93f719fe0e7..000000000000
--- a/include/drm/bridge/imx.h
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0+
-/*
- * Copyright (C) 2012 Sascha Hauer, Pengutronix
- */
-
-#ifndef DRM_IMX_BRIDGE_H
-#define DRM_IMX_BRIDGE_H
-
-struct device;
-struct device_node;
-struct drm_bridge;
-
-struct drm_bridge *devm_imx_drm_legacy_bridge(struct device *dev,
-					      struct device_node *np,
-					      int type);
-
-#endif
diff --git a/include/drm/bridge/of-display-mode-bridge.h b/include/drm/bridge/of-display-mode-bridge.h
new file mode 100644
index 000000000000..89fcfedf68d8
--- /dev/null
+++ b/include/drm/bridge/of-display-mode-bridge.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2012 Sascha Hauer, Pengutronix
+ */
+
+#ifndef DRM_OF_DISPLAY_MODE_BRIDGE_H
+#define DRM_OF_DISPLAY_MODE_BRIDGE_H
+
+struct device;
+struct device_node;
+struct drm_bridge;
+
+struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev,
+						   struct device_node *np,
+						   int type);
+
+#endif
-- 
2.34.1
Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Luca Ceresoli 1 week, 2 days ago
Hello Damon, Dmitry,

On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
> out of imx/ subdir for multi-platform use. The driver is also renamed
> to make it more generic and suitable for platforms other than i.MX.
>
> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>
> ---
>
> Changes in v7:
> - Rename legacy-bridge to of-display-mode-bridge.
> - Remove unnecessary API drm_bridge_is_legacy().

...

> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
>  	help
>  	  NXP PTN3460 eDP-LVDS bridge chip driver.
>
> +config DRM_OF_DISPLAY_MODE_BRIDGE
> +	tristate
> +	depends on DRM_BRIDGE && OF
> +	help
> +	  This is a DRM bridge implementation that uses of_get_drm_display_mode
> +	  to acquire display mode.
> +
> +	  Newer designs should not use this bridge and should use proper panel
> +	  driver instead.

"Newer designs should not use this bridge", but in patch 8 you are
introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
instead "use proper panel driver instead" in patch 8?

Can you point to the conversation where the converstaion where Dmitry
suggested this change? Maybe it already contains the answer to my
qustion. Also adding a link to that conversation in the commit message
woule be useful.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Damon Ding 1 week ago
Hi Luca,

On 1/31/2026 8:33 PM, Luca Ceresoli wrote:
> Hello Damon, Dmitry,
> 
> On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
>> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
>> out of imx/ subdir for multi-platform use. The driver is also renamed
>> to make it more generic and suitable for platforms other than i.MX.
>>
>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>
>> ---
>>
>> Changes in v7:
>> - Rename legacy-bridge to of-display-mode-bridge.
>> - Remove unnecessary API drm_bridge_is_legacy().
> 
> ...
> 
>> --- a/drivers/gpu/drm/bridge/Kconfig
>> +++ b/drivers/gpu/drm/bridge/Kconfig
>> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
>>   	help
>>   	  NXP PTN3460 eDP-LVDS bridge chip driver.
>>
>> +config DRM_OF_DISPLAY_MODE_BRIDGE
>> +	tristate
>> +	depends on DRM_BRIDGE && OF
>> +	help
>> +	  This is a DRM bridge implementation that uses of_get_drm_display_mode
>> +	  to acquire display mode.
>> +
>> +	  Newer designs should not use this bridge and should use proper panel
>> +	  driver instead.
> 
> "Newer designs should not use this bridge", but in patch 8 you are
> introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
> instead "use proper panel driver instead" in patch 8?
> 
> Can you point to the conversation where the converstaion where Dmitry
> suggested this change? Maybe it already contains the answer to my
> qustion. Also adding a link to that conversation in the commit message
> woule be useful.
> 

First of all, thanks for your reviews on this patch series.

link: 
https://lore.kernel.org/all/xwenycscalzdlpuxytorbiyvej3k7pv3lhxwtadilxq65ipwsv@x5rxm53w5e22/

I think it may be a misleading issue caused by directly copying the 
previous Kconfig description. Now that the new 
devm_drm_of_display_mode_bridge() helper has been added, drivers using 
the panel-bridge framework can rely on it to maintain compatibility with 
legacy display mode parsing.

It would be better to update the comment as follows:

This is a DRM bridge implementation that uses of_get_drm_display_mode to 
acquire display mode.

It exists for compatibility with legacy display mode parsing, in order 
to conform to the panel-bridge framework.

Best regards,
Damon
Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Damon Ding 6 days, 12 hours ago
Hi,

On 2/2/2026 10:54 AM, Damon Ding wrote:
> Hi Luca,
> 
> On 1/31/2026 8:33 PM, Luca Ceresoli wrote:
>> Hello Damon, Dmitry,
>>
>> On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
>>> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
>>> out of imx/ subdir for multi-platform use. The driver is also renamed
>>> to make it more generic and suitable for platforms other than i.MX.
>>>
>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>
>>> ---
>>>
>>> Changes in v7:
>>> - Rename legacy-bridge to of-display-mode-bridge.
>>> - Remove unnecessary API drm_bridge_is_legacy().
>>
>> ...
>>
>>> --- a/drivers/gpu/drm/bridge/Kconfig
>>> +++ b/drivers/gpu/drm/bridge/Kconfig
>>> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
>>>       help
>>>         NXP PTN3460 eDP-LVDS bridge chip driver.
>>>
>>> +config DRM_OF_DISPLAY_MODE_BRIDGE
>>> +    tristate
>>> +    depends on DRM_BRIDGE && OF
>>> +    help
>>> +      This is a DRM bridge implementation that uses 
>>> of_get_drm_display_mode
>>> +      to acquire display mode.
>>> +
>>> +      Newer designs should not use this bridge and should use proper 
>>> panel
>>> +      driver instead.
>>
>> "Newer designs should not use this bridge", but in patch 8 you are
>> introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
>> instead "use proper panel driver instead" in patch 8?
>>
>> Can you point to the conversation where the converstaion where Dmitry
>> suggested this change? Maybe it already contains the answer to my
>> qustion. Also adding a link to that conversation in the commit message
>> woule be useful.
>>
> 
> First of all, thanks for your reviews on this patch series.
> 
> link: https://lore.kernel.org/all/ 
> xwenycscalzdlpuxytorbiyvej3k7pv3lhxwtadilxq65ipwsv@x5rxm53w5e22/
> 
> I think it may be a misleading issue caused by directly copying the 
> previous Kconfig description. Now that the new 
> devm_drm_of_display_mode_bridge() helper has been added, drivers using 
> the panel-bridge framework can rely on it to maintain compatibility with 
> legacy display mode parsing.
> 
> It would be better to update the comment as follows:
> 
> This is a DRM bridge implementation that uses of_get_drm_display_mode to 
> acquire display mode.
> 
> It exists for compatibility with legacy display mode parsing, in order 
> to conform to the panel-bridge framework.
> 

Dmitry, what's you take on this?

Best regards,
Damon

Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Luca Ceresoli 6 days, 3 hours ago
Hello Damon,

On Tue Feb 3, 2026 at 2:31 AM CET, Damon Ding wrote:
> Hi,
>
> On 2/2/2026 10:54 AM, Damon Ding wrote:
>> Hi Luca,
>>
>> On 1/31/2026 8:33 PM, Luca Ceresoli wrote:
>>> Hello Damon, Dmitry,
>>>
>>> On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
>>>> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
>>>> out of imx/ subdir for multi-platform use. The driver is also renamed
>>>> to make it more generic and suitable for platforms other than i.MX.
>>>>
>>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>>
>>>> ---
>>>>
>>>> Changes in v7:
>>>> - Rename legacy-bridge to of-display-mode-bridge.
>>>> - Remove unnecessary API drm_bridge_is_legacy().
>>>
>>> ...
>>>
>>>> --- a/drivers/gpu/drm/bridge/Kconfig
>>>> +++ b/drivers/gpu/drm/bridge/Kconfig
>>>> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
>>>>       help
>>>>         NXP PTN3460 eDP-LVDS bridge chip driver.
>>>>
>>>> +config DRM_OF_DISPLAY_MODE_BRIDGE
>>>> +    tristate
>>>> +    depends on DRM_BRIDGE && OF
>>>> +    help
>>>> +      This is a DRM bridge implementation that uses
>>>> of_get_drm_display_mode
>>>> +      to acquire display mode.
>>>> +
>>>> +      Newer designs should not use this bridge and should use proper
>>>> panel
>>>> +      driver instead.
>>>
>>> "Newer designs should not use this bridge", but in patch 8 you are
>>> introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
>>> instead "use proper panel driver instead" in patch 8?
>>>
>>> Can you point to the conversation where the converstaion where Dmitry
>>> suggested this change? Maybe it already contains the answer to my
>>> qustion. Also adding a link to that conversation in the commit message
>>> woule be useful.
>>>
>>
>> First of all, thanks for your reviews on this patch series.
>>
>> link: https://lore.kernel.org/all/
>> xwenycscalzdlpuxytorbiyvej3k7pv3lhxwtadilxq65ipwsv@x5rxm53w5e22/
>>
>> I think it may be a misleading issue caused by directly copying the
>> previous Kconfig description. Now that the new
>> devm_drm_of_display_mode_bridge() helper has been added, drivers using
>> the panel-bridge framework can rely on it to maintain compatibility with
>> legacy display mode parsing.

Ah, I think I got the point: the mode description in device tree is legacy,
but the driver itself is not legacy and will be current until we need to
support legacy device tree. Correct?

If that's correct, this patch looks OK to me with a new Kconfig help text.

>> It would be better to update the comment as follows:
>>
>> This is a DRM bridge implementation that uses of_get_drm_display_mode to
>> acquire display mode.
>>
>> It exists for compatibility with legacy display mode parsing, in order
>> to conform to the panel-bridge framework.
>>
>
> Dmitry, what's you take on this?

Dmitry's opinion would be much more relevant than mine. I don't know much
myself about this driver.

Luca

--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Damon Ding 5 days, 12 hours ago
Hi Luca,

On 2/3/2026 6:11 PM, Luca Ceresoli wrote:
> Hello Damon,
> 
> On Tue Feb 3, 2026 at 2:31 AM CET, Damon Ding wrote:
>> Hi,
>>
>> On 2/2/2026 10:54 AM, Damon Ding wrote:
>>> Hi Luca,
>>>
>>> On 1/31/2026 8:33 PM, Luca Ceresoli wrote:
>>>> Hello Damon, Dmitry,
>>>>
>>>> On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
>>>>> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
>>>>> out of imx/ subdir for multi-platform use. The driver is also renamed
>>>>> to make it more generic and suitable for platforms other than i.MX.
>>>>>
>>>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
>>>>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
>>>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
>>>>>
>>>>> ---
>>>>>
>>>>> Changes in v7:
>>>>> - Rename legacy-bridge to of-display-mode-bridge.
>>>>> - Remove unnecessary API drm_bridge_is_legacy().
>>>>
>>>> ...
>>>>
>>>>> --- a/drivers/gpu/drm/bridge/Kconfig
>>>>> +++ b/drivers/gpu/drm/bridge/Kconfig
>>>>> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
>>>>>        help
>>>>>          NXP PTN3460 eDP-LVDS bridge chip driver.
>>>>>
>>>>> +config DRM_OF_DISPLAY_MODE_BRIDGE
>>>>> +    tristate
>>>>> +    depends on DRM_BRIDGE && OF
>>>>> +    help
>>>>> +      This is a DRM bridge implementation that uses
>>>>> of_get_drm_display_mode
>>>>> +      to acquire display mode.
>>>>> +
>>>>> +      Newer designs should not use this bridge and should use proper
>>>>> panel
>>>>> +      driver instead.
>>>>
>>>> "Newer designs should not use this bridge", but in patch 8 you are
>>>> introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
>>>> instead "use proper panel driver instead" in patch 8?
>>>>
>>>> Can you point to the conversation where the converstaion where Dmitry
>>>> suggested this change? Maybe it already contains the answer to my
>>>> qustion. Also adding a link to that conversation in the commit message
>>>> woule be useful.
>>>>
>>>
>>> First of all, thanks for your reviews on this patch series.
>>>
>>> link: https://lore.kernel.org/all/
>>> xwenycscalzdlpuxytorbiyvej3k7pv3lhxwtadilxq65ipwsv@x5rxm53w5e22/
>>>
>>> I think it may be a misleading issue caused by directly copying the
>>> previous Kconfig description. Now that the new
>>> devm_drm_of_display_mode_bridge() helper has been added, drivers using
>>> the panel-bridge framework can rely on it to maintain compatibility with
>>> legacy display mode parsing.
> 
> Ah, I think I got the point: the mode description in device tree is legacy,
> but the driver itself is not legacy and will be current until we need to
> support legacy device tree. Correct?
> 
> If that's correct, this patch looks OK to me with a new Kconfig help text.

Right. I want to apply the advanced panel-bridge framework for Exynos DP 
driver, and this newly added API helps handle the legacy device tree 
that it supports.

The v9 will come soon.

> 
>>> It would be better to update the comment as follows:
>>>
>>> This is a DRM bridge implementation that uses of_get_drm_display_mode to
>>> acquire display mode.
>>>
>>> It exists for compatibility with legacy display mode parsing, in order
>>> to conform to the panel-bridge framework.
>>>
>>
>> Dmitry, what's you take on this?
> 
> Dmitry's opinion would be much more relevant than mine. I don't know much
> myself about this driver.
> 

Best regards,
Damon


Re: [PATCH v8 05/18] drm/bridge: Move legacy bridge driver out of imx directory for multi-platform use
Posted by Laurent Pinchart 5 days, 23 hours ago
On Tue, Feb 03, 2026 at 11:11:50AM +0100, Luca Ceresoli wrote:
> On Tue Feb 3, 2026 at 2:31 AM CET, Damon Ding wrote:
> > On 2/2/2026 10:54 AM, Damon Ding wrote:
> >> On 1/31/2026 8:33 PM, Luca Ceresoli wrote:
> >>> On Wed Dec 17, 2025 at 10:33 AM CET, Damon Ding wrote:
> >>>> As suggested by Dmitry, the DRM legacy bridge driver can be pulled
> >>>> out of imx/ subdir for multi-platform use. The driver is also renamed
> >>>> to make it more generic and suitable for platforms other than i.MX.
> >>>>
> >>>> Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
> >>>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
> >>>> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
> >>>>
> >>>> ---
> >>>>
> >>>> Changes in v7:
> >>>> - Rename legacy-bridge to of-display-mode-bridge.
> >>>> - Remove unnecessary API drm_bridge_is_legacy().
> >>>
> >>> ...
> >>>
> >>>> --- a/drivers/gpu/drm/bridge/Kconfig
> >>>> +++ b/drivers/gpu/drm/bridge/Kconfig
> >>>> @@ -244,6 +244,16 @@ config DRM_NXP_PTN3460
> >>>>       help
> >>>>         NXP PTN3460 eDP-LVDS bridge chip driver.
> >>>>
> >>>> +config DRM_OF_DISPLAY_MODE_BRIDGE
> >>>> +    tristate
> >>>> +    depends on DRM_BRIDGE && OF
> >>>> +    help
> >>>> +      This is a DRM bridge implementation that uses
> >>>> of_get_drm_display_mode
> >>>> +      to acquire display mode.
> >>>> +
> >>>> +      Newer designs should not use this bridge and should use proper
> >>>> panel
> >>>> +      driver instead.
> >>>
> >>> "Newer designs should not use this bridge", but in patch 8 you are
> >>> introducing a new use ot devm_drm_of_display_mode_bridge(). Shouldn't you
> >>> instead "use proper panel driver instead" in patch 8?
> >>>
> >>> Can you point to the conversation where the converstaion where Dmitry
> >>> suggested this change? Maybe it already contains the answer to my
> >>> qustion. Also adding a link to that conversation in the commit message
> >>> woule be useful.
> >>>
> >>
> >> First of all, thanks for your reviews on this patch series.
> >>
> >> link: https://lore.kernel.org/all/
> >> xwenycscalzdlpuxytorbiyvej3k7pv3lhxwtadilxq65ipwsv@x5rxm53w5e22/
> >>
> >> I think it may be a misleading issue caused by directly copying the
> >> previous Kconfig description. Now that the new
> >> devm_drm_of_display_mode_bridge() helper has been added, drivers using
> >> the panel-bridge framework can rely on it to maintain compatibility with
> >> legacy display mode parsing.
> 
> Ah, I think I got the point: the mode description in device tree is legacy,
> but the driver itself is not legacy and will be current until we need to
> support legacy device tree. Correct?
> 
> If that's correct, this patch looks OK to me with a new Kconfig help text.

The devm_drm_of_display_mode_bridge() function needs documentation
though, with a warning that tells it must not be used in new drivers.
Catching new users in checkpatch.pl (or somewhere else) would be ideal.

I would also not create a separate module for this and move the function
to drm_bridge.c, but I don't mind that much if the consensus is that a
separate module is better.

> >> It would be better to update the comment as follows:
> >>
> >> This is a DRM bridge implementation that uses of_get_drm_display_mode to
> >> acquire display mode.
> >>
> >> It exists for compatibility with legacy display mode parsing, in order
> >> to conform to the panel-bridge framework.
> >>
> >
> > Dmitry, what's you take on this?
> 
> Dmitry's opinion would be much more relevant than mine. I don't know much
> myself about this driver.

-- 
Regards,

Laurent Pinchart