devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-samsung-soc@vger.kernel.org"
	<linux-samsung-soc@vger.kernel.org>,
	Sean Paul <seanpaul@google.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	sunil joshi <joshi@samsung.com>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	Ajay kumar <ajaynumb@gmail.com>,
	Prashanth G <prashanth.g@samsung.com>,
	Ajay Kumar <ajaykumar.rs@samsung.com>
Subject: Re: [PATCH V6 6/8] drm/bridge: Modify drm_bridge core to support driver model
Date: Tue, 23 Sep 2014 07:36:36 +0200	[thread overview]
Message-ID: <20140923053635.GA30514@ulmo> (raw)
In-Reply-To: <3478703.M4FqhaqXMa@avalon>


[-- Attachment #1.1: Type: text/plain, Size: 9128 bytes --]

On Tue, Sep 23, 2014 at 03:29:13AM +0300, Laurent Pinchart wrote:
> Hi Thierry,
> 
> On Monday 22 September 2014 09:40:38 Thierry Reding wrote:
> > On Wed, Sep 17, 2014 at 12:27:13PM +0300, Laurent Pinchart wrote:
> > > On Wednesday 17 September 2014 14:37:30 Ajay kumar wrote:
> > > > On Mon, Sep 15, 2014 at 11:07 PM, Laurent Pinchart wrote:
> > > > > Hi Ajay,
> > > > > 
> > > > > Thank you for the patch.
> > > > > 
> > > > > I think we're moving in the right direction, but we're not there yet.
> > > > > 
> > > > > On Saturday 26 July 2014 00:52:08 Ajay Kumar wrote:
> > > > >> This patch tries to seperate drm_bridge implementation
> > > > >> into 2 parts, a drm part and a non_drm part.
> > > > >> 
> > > > >> A set of helper functions are defined in this patch to make
> > > > >> bridge driver probe independent of the drm flow.
> > > > >> 
> > > > >> The bridge devices register themselves on a lookup table
> > > > >> when they get probed by calling "drm_bridge_add_for_lookup".
> > > > >> 
> > > > >> The parent encoder driver waits till the bridge is available in the
> > > > >> lookup table(by calling "of_drm_find_bridge") and then continues with
> > > > >> its initialization.
> > > > > 
> > > > > Before the introduction of the component framework I would have said
> > > > > this is the way to go. Now, I think bridges should register themselves
> > > > > as components, and the DRM master driver should use the component
> > > > > framework to get a reference to the bridges it needs.
> > > > 
> > > > Well, I have modified the bridge framework exactly the way Thierry
> > > > wanted it to be, I mean the same way the current panel framework is.
> > > > And, I don't think there is a problem with that.
> > > > What problem are you facing with current bridge implementation?
> > > > What is the advantage of using the component framework to register
> > > > bridges?
> > > 
> > > There are several advantages.
> > > 
> > > - The component framework has been designed with this exact problem in
> > > mind, piecing multiple components into a display device.
> > 
> > No. Component framework was designed with multi-device drivers in mind.
> > That is, drivers that need to combine two or more platform devices into
> > a single logical device. Typically that includes display controllers and
> > encoders (in various looks) for DRM.
> 
> I disagree. AFAIK the component framework was designed to easily combine
> multiple devices into a single logical device, regardless of which bus each
> device is connected to. That's what makes the component framework useful : it
> allows master drivers to build logical devices from heterogeneous components
> without having to use one API per bus and/or component type.

But this doesn't work really well once you leave the SoC. For component/
master to work you need to usually (i.e. using DT) have access to a
device tree node for each of the devices so that you can create a list
of needed devices. Once you leave the SoC, the number of combinations
that you can have becomes non-deterministic. A driver that wants to pull
this off would need to more or less manually look up phandles and
traverse from SoC via bridges to panels to find all the devices that
make up the logical device.

>                                                              If the only goal
> had been to combine platform devices on an SoC, simpler device-specific 
> solutions would likely have been used instead.

I think one of the goals was to replace any of the simpler device-
specific solutions with a generic one.

But one of the issues with component/master is that it's viral. That is
it requires users to register as master themselves in order to pull in
the components. While that makes sense for on-SoC devices I think it's a
mistake to use it for external hardware like bridges and panels that can
be shared across SoCs. If we make component/master mandatory for bridges
and panels, then we also force every driver that wants to use them to
implement component/master support.

Furthermore I did try a while back to convert the Tegra DRM driver to
use component/master and couldn't make it work. When I proposed patches
to enhance the API so that it would work for Tegra I got silence on one
side and "just keep using what you currently have" on the other side. So
in other words since I can't use component/master on Tegra it means that
whatever driver gets added that registers a component can't be used on
Tegra either.

> > Panels and bridges are in my opinion different because they are outside
> > of the DRM driver. They aren't part of the device complex that an SoC
> > provides. They represent hardware that is external to the SoC and the
> > DRM driver and can be shared across SoCs.
> 
> They represent hardware external to the SoC, but internal to the logical DRM 
> device.

That depends largely on how you look at it. From my point of view the
logical DRM device stops at the connector (well I think it actually
stops somewhat earlier already, with connector only being the handle
through which the outputs are configured).

Panels are, at least theoretically, hotpluggable. That is, if you have a
device that has both a panel and HDMI but you never use HDMI, then you
should be able to just unload the panel driver but keep the DRM device
running for HDMI. If you use component/master that's impossible because
as soon as the panel component goes away the complete DRM device goes
away.

> > Forcing panels and bridges to register as components will require all
> > drivers to implement master/component support solely for accessing this
> > external hardware.
> > 
> > What you're suggesting is like saying that clocks or regulators should
> > register as components so that their users can get them that way. In
> > fact by that argument everything that's referenced by phandle would need
> > to register as component (PHYs, LEDs, GPIOs, I2C controllers, ...).
> 
> No, that's very different. The device you list are clearly external resources, 
> while the bridges and panels are components part of a logical display device.

Like I said above, I consider bridges and panels external resources,
too. I can easily imagine (actually I don't have to because it was
recently discussed for a project) setups where some board defines a
standard header that display modules can be connected to and hence
whatever bridges or panels are attached can change at runtime.

> > > This patch set introduces yet another framework, without any compelling
> > > reason as far as I can see. Today DRM drivers already need to use three
> > > different frameworks (component, I2C slave encoder and panel), and we're
> > > adding a fourth oneto make the mess even messier.
> > 
> > Panel and bridge aren't really frameworks. Rather they are a simple
> > registry to allow drivers to register panels and bridges and display
> > drivers to look them up.
> 
> Regardless of how you call them, we have three interfaces.

We need an interface to control the bridges and panels anyway. component
and master only gives you a generic way to handle the registration and
initialization.

Adding a drm_*_lookup() function to the interface to retrieve a resource
isn't as bloated as you make it out to be. Implementing component/master
is much more complicated for (in this case) too little advantage.

> > > This is really a headlong rush, we need to stop and fix the  design
> > > mistakes.
> >
> > Can you point out specific design mistakes? I don't see any, but I'm
> > obviously biased.
> 
> The slave encoder / bridge split is what I consider a design mistake. Those 
> two interfaces serve the same purpose, they should really be merged.

Agreed.

> > > - The component framework solves the probe ordering problem. Bridges can
> > > use deferred probing, but when a bridge requires a resources (such as a
> > > clock for instance) provided by the display controller, this will break.
> > 
> > Panel and bridges can support deferred probing without the component
> > framework just fine.
> 
> Not if the bridge requires a clock provided by the display controller, in
> which case there's a dependency loop.

I don't see how component/master would solve that differently than the
current proposal for DRM bridge (or the existing DRM panel for that
matter).

> > > > Without this patchset, you cannot bring an X server based display on
> > > > snow and peach_pit. Also, day by day the number of platforms using
> > > > drm_bridge is increasing.
> > > 
> > > That's exactly why I'd like to use the component framework now, as the
> > > conversion will become more complex as time goes by.
> > 
> > No it won't. If we ever do decide that component framework is a better
> > fit then the conversion may be more work but it would still be largely
> > mechanical.
> 
> Are you volunteering to perform the conversion ? :-)

No. I'm still convinced that we won't need it. Less work for everyone.
=)

Thierry

[-- Attachment #1.2: Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2014-09-23  5:36 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 19:22 [PATCH V6 0/8] drm/exynos: few patches to enhance bridge chip support Ajay Kumar
2014-07-25 19:22 ` [PATCH V6 1/8] drm/panel: Add prepare, unprepare and get_modes routines Ajay Kumar
2014-07-30 10:00   ` Thierry Reding
2014-07-30 10:29     ` Ajay kumar
2014-07-25 19:22 ` [PATCH V6 2/8] drm/panel: Add support for prepare and unprepare routines Ajay Kumar
2014-07-30 10:32   ` Thierry Reding
2014-07-30 11:09     ` Ajay kumar
2014-07-25 19:22 ` [PATCH V6 3/8] drm/panel: simple: Add support for auo_b133htn01 panel Ajay Kumar
2014-07-30 10:51   ` Thierry Reding
2014-07-30 11:32     ` Ajay kumar
2014-07-30 13:30       ` Thierry Reding
2014-07-30 13:42         ` Ajay kumar
2014-07-25 19:22 ` [PATCH V6 4/8] drm/exynos: Move DP setup into commit() Ajay Kumar
2014-07-30 10:52   ` Thierry Reding
2014-07-30 12:05     ` Ajay kumar
2014-07-25 19:22 ` [PATCH V6 5/8] drm/exynos: dp: Modify driver to support drm_panel Ajay Kumar
2014-07-30 10:58   ` Thierry Reding
2014-07-25 19:22 ` [PATCH V6 6/8] drm/bridge: Modify drm_bridge core to support driver model Ajay Kumar
2014-07-30 11:19   ` Thierry Reding
2014-07-30 14:31     ` Ajay kumar
2014-07-30 15:08       ` Thierry Reding
2014-07-30 16:03         ` Ajay kumar
2014-07-31 10:58           ` Thierry Reding
2014-08-22 23:33             ` Javier Martinez Canillas
2014-08-25  6:11               ` Ajay kumar
2014-08-25 10:10                 ` Javier Martinez Canillas
2014-09-15 17:37   ` Laurent Pinchart
2014-09-17  9:07     ` Ajay kumar
2014-09-17  9:22       ` Dave Airlie
2014-09-17  9:27       ` Laurent Pinchart
2014-09-17 13:15         ` Ajay kumar
2014-09-22  7:40         ` Thierry Reding
2014-09-23  0:29           ` Laurent Pinchart
2014-09-23  5:36             ` Thierry Reding [this message]
2014-07-25 19:22 ` [PATCH V2 7/8] drm/bridge: Add i2c based driver for ptn3460 bridge Ajay Kumar
2014-07-30 12:05   ` Thierry Reding
2014-07-30 15:16     ` Ajay kumar
2014-07-30 15:40       ` Thierry Reding
2014-07-30 16:14         ` Ajay kumar
2014-07-31 11:21           ` Thierry Reding
2014-07-25 19:22 ` [PATCH V6 8/8] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge Ajay Kumar
2014-07-29 11:29   ` Andreas Färber
2014-07-30  6:27     ` Ajay kumar
2014-07-30 13:11   ` Thierry Reding
2014-07-27 18:22 ` [PATCH V6 0/8] drm/exynos: few patches to enhance bridge chip support Andreas Färber
2014-07-28  6:13   ` Ajay kumar
2014-07-29 11:21     ` Andreas Färber
2014-07-29 11:36       ` Thierry Reding
2014-07-29 11:42         ` Andreas Färber
2014-07-29 11:47           ` Thierry Reding
2014-07-30  6:24             ` Ajay kumar
2014-07-30  9:40               ` Thierry Reding
2014-07-30 10:24                 ` Ajay kumar
2014-07-30 13:16                   ` Thierry Reding
2014-09-17  9:53                 ` Laurent Pinchart
2014-09-17 10:13                   ` Ajay kumar
2014-09-18  9:54                     ` Laurent Pinchart
2014-07-29 11:43         ` Thierry Reding
2014-07-30  6:21       ` Ajay kumar
2014-07-30 19:32         ` Andreas Färber
2014-07-31  8:38           ` Ajay kumar
2014-07-31  8:57             ` Andreas Färber
2014-07-31 10:07               ` Ajay kumar
2014-07-31 10:23               ` Thierry Reding
2014-07-31 10:28                 ` Andreas Färber
2014-07-31 14:22                 ` Andreas Färber
2014-08-01  7:02                   ` Ajay kumar
2014-08-01 12:13                     ` Andreas Färber
2014-08-01 14:57                     ` Andreas Färber
2014-07-30  9:56 ` Thierry Reding

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=20140923053635.GA30514@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=ajaykumar.rs@samsung.com \
    --cc=ajaynumb@gmail.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=joshi@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=prashanth.g@samsung.com \
    --cc=seanpaul@google.com \
    /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).