Re: [RFC PATCH] [media]: of: move graph helpers from drivers/media/v4l2-core to drivers/of

From: Tomi Valkeinen
Date: Mon Mar 10 2014 - 10:10:46 EST


On 10/03/14 15:52, Laurent Pinchart wrote:

> In theory unidirectional links in DT are indeed enough. However, let's not
> forget the following.
>
> - There's no such thing as single start points for graphs. Sure, in some
> simple cases the graph will have a single start point, but that's not a
> generic rule. For instance the camera graphs
> http://ideasonboard.org/media/omap3isp.ps and
> http://ideasonboard.org/media/eyecam.ps have two camera sensors, and thus two
> starting points from a data flow point of view. And if you want a better
> understanding of how complex media graphs can become, have a look at
> http://ideasonboard.org/media/vsp1.0.pdf (that's a real world example, albeit
> all connections are internal to the SoC in that particular case, and don't
> need to be described in DT).
>
> - There's also no such thing as a master device that can just point to slave
> devices. Once again simple cases exist where that model could work, but real
> world examples exist of complex pipelines with dozens of elements all
> implemented by a separate IP core and handled by separate drivers, forming a
> graph with long chains and branches. We thus need real graph bindings.
>
> - Finally, having no backlinks in DT would make the software implementation
> very complex. We need to be able to walk the graph in a generic way without
> having any of the IP core drivers loaded, and without any specific starting
> point. We would thus need to parse the complete DT tree, looking at all nodes
> and trying to find out whether they're part of the graph we're trying to walk.
> The complexity of the operation would be at best quadratic to the number of
> nodes in the whole DT and to the number of nodes in the graph.

I did use plural when I said "to give the start points...".

If you have a list of starting points in the DT, a "graph helper" or
something could create a runtime representation of the graph at some
early phase during the boot, which would include backlinks. The
individual drivers could use that runtime graph, instead of the DT graph.

But it still sounds considerably more complex than double-links in DT.

Tomi


Attachment: signature.asc
Description: OpenPGP digital signature