[PATCH] drm/lcdif: switch to DRM_BRIDGE_ATTACH_NO_CONNECTOR

Dmitry Baryshkov dmitry.baryshkov at linaro.org
Mon Jun 24 10:31:46 UTC 2024


Existing in-kernel device trees use LCDIF with the dsim + adv7533, dsim
+ tc358762 or with ldb + panel_bridge. All these combinations support
using DRM_BRIDGE_ATTACH_NO_CONNECTOR for bridge attachment.

Change lcdif driver to use this flag when attaching the bridge and
create drm_bridge_connector afterwards.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov at linaro.org>
---
Note: compile-tested only.
---
 drivers/gpu/drm/mxsfb/lcdif_drv.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mxsfb/lcdif_drv.c b/drivers/gpu/drm/mxsfb/lcdif_drv.c
index 0f895b8a99d6..1d5508449995 100644
--- a/drivers/gpu/drm/mxsfb/lcdif_drv.c
+++ b/drivers/gpu/drm/mxsfb/lcdif_drv.c
@@ -16,6 +16,7 @@
 
 #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>
@@ -48,6 +49,7 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 {
 	struct device *dev = lcdif->drm->dev;
 	struct device_node *ep;
+	struct drm_connector *connector;
 	struct drm_bridge *bridge;
 	int ret;
 
@@ -96,13 +98,23 @@ static int lcdif_attach_bridge(struct lcdif_drm_private *lcdif)
 			return ret;
 		}
 
-		ret = drm_bridge_attach(encoder, bridge, NULL, 0);
+		ret = drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR);
 		if (ret) {
 			of_node_put(ep);
 			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)) {
+			ret = PTR_ERR(connector);
+			of_node_put(ep);
+
+			return dev_err_probe(dev, ret,
+					     "Failed to create bridge connector for endpoint%u\n",
+					     of_ep.id);
+		}
 	}
 
 	return 0;

---
base-commit: f76698bd9a8ca01d3581236082d786e9a6b72bb7
change-id: 20240624-mxc-lcdif-bridge-attach-60368807b2f9

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov at linaro.org>



More information about the dri-devel mailing list