Skip to content

Commit

Permalink
drm: bridge: simple-bridge: Make connector creation optional
Browse files Browse the repository at this point in the history
Make the connector creation optional to enable usage of the
simple-bridge with the DRM bridge connector helper.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200526011505.31884-8-laurent.pinchart+renesas@ideasonboard.com
  • Loading branch information
Laurent Pinchart authored and Sam Ravnborg committed Jun 23, 2020
1 parent 00686ac commit 567e0d5
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions drivers/gpu/drm/bridge/simple-bridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,14 @@ static int simple_bridge_attach(struct drm_bridge *bridge,
struct simple_bridge *sbridge = drm_bridge_to_simple_bridge(bridge);
int ret;

if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) {
DRM_ERROR("Fix bridge driver to make connector optional!");
return -EINVAL;
}

ret = drm_bridge_attach(bridge->encoder, sbridge->next_bridge, bridge,
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
if (ret < 0)
return ret;

if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)
return 0;

if (!bridge->encoder) {
DRM_ERROR("Missing encoder\n");
return -ENODEV;
Expand All @@ -131,8 +129,7 @@ static int simple_bridge_attach(struct drm_bridge *bridge,
return ret;
}

drm_connector_attach_encoder(&sbridge->connector,
bridge->encoder);
drm_connector_attach_encoder(&sbridge->connector, bridge->encoder);

return 0;
}
Expand Down

0 comments on commit 567e0d5

Please sign in to comment.