Bridges following the new DRM bridge model no longer create a connector
themselves: the display driver has to attach them with
DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one connector for the whole
chain with drm_bridge_connector_init().

Convert komeda to that model, so it keeps working with bridges that
have moved to the new one.

Select DRM_BRIDGE_CONNECTOR for drm_bridge_connector_init() and
DRM_DISPLAY_HELPER, as the bridge connector is only visible when the
display helper is enabled.

Reviewed-by: Liviu Dudau <[email protected]>
Reviewed-by: Kory Maincent <[email protected]>
Signed-off-by: Luo Liu <[email protected]>
---
 drivers/gpu/drm/arm/display/Kconfig              |  2 ++
 drivers/gpu/drm/arm/display/komeda/komeda_crtc.c | 12 +++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/display/Kconfig 
b/drivers/gpu/drm/arm/display/Kconfig
index 415c10a6374b..d88fdd3808be 100644
--- a/drivers/gpu/drm/arm/display/Kconfig
+++ b/drivers/gpu/drm/arm/display/Kconfig
@@ -6,6 +6,8 @@ config DRM_KOMEDA
        select DRM_CLIENT_SELECTION
        select DRM_KMS_HELPER
        select DRM_GEM_DMA_HELPER
+       select DRM_DISPLAY_HELPER
+       select DRM_BRIDGE_CONNECTOR
        select VIDEOMODE_HELPERS
        help
          Choose this option if you want to compile the ARM Komeda display
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c 
b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
index fad278d6ec18..2f277aef0237 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c
@@ -15,6 +15,7 @@
 #include <drm/drm_print.h>
 #include <drm/drm_vblank.h>
 #include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
 #include <drm/drm_panel.h>
 
 #include "komeda_dev.h"
@@ -616,6 +617,8 @@ static int komeda_attach_bridge(struct device *dev,
                                struct komeda_pipeline *pipe,
                                struct drm_encoder *encoder)
 {
+       struct drm_device *drm = encoder->dev;
+       struct drm_connector *connector;
        struct drm_bridge *bridge;
        int err;
 
@@ -625,11 +628,18 @@ static int komeda_attach_bridge(struct device *dev,
                return dev_err_probe(dev, PTR_ERR(bridge), "remote bridge not 
found for pipe: %s\n",
                                     of_node_full_name(pipe->of_node));
 
-       err = drm_bridge_attach(encoder, bridge, NULL, 0);
+       err = drm_bridge_attach(encoder, bridge, NULL,
+                               DRM_BRIDGE_ATTACH_NO_CONNECTOR);
        if (err)
                return dev_err_probe(dev, err, "bridge_attach() failed for 
pipe: %s\n",
                                     of_node_full_name(pipe->of_node));
 
+       connector = drm_bridge_connector_init(drm, encoder);
+       if (IS_ERR(connector))
+               return dev_err_probe(dev, PTR_ERR(connector),
+                                    "bridge connector init failed for pipe: 
%s\n",
+                                    of_node_full_name(pipe->of_node));
+
        return 0;
 }
 
-- 
2.25.1

Reply via email to