From: Daniel Vetter <daniel@ffwll.ch>
To: Andrzej Hajda <a.hajda@samsung.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>,
Russell King - ARM Linux <linux@armlinux.org.uk>,
DRI Development <dri-devel@lists.freedesktop.org>,
Lubomir Rintel <lkundrak@v3.sk>, Peter Rosin <peda@axentia.se>
Subject: Re: Armada DRM: bridge with componentized devices
Date: Mon, 7 Jan 2019 17:08:33 +0100 [thread overview]
Message-ID: <20190107160833.GL21184@phenom.ffwll.local> (raw)
In-Reply-To: <0cb02a2d-ec74-3c0f-dcf6-f7b9b1210190@samsung.com>
On Mon, Jan 07, 2019 at 12:26:58PM +0100, Andrzej Hajda wrote:
> On 07.01.2019 11:45, Daniel Vetter wrote:
> > On Thu, Jan 03, 2019 at 01:11:47PM +0000, Russell King - ARM Linux wrote:
> >> On Thu, Jan 03, 2019 at 10:47:27AM +0100, Lubomir Rintel wrote:
> >>> Hello,
> >>>
> >>> lately I've been trying to make the Himax HX8837 chip that drives the OLPC
> >>> LCD display work with Armada DRM driver. I've been advised to create a
> >>> bridge driver and not an encoder driver since the silicon is separate from
> >>> the LCDC.
> >>>
> >>> The Armada DRM driver (and, I think, the i.MX one) creates the drm_device
> >>> once the component infrastructure sees the necessary sub-devices appear.
> >>> The sub-devices being the LCDCs and the encoders (not bridges) that it
> >>> expects to be created externally.
> >>>
> >>> Currently, it seems, the only driver that can actually work with this (that
> >>> is -- creates a drm_encoder for a drm_device when the component is bound)
> >>> is the tda998x. All other similar drivers create a drm_bridge instead and
> >>> not use the component infrastructure at all. (In fact, tilcdc driver
> >>> contains a hack to handle tda998x specially.)
> >>>
> >>> I'm wondering how to reconcile the two?
> >>>
> >>> * The tda998x driver has recently been modified to create a bridge on probe
> >>> and eventually encoder on component bind. Is this an okay thing to do in
> >>> a new driver? (this probably means the tilcdc hack can be removed...)
> >>>
> >>> * If a non-componentized bridge were to be used (along with a dummy
> >>> encoder), at what point would it make sense to look for the bridge?
> >>> Would it be a good idea to defer the probe of crtc until a bridge can be
> >>> looked up and the attach it on component bind? What if the bridge goes
> >>> away (a module is unloaded, etc.) in between?
> >>>
> >>> I'd be thankful for opintions and advice before I move ahead with this.
> >> This is the long-standing problem with the conflict between bridge
> >> support and component support, and I'm not sure that there is really
> >> any answer to it.
> >>
> >> I've gone into the details of the two several times on the list,
> >> particularly about the short-comings of the bridge approach, but it
> >> seems no one cares to fix those short-comings.
> >>
> >> You are re-identifying some of the issues that I've already pointed
> >> out - such as what happens to DRM drives when the bridge driver is
> >> unbound (it's really not about modules being unloaded, and the problem
> >> can't be solved by taking a module reference count - all that the
> >> module reference count does is ensure that the module doesn't go
> >> away unexpected, there is no way to ensure that the device isn't
> >> unbound.)
> >>
> >> The issue of unbinding is precisely the issue which the component
> >> support was created to solve - but everyone seems to prefer the buggy
> >> bridge approach, and no one seems willing to do anything about the
> >> bugs or even acknowledge that it's a problem. It's strange - if one
> >> identifies bugs that result in kernel oops in other kernel subsystems,
> >> one is generally taken seriously and the problem is solved.
> > Unbinding is really not the most important feature, especially for SoC. If
> > you feel different, working together with others, getting some agreement,
> > getting the patches reviewed and finding someone to get them merged is
> > very much appreciated. But just complaining won't move this forward.
> >
> >> The issue about the encoders is something that I've tried to discuss,
> >> and I've pointed out that moving it into the DRM driver adds additional
> >> complexity there, and I'd hoped that my patch set I posted would've
> >> generated discussion, but alas not.
> >>
> >> What I'm not prepared to do is to introduce _known_ bugs into any
> >> driver that I maintain.
> > I thought last time around the idea was to use device links (and teach
> > drm_bridge about them), so that the unloading works correctly.
>
>
> With current device_links implementation registering links in probe of
> the consumer is just incorrect - it can happen that neither consumer
> neither provider is fully probed and creating device links in such state
> is wrong according to docs, and my experiments. See [1] for discussion
> and [2] for docs.
We could set up the device link only at drm_dev_register time. At that point
we know that driver loading has fully succeeded. We do have a list of
bridges at hand, so that's not going to be an issue.
The only case where this breaks is if a driver is still using the
deprecated ->load callback. But that ->load callback doesn't mix well with
EDEFER_PROBE/component framework anyway, so I think not going to be a
problem hopefully?
-Daniel
>
>
> [1]: https://patchwork.freedesktop.org/patch/218878/
>
> [2]:
> https://www.kernel.org/doc/html/latest/driver-api/device_link.html#usage
>
>
> Regards
>
> Andrzej
>
>
> >
> > Wrt tda988x: I think it really shouldn't create a drm_encoder, nor
> > register as a component. Fixing that is probably a bit more work.
> > -Daniel
>
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-01-07 16:08 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 9:47 Armada DRM: bridge with componentized devices Lubomir Rintel
2019-01-03 13:11 ` Russell King - ARM Linux
2019-01-07 10:45 ` Daniel Vetter
2019-01-07 11:26 ` Andrzej Hajda
2019-01-07 16:08 ` Daniel Vetter [this message]
2019-01-07 16:27 ` Andrzej Hajda
2019-01-07 21:56 ` Daniel Vetter
2019-01-08 8:35 ` Andrzej Hajda
2019-01-08 8:47 ` Daniel Vetter
2019-01-08 9:22 ` Andrzej Hajda
2019-01-08 10:23 ` Russell King - ARM Linux
2019-01-08 10:32 ` Andrzej Hajda
2019-01-08 10:24 ` Daniel Vetter
2019-01-08 11:25 ` Andrzej Hajda
2019-01-08 11:38 ` Russell King - ARM Linux
2019-01-08 12:27 ` Andrzej Hajda
2019-01-08 13:21 ` Russell King - ARM Linux
2019-01-08 13:34 ` Daniel Vetter
2019-01-08 14:33 ` Andrzej Hajda
2019-01-08 15:07 ` Russell King - ARM Linux
2019-01-08 18:07 ` Daniel Vetter
2019-01-09 9:12 ` Andrzej Hajda
2019-01-09 9:24 ` Rafael J. Wysocki
2019-01-09 9:30 ` Russell King - ARM Linux
2019-01-11 14:20 ` Daniel Vetter
2019-01-11 14:26 ` Rafael J. Wysocki
2019-01-11 14:32 ` Russell King - ARM Linux
2019-01-11 14:36 ` Daniel Vetter
2019-01-11 14:40 ` Rafael J. Wysocki
2019-01-11 14:36 ` Rafael J. Wysocki
2019-01-11 14:49 ` Russell King - ARM Linux
2019-01-14 12:32 ` Rafael J. Wysocki
2019-01-15 0:04 ` Rafael J. Wysocki
2019-01-15 22:47 ` Rafael J. Wysocki
2019-01-16 18:42 ` Daniel Vetter
2019-01-16 22:43 ` Rafael J. Wysocki
2019-01-17 12:20 ` Daniel Vetter
2019-01-18 9:36 ` Lucas Stach
2019-01-18 10:03 ` Rafael J. Wysocki
2019-01-18 11:06 ` Daniel Vetter
2019-01-18 11:17 ` Rafael J. Wysocki
2019-01-18 11:37 ` Rafael J. Wysocki
2019-01-18 12:57 ` Daniel Vetter
2019-01-24 11:00 ` Rafael J. Wysocki
2019-01-17 17:26 ` Russell King - ARM Linux admin
2019-01-17 22:43 ` Rafael J. Wysocki
2019-01-18 11:07 ` Linus Walleij
2019-01-08 10:16 ` Russell King - ARM Linux
2019-01-08 10:31 ` Daniel Vetter
2019-01-07 16:12 ` Russell King - ARM Linux
2019-01-07 21:55 ` Daniel Vetter
2019-01-08 0:39 ` Russell King - ARM Linux
2019-01-08 14:29 ` Liviu Dudau
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=20190107160833.GL21184@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=Liviu.Dudau@arm.com \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux@armlinux.org.uk \
--cc=lkundrak@v3.sk \
--cc=peda@axentia.se \
/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