<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 1:50 PM, Tomasz Figa <span dir="ltr"><<a href="mailto:tomasz.figa@gmail.com" target="_blank">tomasz.figa@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sean,<br>
<div><div class="h5"><br>
On Tuesday 29 of October 2013 16:36:47 Sean Paul wrote:<br>
> On Mon, Oct 28, 2013 at 7:13 PM, Tomasz Figa <<a href="mailto:tomasz.figa@gmail.com">tomasz.figa@gmail.com</a>><br>
wrote:<br>
> > Hi,<br>
> ><br>
> > On Wednesday 23 of October 2013 12:09:06 Sean Paul wrote:<br>
> >> On Wed, Oct 23, 2013 at 11:53 AM, Dave Airlie <<a href="mailto:airlied@gmail.com">airlied@gmail.com</a>><br>
wrote:<br>
> >> >>>>> I think we need to start considering a framework where<br>
> >> >>>>> subdrivers<br>
> >> >>>>> just<br>
> >> >>>>> add drm objects themselves, then the toplevel node is<br>
> >> >>>>> responsible<br>
> >> >>>>> for<br>
> >> >>>>> knowing that everything for the current configuration is<br>
> >> >>>>> loaded.<br>
> >> >>>><br>
> >> >>>> It would be nice to specify the various pieces in dt, then have<br>
> >> >>>> some<br>
> >> >>>> type of drm notifier to the toplevel node when everything has<br>
> >> >>>> been<br>
> >> >>>> probed. Doing it in the dt would allow standalone<br>
> >> >>>> drm_bridge/drm_panel<br>
> >> >>>> drivers to be transparent as far as the device's drm driver is<br>
> >> >>>> concerned.<br>
> >> >>>><br>
> >> >>>> Sean<br>
> >> >>>><br>
> >> >>>>> I realise we may need to make changes to the core drm to allow<br>
> >> >>>>> this<br>
> >> >>>>> but we should probably start to create a strategy for fixing<br>
> >> >>>>> the<br>
> >> >>>>> API<br>
> >> >>>>> issues that this throws up.<br>
> >> >>>>><br>
> >> >>>>> Note I'm not yet advocating for dynamic addition of nodes once<br>
> >> >>>>> the<br>
> >> >>>>> device is in use, or removing them.<br>
> >> >>><br>
> >> >>> I do wonder if we had some sort of tag in the device tree for any<br>
> >> >>> nodes<br>
> >> >>> involved in the display, and the core drm layer would read that<br>
> >> >>> list,<br>
> >> >>> and when every driver registers tick things off, and when the<br>
> >> >>> last<br>
> >> >>> one<br>
> >> >>> joins we get a callback and init the drm layer, we'd of course<br>
> >> >>> have<br>
> >> >>> the<br>
> >> >>> basic drm layer setup prior to that so we can add the objects as<br>
> >> >>> the<br>
> >> >>> drivers load. It might make development a bit trickier as you'd<br>
> >> >>> need<br>
> >> >>> to make sure someone claimed ownership of all the bits for init<br>
> >> >>> to<br>
> >> >>> proceed.>><br>
> >> >><br>
> >> >> Yeah, that's basically what the strawman looked like in my head.<br>
> >> >><br>
> >> >> Instead of a property in each node, I was thinking of having a<br>
> >> >> separate gfx pipe nodes that would have dt pointers to the various<br>
> >> >> pieces involved in that pipe. This would allow us to associate<br>
> >> >> standalone entities like bridges and panels with encoders in dt<br>
> >> >> w/o<br>
> >> >> doing it in the drm code. I *think* this should be Ok with the dt<br>
> >> >> guys<br>
> >> >> since it is still describing the hardware, but I think we'd have<br>
> >> >> to<br>
> >> >> make sure it wasn't drm-specific.<br>
> >> ><br>
> >> > I suppose the question is how much dynamic pipeline construction<br>
> >> > there<br>
> >> > is,<br>
> >> ><br>
> >> > even on things like radeon and i915 we have dynamic clock generator<br>
> >> > to<br>
> >> > crtc to encoder setups, so I worry about static lists per-pipe, so<br>
> >> > I<br>
> >> > still think just stating all these devices are needed for display<br>
> >> > and<br>
> >> > a list of valid interconnections between them, then we can have the<br>
> >> > generic code model drm crtc/encoders/connectors on that list, and<br>
> >> > construct the possible_crtcs /possible_clones etc at that stage.<br>
> >><br>
> >> I'm, without excuse, hopeless at devicetree, so there are probably<br>
> >> some violations, but something like:<br>
> >><br>
> >> display-pipelines {<br>
> >><br>
> >> required-elements = <&bridge-a &panel-a &encoder-x &encoder-y<br>
> >><br>
> >> &crtc-x &crtc-y>;<br>
> >><br>
> >> pipe1 {<br>
> >><br>
> >> bridge = <&bridge-a>;<br>
> >> encoder = <&encoder-x>;<br>
> >> crtc = <&crtc-y>;<br>
> >><br>
> >> };<br>
> >> pipe2 {<br>
> >><br>
> >> encoder = <&encoder-x>;<br>
> >> crtc = <&crtc-x>;<br>
> >><br>
> >> };<br>
> >> pipe3 {<br>
> >><br>
> >> panel = <&panel-a>;<br>
> >> encoder = <&encoder-y>;<br>
> >> crtc = <&crtc-y>;<br>
> >><br>
> >> };<br>
> >><br>
> >> };<br>
> >><br>
> >> I'm tempted to add connector to the pipe nodes as well, so it's<br>
> >> obvious which connector should be used in cases where multiple<br>
> >> entities in the pipe implement drm_connector. However, I'm not sure<br>
> >> if<br>
> >> that would be NACKed by dt people.<br>
> >><br>
> >> I'm also not sure if there are too many combinations for i915 and<br>
> >> radeon to make this unreasonable. I suppose those devices could just<br>
> >> use required-elements and leave the pipe nodes out.<br>
> ><br>
> > Just to put my two cents in, as one of the people involved into "the<br>
> > device tree movement", I'd say that instead of creating artifical<br>
> > entities, such as display-pipelines and all of the pipeX'es, device<br>
> > tree should represent relations between nodes.<br>
> ><br>
> > According to the generic DT bindings we already have for<br>
> > video-interfaces<br>
> > [1] your example connection layout would look as follows:<br>
> Hi Tomasz<br>
> Thanks for sending this along.<br>
><br>
> I think the general consensus is that each drm driver should be<br>
> implemented as a singular driver. That is, N:1 binding to driver<br>
> mapping, where there are N IP blocks. Optional devices (such as<br>
> bridges, panels) probably make sense to spin off as standalone<br>
> drivers.<br>
<br>
</div></div>I believe this is a huge step backwards from current kernel design<br>
standards, which prefer modularity.<br>
<br>
Having multiple IPs being part of the DRM subsystem in a SoC, it would be<br>
nice to have the possibility to compile just a subset of support for them<br>
into the kernel and load rest of them as modules. (e.g. basic LCD<br>
controller on a mobile phone compiled in and external connectors, like<br>
HDMI as modules)<br>
<br>
Not even saying that from development perspective, a huge single driver<br>
would be much more difficult to test and debug, than several smaller<br>
drivers, which could be developed separately.<br></blockquote><div><br></div><div>This is the opposite of our experience, though. A series of small drivers like what's in drm/exynos can become really tedious/difficult to coordinate. If you have separate drivers, everything needs to be synchronized, but also has to account for potentially different loading order.</div>
<div><br></div><div>It seems you're only thinking about the basic case, where you only support a single resolution, no dpms, no suspend to ram... But when you want full fledged functionality, then the issues I described become much more prevalent.</div>
<div><br></div><div>Stéphane</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Unless there is a misunderstanding here, I think this is broken.<br>
<div class="im"><br>
> An example: exynos_drm_drv would be a platform_driver which implements<br>
> drm_driver. On drm_load, it would enumerate the various dt nodes for<br>
> its IP blocks and initialize them with direct calls (like<br>
> exynos_drm_fimd_initialize). If the board uses a bridge (say for<br>
> eDP->LVDS), that bridge driver would be a real driver with its own<br>
> probe.<br>
><br>
> I think the ideal situation would be for the drm layer to manage the<br>
> standalone drivers in a way that is transparent to the main driver,<br>
> such that it doesn't need to know which type of hardware can hang off<br>
> it. It will need to know if one exists since it might need to forego<br>
> creating a connector, but it need not know anything else about it.<br>
><br>
> To accomplish this, I think we need:<br>
> (1) Some way for drm to enumerate the standalone drivers, so it can<br>
> know when all of them have been probed<br>
> (2) A drm registration function that's called by the standalone<br>
> drivers once they're probed, and a hook with drm_device pointer called<br>
> during drm_load for them to register their drm_* implementations<br>
> (3) Something that will allow for deferred probe if the main driver<br>
> kicks off before the standalones are in, it would need to be called<br>
> before drm_platform/pci_init<br>
><br>
> I think we'll need to expand on the media bindings to achieve (1).<br>
<br>
</div>Could you elaborate on why you think so?<br>
<br>
I believe the video interface bindings contain everything needed for this<br>
case, except, of course, some device/bus specific parts, but those are to<br>
be defined by separate device/bus specific bindings.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
Tomasz<br>
<br>
_______________________________________________<br>
dri-devel mailing list<br>
<a href="mailto:dri-devel@lists.freedesktop.org">dri-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/dri-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/dri-devel</a><br>
</div></div></blockquote></div><br></div></div>