From: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Thierry Reding <thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH v2 2/2] drm/tegra: output: rgb: Don't register connector if bridge is used
Date: Wed, 15 Apr 2020 01:20:07 +0300 [thread overview]
Message-ID: <20200414222007.31306-3-digetx@gmail.com> (raw)
In-Reply-To: <20200414222007.31306-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
We rely on the connector that is created by the bridge, and thus, the
Tegra's output connector is not needed in this case because it will be
an unused connector.
Signed-off-by: Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/gpu/drm/tegra/rgb.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
index 4be4dfd4a68a..6e6b3fee1d87 100644
--- a/drivers/gpu/drm/tegra/rgb.c
+++ b/drivers/gpu/drm/tegra/rgb.c
@@ -275,21 +275,32 @@ int tegra_dc_rgb_init(struct drm_device *drm, struct tegra_dc *dc)
if (!dc->rgb)
return -ENODEV;
+ drm_encoder_init(drm, &output->encoder, &tegra_rgb_encoder_funcs,
+ DRM_MODE_ENCODER_LVDS, NULL);
+ drm_encoder_helper_add(&output->encoder,
+ &tegra_rgb_encoder_helper_funcs);
+
+ /*
+ * We don't create a parent "output bridge" that sets the
+ * DRM_BRIDGE_ATTACH_NO_CONNECTOR flag for drm_bridge_attach(),
+ * and thus, the bridge creates connector for us in this case.
+ * The output's connector is unused and not needed if bridge is
+ * used, so skip the connector's registration in this case.
+ */
+ if (output->bridge)
+ goto init_output;
+
drm_connector_init(drm, &output->connector, &tegra_rgb_connector_funcs,
DRM_MODE_CONNECTOR_LVDS);
drm_connector_helper_add(&output->connector,
&tegra_rgb_connector_helper_funcs);
output->connector.dpms = DRM_MODE_DPMS_OFF;
- drm_encoder_init(drm, &output->encoder, &tegra_rgb_encoder_funcs,
- DRM_MODE_ENCODER_LVDS, NULL);
- drm_encoder_helper_add(&output->encoder,
- &tegra_rgb_encoder_helper_funcs);
-
drm_connector_attach_encoder(&output->connector,
&output->encoder);
drm_connector_register(&output->connector);
+init_output:
err = tegra_output_init(drm, output);
if (err < 0) {
dev_err(output->dev, "failed to initialize output: %d\n", err);
--
2.26.0
next prev parent reply other threads:[~2020-04-14 22:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-14 22:20 [PATCH v2 0/2] Support DRM bridges on NVIDIA Tegra Dmitry Osipenko
[not found] ` <20200414222007.31306-1-digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-04-14 22:20 ` [PATCH v2 1/2] drm/tegra: output: Support DRM bridges Dmitry Osipenko
2020-04-14 22:20 ` Dmitry Osipenko [this message]
2020-04-15 9:53 ` [PATCH v2 0/2] Support DRM bridges on NVIDIA Tegra Sam Ravnborg
[not found] ` <20200415095324.GB30444-uyr5N9Q2VtJg9hUCZPvPmw@public.gmane.org>
2020-04-15 16:00 ` Dmitry Osipenko
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=20200414222007.31306-3-digetx@gmail.com \
--to=digetx-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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).