devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
To: Sebastian Hesselbarth
	<sebastian.hesselbarth-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: 'Jean-Francois Moine' <moinejf-GANU6spQydw@public.gmane.org>,
	'Daniel Drake' <dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>,
	'Sascha Hauer' <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Inki Dae <inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Subject: Re: Best practice device tree design for display subsystems/DRM
Date: Wed, 3 Jul 2013 12:32:24 +0100	[thread overview]
Message-ID: <20130703113224.GI13924@flint.arm.linux.org.uk> (raw)
In-Reply-To: <51D40275.4020806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Wed, Jul 03, 2013 at 12:52:37PM +0200, Sebastian Hesselbarth wrote:
> But honestly, I see no way around it and it is the only way
> to allow to even have the decision for one or two cards at all.
> There is no way for auto-probing the users intention...

It's not _just_ about the users intention - for get that, because really
it's to do with solving a much bigger question, and that question is:

	How do we know when all the components are present?

In other words, how do we know that we have LCD0 and LCD1 connected to
the DCON, which is connected to a LCD and/or a HDMI tranceiver.  How
do we know that the on-board VGA DACs are wired up and to be used?
How do we know which I2C bus the VGA port is connected to, and whether
to expect an I2C bus?

Let's look at the Cubox setup (sorry, but you _will_ have to use a
fixed-width font for this):

CPU bus
|
+-I2C -------------TDA998X --(HDMI)--> Display
|                    |
|               (RGB888+clock+sync)
+-LCD0 ---------.   /
+--------------DCON ---(VGA)---> not wired
+-LCD1 (unused)-'

DCON can allegedly route the data from LCD0 or LCD1 to the parallel
interface which the TDA998x sits on, and/or the VGA interface.  In
the case of other setups, the TDA998x may be a LCD panel.

The OLPC setup (which seems to be the more common case in terms of the
on-SoC device structure):

CPU bus
|
+-LCD ---(RGB666+clock+sync)----> LCD panel

and I believe an HDMI tranceiver somewhere.

In the above diagrams, "LCD" and "LCD0"/"LCD1" are essentially all the
same basic IP block, so they should use the same driver code.  Moreover,
each named element is a separate platform device.

In the first, to drive that correctly, you need the following before
"loading" the display system:
1. LCD0, and optionally LCD1 and DCON to be found and known to display driver.
2. I2C driver to be probed and available for use.
3. TDA998x to be found and known to display driver.
Only once you have all those components can you allow display to "load".

Now consider the case where the TDA998x is not present but the parallel
interface is connected directly to a LCD panel.  This then becomes:
1. LCD0, and optionally LCD1 and DCON to be found and known to display driver.
2. LCD panel details known to display driver.

If the VGA port is being used, then both of these cases need to be
supplemented with:
N. I2C bus for VGA DDC to be probed and available for use.
N+1. DCON must be known to the display driver.
N+2. LCD1 required if different display modes on the devices are required.

In the OLPC case, it's just:
1. LCD to be found and known to display driver.
2. LCD panel details known to display driver.

What you should be getting from the above is that the platform devices
which are required for any kind of display subsystem driver to initialize
is not really a function of the "software" use case, but how (a) the
board hardware has been designed and put together, and (b) the internal
structure of the SoC.

Moreover, the problem which we're facing is this: how does a display
driver know which platform devices to expect from a DT description to
make the decision that all parts required for the physical wiring of
the board are now present.

Consider this too: what if you have a LCD panel on your RGB888 interface
which is also connected to a HDMI transceiver which can do scaling and
re-syncing (basically format conversion - the TDA998x appears to have
this capability), and you drive it with a mode suitable for HDMI but not
the LCD panel because the driver doesn't know that there's a LCD panel
also connected?  This is why I feel that the hotplug idea is actually
rather unsafe, and if we go down that path we're building in that risk.

(And I think the OLPC guys may be have exactly that kind of setup...)

-- 
Russell King

  parent reply	other threads:[~2013-07-03 11:32 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-02 17:43 Best practice device tree design for display subsystems/DRM Daniel Drake
2013-07-02 18:42 ` Jean-Francois Moine
2013-07-02 19:19   ` Russell King
     [not found]     ` <20130702191923.GD13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-02 19:57       ` Sebastian Hesselbarth
     [not found]         ` <51D330AC.5060903-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-02 20:25           ` Russell King
     [not found]             ` <20130702202548.GE13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-02 21:50               ` Sascha Hauer
2013-07-02 22:02                 ` Dave Airlie
     [not found]                   ` <CAPM=9ty8W7wEewLpcKjNV-RXzVnReKVrPu_MGN80=Y-xPr-f+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-02 22:14                     ` Russell King
     [not found]                       ` <20130702221445.GF13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03  7:33                         ` Sascha Hauer
2013-07-03  1:46                     ` Stéphane Marchesin
     [not found]                       ` <CACP_E++-L_Ntv=ZpkrSjB4y4GRc=WNDdXLeQAxb5NWniD3Frfg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-03  2:56                         ` Rob Clark
2013-07-03  6:42                         ` Inki Dae
2013-07-03 12:31                       ` Lucas Stach
2013-07-03  6:55                     ` Sascha Hauer
     [not found]                       ` <20130703065559.GJ516-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-03  8:20                         ` Sebastian Hesselbarth
2013-07-05  8:37               ` Grant Likely
     [not found]                 ` <CACxGe6uTv2yaTH-_JLa=vtgmXwq=++wz3=eDpkRr2GVbKaME1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05  8:50                   ` Russell King
     [not found]                     ` <20130705085020.GV13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-05  9:02                       ` Grant Likely
2013-07-02 21:04           ` Daniel Drake
     [not found]             ` <CAMLZHHTbkfxmzrSrAU586Ywxptk=4Njzb0_puWxhfBcmBB0BWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-02 21:41               ` Sebastian Hesselbarth
     [not found]                 ` <51D348F5.2080205-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-03  8:57                   ` Inki Dae
     [not found]                     ` <00ae01ce77cb$524d57f0$f6e807d0$%dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-07-03  9:02                       ` Sascha Hauer
2013-07-04 15:11                         ` Rob Clark
     [not found]                           ` <CAF6AEGuzwNJtuAWS29YvdZ1fiMGk5cuv24n4wxkKsDPT8FrDBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-04 21:28                             ` Dave Airlie
2013-07-05  0:50                               ` Alex Deucher
     [not found]                         ` <20130703090242.GM516-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-03  9:08                           ` Sebastian Hesselbarth
     [not found]                             ` <51D3EA0E.2090008-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-03  9:48                               ` Inki Dae
     [not found]                                 ` <00ba01ce77d2$80285f10$80791d30$%dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-07-03  9:53                                   ` Russell King
     [not found]                                     ` <20130703095338.GH13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03 10:52                                       ` Sebastian Hesselbarth
     [not found]                                         ` <51D40275.4020806-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-03 11:32                                           ` Russell King [this message]
     [not found]                                             ` <20130703113224.GI13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03 17:38                                               ` Sebastian Hesselbarth
2013-07-03 11:43                                           ` Inki Dae
     [not found]                                             ` <00cc01ce77e2$844b3a80$8ce1af80$%dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-07-03 11:51                                               ` Sebastian Hesselbarth
     [not found]                                                 ` <51D4105C.3070503-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04  7:05                                                   ` Inki Dae
     [not found]                                                     ` <000601ce7884$e99ade20$bcd09a60$%dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-07-04  7:25                                                       ` Sebastian Hesselbarth
     [not found]                                                         ` <51D5234C.3070000-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04  8:15                                                           ` Inki Dae
2013-07-03 12:04                                               ` Russell King
     [not found]                                                 ` <20130703120458.GJ13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-04  2:03                                                   ` Inki Dae
2013-07-03  9:52                           ` Russell King
     [not found]                             ` <20130703095248.GG13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03 11:12                               ` Sebastian Hesselbarth
2013-07-03 11:29                               ` Sascha Hauer
2013-07-04  8:33                             ` Sascha Hauer
     [not found]                               ` <20130704083307.GH10414-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04  8:40                                 ` Russell King
     [not found]                                   ` <20130704084052.GP13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-04  8:58                                     ` Sascha Hauer
     [not found]                                       ` <20130704085817.GZ516-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04  9:11                                         ` Russell King
     [not found]                                           ` <20130704091131.GR13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-04  9:30                                             ` Sascha Hauer
     [not found]                                               ` <20130704093047.GJ10414-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04  9:44                                                 ` Sebastian Hesselbarth
     [not found]                                                   ` <51D54409.6020608-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04 10:09                                                     ` Sascha Hauer
     [not found]                                                       ` <20130704100932.GL10414-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04 10:58                                                         ` Sebastian Hesselbarth
2013-07-05 10:07                                                           ` Sascha Hauer
     [not found]                                                             ` <20130705100750.GJ516-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-05 10:41                                                               ` Grant Likely
2013-07-04  8:45                                 ` Sebastian Hesselbarth
     [not found]                                   ` <51D53634.5040405-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04  8:53                                     ` Sascha Hauer
     [not found]                                       ` <20130704085313.GY516-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04  9:10                                         ` Sebastian Hesselbarth
     [not found]                                           ` <51D53C0B.6060106-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04  9:23                                             ` Sascha Hauer
     [not found]                                               ` <20130704092305.GI10414-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-07-04  9:40                                                 ` Sebastian Hesselbarth
     [not found]                                                   ` <51D54301.8080902-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-04  9:57                                                     ` Sascha Hauer
2013-07-04  9:08                                 ` Russell King
     [not found]                                   ` <20130704090829.GQ13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-04  9:51                                     ` Sascha Hauer
2013-07-05  8:43                           ` Grant Likely
     [not found]                             ` <CACxGe6uRJ9B9qnPT_KLNphg-n2WeA9UFO-rvCdKJHijGqJ8SOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05  9:34                               ` Sebastian Hesselbarth
     [not found]                                 ` <51D69324.90301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-05  9:51                                   ` Grant Likely
     [not found]                                     ` <CACxGe6v_oQptLZzgsT_nf-K4680mP1f8sHJHN8AekeEy0_T18w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-05 11:16                                       ` Sebastian Hesselbarth
     [not found] ` <CAMLZHHREVEdRuHaD0imRu4pUv15ZyWYF2J9WCBEw-frxBry-Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-02 18:43   ` Russell King
     [not found]     ` <20130702184305.GB13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-02 18:54       ` Daniel Drake
     [not found]         ` <CAMLZHHSU1OVrQrtucTNn4AmTCiNER19njvQdomxTcXAzqxCi4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-02 19:08           ` Russell King
     [not found]             ` <20130702190809.GC13924-f404yB8NqCZvn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2013-07-03  8:06               ` Inki Dae

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=20130703113224.GI13924@flint.arm.linux.org.uk \
    --to=rmk-lfz/pmaqli7xmaaqvzeohq@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org \
    --cc=inki.dae-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=moinejf-GANU6spQydw@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=sebastian.hesselbarth-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).