devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Best practice device tree design for display subsystems/DRM
@ 2013-07-02 17:43 Daniel Drake
  2013-07-02 18:42 ` Jean-Francois Moine
       [not found] ` <CAMLZHHREVEdRuHaD0imRu4pUv15ZyWYF2J9WCBEw-frxBry-Lw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 2 replies; 67+ messages in thread
From: Daniel Drake @ 2013-07-02 17:43 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
  Cc: Jean-François Moine, Russell King, Sebastian Hesselbarth

Hi,

I'm looking into implementing devicetree support in armada_drm and
would like to better understand the best practice here.

Adding DT support for a DRM driver seems to be complicated by the fact
that DRM is not "hotpluggable" - it is not possible for the drm_device
to be initialised without an output, with the output connector/encoder
appearing at some later moment. Instead, the connectors/encoders must
be fully loaded before the drm_driver load function returns. This
means that we cannot drive the individual display components through
individual, separate modules - we need a way to control their load
order.

Looking at existing DRM drivers:

tilcdc_drm takes an approach that each of the components in the
display subsystem (panel, framebuffer, encoder, display controllers)
are separate DT nodes and do not have any DT-level linkage.
It implements just a single module, and that module carefully
initialises things in this order:
 1. Register platform drivers for output components
 2. Register main drm_driver

When the output component's platform drivers get loaded, probes for
such drivers immediately run as they match things in the device tree.
At this point, there is no drm_device available for the outputs to
bind to, so instead, references to these platform devices just get
saved in some global structures.

Later, when the drm_driver gets registered and loaded, the global
structures are consulted to find all of the output devices at the
right moment.


exynos seems to take a the same approach. Components are separate in
the device tree, and each component is implemented as a platform
driver or i2c driver. However all the drivers are built together in
the same module, and the module_init sequence is careful to initialise
all of the output component drivers before loading the DRM driver. The
output component driver store their findings in global structures.



Russell King suggested an alternative design for armada_drm. If all
display components are represented within the same "display"
super-node, we can examine the DT during drm_device initialisation and
initialise the appropriate output components. In this case, the output
components would not be registered as platform drivers.

The end result would be something similar to exynos/tilcdc (i.e.
drm_driver figuring out its output in the appropriate moment), however
the hackyness of using global storage to store output devices before
drm_driver is ready is avoided. And there is the obvious difference in
devicetree layout, which would look something like:

display {
  compatible = "marvell,armada-510-display";
  clocks = <&ext_clk0>, <&lcd_pll_clk>;
  lcd0 {
    compatible = "marvell,armada-510-lcd";
    reg = <0xf1820000 0x1000>;
    interrupts = <47>;
  };
  lcd1 {
    compatible = "marvell,armada-510-lcd";
    reg = <0xf1810000 0x1000>;
    interrupts = <46>;
  };
  dcon {
    compatible = "marvell,armada-510-dcon";
    reg = <...>;
  };
};

Any thoughts/comments?

Thanks
Daniel

^ permalink raw reply	[flat|nested] 67+ messages in thread

end of thread, other threads:[~2013-07-05 11:16 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [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

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).