From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
dri-devel@lists.freedesktop.org
Cc: linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v3 4/4] drm: rcar-du: Use drm_bridge_connector_init() helper
Date: Tue, 22 Jun 2021 23:17:29 +0100 [thread overview]
Message-ID: <0d59a0d4-2201-210a-fc4e-fd67dd756d88@ideasonboard.com> (raw)
In-Reply-To: <20210520065046.28978-5-laurent.pinchart+renesas@ideasonboard.com>
Hi Laurent,
On 20/05/2021 07:50, Laurent Pinchart wrote:
> 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>
Aha, this is the one that fixed my issues!
Looks good, and tests well ;-)
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
> ---
> Changes since v2:
>
> - Declare ret variable
> ---
> drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 26 ++++++++++++++++++-----
> 1 file changed, 21 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 ca3761772211..0daa8bba50f5 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>
> @@ -53,7 +54,9 @@ 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;
>
> /*
> * 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;
>
> - /*
> - * 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);
> }
>
next prev parent reply other threads:[~2021-06-22 22:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-20 6:50 [PATCH v3 0/4] Converter R-Car DU to the DRM bridge connector helper Laurent Pinchart
2021-05-20 6:50 ` [PATCH v3 1/4] drm: bridge: dw-hdmi: Attach to next bridge if available Laurent Pinchart
2021-06-22 22:07 ` Kieran Bingham
2021-05-20 6:50 ` [PATCH v3 2/4] drm: rcar-du: lvds: Convert to DRM panel bridge helper Laurent Pinchart
2021-06-22 22:10 ` Kieran Bingham
2021-08-10 15:47 ` Geert Uytterhoeven
2021-08-10 15:51 ` Geert Uytterhoeven
2021-08-22 0:01 ` Laurent Pinchart
2021-05-20 6:50 ` [PATCH v3 3/4] drm: rcar-du: dw-hdmi: Set output port number Laurent Pinchart
2021-06-22 22:14 ` Kieran Bingham
2021-05-20 6:50 ` [PATCH v3 4/4] drm: rcar-du: Use drm_bridge_connector_init() helper Laurent Pinchart
2021-06-22 22:17 ` Kieran Bingham [this message]
2021-06-22 21:53 ` [PATCH v3 0/4] Converter R-Car DU to the DRM bridge connector helper Kieran Bingham
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=0d59a0d4-2201-210a-fc4e-fd67dd756d88@ideasonboard.com \
--to=kieran.bingham@ideasonboard.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=laurent.pinchart+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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).