devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Maxime Ripard <mripard@kernel.org>
Cc: Keith Zhao <keith.zhao@starfivetech.com>,
	dri-devel@lists.freedesktop.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,  linux-riscv@lists.infradead.org,
	linux-media@vger.kernel.org,  linaro-mm-sig@lists.linaro.org,
	 Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Sumit Semwal <sumit.semwal@linaro.org>,
	 Emil Renner Berthing <kernel@esmil.dk>,
	Shengyang Chen <shengyang.chen@starfivetech.com>,
	 Conor Dooley <conor+dt@kernel.org>,
	Albert Ou <aou@eecs.berkeley.edu>,
	 Thomas Zimmermann <tzimmermann@suse.de>,
	Jagan Teki <jagan@edgeble.ai>, Rob Herring <robh+dt@kernel.org>,
	 Chris Morgan <macromorgan@hotmail.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	 Bjorn Andersson <andersson@kernel.org>,
	Changhuang Liang <changhuang.liang@starfivetech.com>,
	 Jack Zhu <jack.zhu@starfivetech.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	 Shawn Guo <shawnguo@kernel.org>,
	christian.koenig@amd.com
Subject: Re: [PATCH v2 6/6] drm/vs: Add hdmi driver
Date: Thu, 26 Oct 2023 11:57:22 +0300	[thread overview]
Message-ID: <CAA8EJppxQ7J8DEDFsWzPL8bDpNW-KY0nhUA++zDBRpMCpP-bkA@mail.gmail.com> (raw)
In-Reply-To: <3twc4zoohon7uujypgjtlnryfmebx4osvpykagnwr5nemmqz2w@w4vw55uswebh>

On Thu, 26 Oct 2023 at 11:07, Maxime Ripard <mripard@kernel.org> wrote:
>
> On Thu, Oct 26, 2023 at 01:23:53AM +0300, Dmitry Baryshkov wrote:
> > > +static int starfive_hdmi_register(struct drm_device *drm, struct starfive_hdmi *hdmi)
> > > +{
> > > +   struct drm_encoder *encoder = &hdmi->encoder;
> > > +   struct device *dev = hdmi->dev;
> > > +
> > > +   encoder->possible_crtcs = drm_of_find_possible_crtcs(drm, dev->of_node);
> > > +
> > > +   /*
> > > +    * If we failed to find the CRTC(s) which this encoder is
> > > +    * supposed to be connected to, it's because the CRTC has
> > > +    * not been registered yet.  Defer probing, and hope that
> > > +    * the required CRTC is added later.
> > > +    */
> > > +   if (encoder->possible_crtcs == 0)
> > > +           return -EPROBE_DEFER;
> > > +
> > > +   drm_encoder_helper_add(encoder, &starfive_hdmi_encoder_helper_funcs);
> > > +
> > > +   hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD;
> > > +
> > > +   drm_connector_helper_add(&hdmi->connector,
> > > +                            &starfive_hdmi_connector_helper_funcs);
> > > +   drmm_connector_init(drm, &hdmi->connector,
> > > +                       &starfive_hdmi_connector_funcs,
> > > +                       DRM_MODE_CONNECTOR_HDMIA,
> >
> > On an embedded device one can not be so sure. There can be MHL or HDMI
> > Alternative Mode. Usually we use drm_bridge here and drm_bridge_connector.
>
> On an HDMI driver, it's far from being a requirement, especially given
> the limitations bridges have.

It's a blessing that things like MHL / HDMI-in-USB-C / HDMI-to-MyDP
are not widely used in the wild and are mostly non-existing except
several phones that preate wide DP usage.
Using drm_connector directly prevents one from handling possible
modifications on the board level. For example, with the DRM connector
in place, handling a separate HPD GPIO will result in code duplication
from the hdmi-connector driver. Handling any other variations in the
board design (which are pretty common in the embedded world) will also
require changing the driver itself. drm_bridge / drm_bridge_connector
save us from those issues.

BTW: what are the limitations of the drm_bridge wrt. HDMI output? I'm
asking because we heavily depend on the bridge infrastructure for HDMI
output. Maybe we are missing something there, which went unnoticed to
me and my colleagues.

-- 
With best wishes
Dmitry

  reply	other threads:[~2023-10-26  8:57 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 10:39 [PATCH v2 0/6] DRM driver for verisilicon Keith Zhao
2023-10-25 10:39 ` [PATCH v2 1/6] dt-bindings: display: Add yamls for JH7110 display system Keith Zhao
2023-10-25 12:50   ` Krzysztof Kozlowski
2023-11-29  3:13     ` Keith Zhao
2023-11-29  8:14       ` Krzysztof Kozlowski
2023-10-25 10:39 ` [PATCH v2 2/6] riscv: dts: starfive: jh7110: add dc controller and hdmi node Keith Zhao
2023-10-25 13:38   ` Emil Renner Berthing
2023-10-25 10:39 ` [PATCH v2 3/6] drm/fourcc: Add drm/vs tiled modifiers Keith Zhao
2023-10-25 13:50   ` Emil Renner Berthing
2023-10-25 15:28   ` Dmitry Baryshkov
2023-10-25 15:38   ` Simon Ser
2023-10-25 15:44     ` Simon Ser
2023-11-15 14:12       ` Keith Zhao
2023-10-25 10:39 ` [PATCH v2 4/6] drm/vs: Register DRM device Keith Zhao
2023-10-25 13:55   ` Emil Renner Berthing
2023-10-25 15:50   ` Dmitry Baryshkov
2023-10-25 10:39 ` [PATCH v2 5/6] drm/vs: Add KMS crtc&plane Keith Zhao
2023-10-25 13:57   ` Maxime Ripard
2023-11-15 14:52     ` Keith Zhao
2023-10-25 19:28   ` Dmitry Baryshkov
2023-10-25 19:49     ` Ville Syrjälä
2023-10-26  9:42       ` Keith Zhao
2023-10-26 10:09         ` Keith Zhao
2023-11-14 10:42     ` Keith Zhao
2023-11-14 10:59       ` Dmitry Baryshkov
2023-11-15 13:30         ` Keith Zhao
2023-11-15 16:00           ` Dmitry Baryshkov
2023-11-24 13:40   ` Thomas Zimmermann
2023-10-25 10:39 ` [PATCH v2 6/6] drm/vs: Add hdmi driver Keith Zhao
2023-10-25 14:07   ` Maxime Ripard
2023-10-25 22:23   ` Dmitry Baryshkov
2023-10-26  8:07     ` Maxime Ripard
2023-10-26  8:57       ` Dmitry Baryshkov [this message]
2023-10-26 11:53         ` Maxime Ripard
2023-10-29 16:52           ` Dmitry Baryshkov
2023-11-07  9:19             ` Maxime Ripard
2023-11-13 12:11     ` Keith Zhao
2023-11-13 13:31       ` Dmitry Baryshkov
2023-11-14  8:27         ` Keith Zhao

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=CAA8EJppxQ7J8DEDFsWzPL8bDpNW-KY0nhUA++zDBRpMCpP-bkA@mail.gmail.com \
    --to=dmitry.baryshkov@linaro.org \
    --cc=andersson@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=changhuang.liang@starfivetech.com \
    --cc=christian.koenig@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jack.zhu@starfivetech.com \
    --cc=jagan@edgeble.ai \
    --cc=keith.zhao@starfivetech.com \
    --cc=kernel@esmil.dk \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=macromorgan@hotmail.com \
    --cc=mripard@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=shengyang.chen@starfivetech.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    /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).