drm: rcar-du: Use drm_bridge_connector_init() helper
Use the drm_bridge_connector_init() helper to create a drm_connector for each output, instead of relying on the bridge drivers doing so. Attach the bridges with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to instruct them not to create a connector. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> # On V3U Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
This commit is contained in:
parent
d0f44e0dac
commit
c24110a8fd
1 changed files with 21 additions and 5 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include <drm/drm_bridge.h>
|
#include <drm/drm_bridge.h>
|
||||||
|
#include <drm/drm_bridge_connector.h>
|
||||||
#include <drm/drm_crtc.h>
|
#include <drm/drm_crtc.h>
|
||||||
#include <drm/drm_managed.h>
|
#include <drm/drm_managed.h>
|
||||||
#include <drm/drm_modeset_helper_vtables.h>
|
#include <drm/drm_modeset_helper_vtables.h>
|
||||||
|
@ -53,7 +54,9 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
|
||||||
struct device_node *enc_node)
|
struct device_node *enc_node)
|
||||||
{
|
{
|
||||||
struct rcar_du_encoder *renc;
|
struct rcar_du_encoder *renc;
|
||||||
|
struct drm_connector *connector;
|
||||||
struct drm_bridge *bridge;
|
struct drm_bridge *bridge;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Locate the DRM bridge from the DT node. For the DPAD outputs, if the
|
* Locate the DRM bridge from the DT node. For the DPAD outputs, if the
|
||||||
|
@ -103,9 +106,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu,
|
||||||
|
|
||||||
renc->output = output;
|
renc->output = output;
|
||||||
|
|
||||||
/*
|
/* Attach the bridge to the encoder. */
|
||||||
* Attach the bridge to the encoder. The bridge will create the
|
ret = drm_bridge_attach(&renc->base, bridge, NULL,
|
||||||
* connector.
|
DRM_BRIDGE_ATTACH_NO_CONNECTOR);
|
||||||
*/
|
if (ret) {
|
||||||
return drm_bridge_attach(&renc->base, bridge, NULL, 0);
|
dev_err(rcdu->dev, "failed to attach bridge for output %u\n",
|
||||||
|
output);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create the connector for the chain of bridges. */
|
||||||
|
connector = drm_bridge_connector_init(&rcdu->ddev, &renc->base);
|
||||||
|
if (IS_ERR(connector)) {
|
||||||
|
dev_err(rcdu->dev,
|
||||||
|
"failed to created connector for output %u\n", output);
|
||||||
|
return PTR_ERR(connector);
|
||||||
|
}
|
||||||
|
|
||||||
|
return drm_connector_attach_encoder(connector, &renc->base);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue