From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> To: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Subject: [PATCH v2 4/4] drm: rcar-du: Use drm_bridge_connector_init() helper Date: Wed, 16 Dec 2020 02:50:21 +0200 [thread overview] Message-ID: <20201216005021.19518-5-laurent.pinchart+renesas@ideasonboard.com> (raw) In-Reply-To: <20201216005021.19518-1-laurent.pinchart+renesas@ideasonboard.com> 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> --- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c index ba8c6038cd63..10a66091391a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c @@ -11,6 +11,7 @@ #include <linux/slab.h> #include <drm/drm_bridge.h> +#include <drm/drm_bridge_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_managed.h> #include <drm/drm_modeset_helper_vtables.h> @@ -61,6 +62,7 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, struct device_node *enc_node) { struct rcar_du_encoder *renc; + struct drm_connector *connector; struct drm_bridge *bridge; int ret; @@ -122,9 +124,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, if (ret) return ret; - /* - * Attach the bridge to the encoder. The bridge will create the - * connector. - */ - return drm_bridge_attach(&renc->base, bridge, NULL, 0); + /* Attach the bridge to the encoder. */ + ret = drm_bridge_attach(&renc->base, bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (ret) { + 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); } -- Regards, Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> To: dri-devel@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org, Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Subject: [PATCH v2 4/4] drm: rcar-du: Use drm_bridge_connector_init() helper Date: Wed, 16 Dec 2020 02:50:21 +0200 [thread overview] Message-ID: <20201216005021.19518-5-laurent.pinchart+renesas@ideasonboard.com> (raw) In-Reply-To: <20201216005021.19518-1-laurent.pinchart+renesas@ideasonboard.com> 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> --- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 25 ++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c index ba8c6038cd63..10a66091391a 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_encoder.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_encoder.c @@ -11,6 +11,7 @@ #include <linux/slab.h> #include <drm/drm_bridge.h> +#include <drm/drm_bridge_connector.h> #include <drm/drm_crtc.h> #include <drm/drm_managed.h> #include <drm/drm_modeset_helper_vtables.h> @@ -61,6 +62,7 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, struct device_node *enc_node) { struct rcar_du_encoder *renc; + struct drm_connector *connector; struct drm_bridge *bridge; int ret; @@ -122,9 +124,22 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, if (ret) return ret; - /* - * Attach the bridge to the encoder. The bridge will create the - * connector. - */ - return drm_bridge_attach(&renc->base, bridge, NULL, 0); + /* Attach the bridge to the encoder. */ + ret = drm_bridge_attach(&renc->base, bridge, NULL, + DRM_BRIDGE_ATTACH_NO_CONNECTOR); + if (ret) { + 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); } -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-12-16 0:52 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-12-16 0:50 [PATCH v2 0/4] Converter R-Car DU to the DRM bridge connector helper Laurent Pinchart 2020-12-16 0:50 ` Laurent Pinchart 2020-12-16 0:50 ` [PATCH v2 1/4] drm: rcar-du: lvds: Convert to DRM panel bridge helper Laurent Pinchart 2020-12-16 0:50 ` Laurent Pinchart 2020-12-16 13:16 ` Jacopo Mondi 2020-12-16 13:16 ` Jacopo Mondi 2020-12-16 13:49 ` Laurent Pinchart 2020-12-16 13:49 ` Laurent Pinchart 2020-12-16 14:44 ` Jacopo Mondi 2020-12-16 14:44 ` Jacopo Mondi 2020-12-16 0:50 ` [PATCH v2 2/4] drm: bridge: dw-hdmi: Attach to next bridge if available Laurent Pinchart 2020-12-16 0:50 ` Laurent Pinchart 2020-12-16 0:50 ` [PATCH v2 3/4] drm: rcar-du: dw-hdmi: Set output port number Laurent Pinchart 2020-12-16 0:50 ` Laurent Pinchart 2020-12-16 0:50 ` Laurent Pinchart [this message] 2020-12-16 0:50 ` [PATCH v2 4/4] drm: rcar-du: Use drm_bridge_connector_init() helper Laurent Pinchart 2020-12-16 11:53 ` Jacopo Mondi 2020-12-16 11:53 ` Jacopo Mondi 2020-12-16 13:54 ` Laurent Pinchart 2020-12-16 13:54 ` Laurent Pinchart
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201216005021.19518-5-laurent.pinchart+renesas@ideasonboard.com \ --to=laurent.pinchart+renesas@ideasonboard.com \ --cc=dri-devel@lists.freedesktop.org \ --cc=kieran.bingham+renesas@ideasonboard.com \ --cc=linux-renesas-soc@vger.kernel.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.