Hi Laurent,

> IMHO it is leaving (mature) dw-hdmi untouched and make attachment of a 
> connector
> in ingenic_drm_bind() depend on some condition.

Since I don't know details of the DRM bridge/encoder/connector APIs), 
let me reformulate the quersion for a condition specifically.

How can one find out in this code fragment from Paul's patch
if drm_brige_attach() did create a connector or not?

I.e. did call drm_connector_attach_encoder(connector, hdmi->bridge.encoder);
on its own?

@@ -1154,20 +1186,36 @@ static int ingenic_drm_bind(struct device *dev, bool 
has_components)
                        bridge = devm_drm_panel_bridge_add_typed(dev, panel,
                                                                 
DRM_MODE_CONNECTOR_DPI);

                drm_encoder_helper_add(encoder, 
&ingenic_drm_encoder_helper_funcs);

-               ret = drm_bridge_attach(encoder, bridge, NULL, 0);
-               if (ret)
+               ib->bridge.funcs = &ingenic_drm_bridge_funcs;
+               ib->next_bridge = bridge;
+
+               ret = drm_bridge_attach(encoder, &ib->bridge, NULL,
+                                       DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+               if (ret) {
+                       dev_err(dev, "Unable to attach bridge\n");
                        return ret;
+               }
+
+               connector = drm_bridge_connector_init(drm, encoder);
+               if (IS_ERR(connector)) {
+                       dev_err(dev, "Unable to init connector\n");
+                       return PTR_ERR(connector);
+               }
+
+               drm_connector_attach_encoder(connector, encoder);
        }

A problem may be that "connector" is unknown before drm_bridge_connector_init()
is called.

Then I think I can propose a fallback solution to drm_bridge_attach(, 0) if
drm_bridge_attach(, DRM_BRIDGE_ATTACH_NO_CONNECTOR) fails. 

BR and thanks,
Nikolaus

Reply via email to