[RFC v2 0/5] Common Display Framework
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Dec 17 06:58:43 PST 2012
Hi Thierry,
On Friday 23 November 2012 20:56:07 Thierry Reding wrote:
> On Thu, Nov 22, 2012 at 10:45:31PM +0100, Laurent Pinchart wrote:
> [...]
>
> > Display entities are accessed by driver using notifiers. Any driver can
> > register a display entity notifier with the CDF, which then calls the
> > notifier when a matching display entity is registered. The reason for
> > this asynchronous mode of operation, compared to how drivers acquire
> > regulator or clock resources, is that the display entities can use
> > resources provided by the display driver. For instance a panel can be a
> > child of the DBI or DSI bus controlled by the display device, or use a
> > clock provided by that device. We can't defer the display device probe
> > until the panel is registered and also defer the panel device probe until
> > the display is registered. As most display drivers need to handle output
> > devices hotplug (HDMI monitors for instance), handling other display
> > entities through a notification system seemed to be the easiest solution.
> >
> > Note that this brings a different issue after registration, as display
> > controller and display entity drivers would take a reference to each
> > other. Those circular references would make driver unloading impossible.
> > One possible solution to this problem would be to simulate an unplug event
> > for the display entity, to force the display driver to release the dislay
> > entities it uses. We would need a userspace API for that though. Better
> > solutions would of course be welcome.
>
> Maybe I don't understand all of the underlying issues correctly, but a
> parent/child model would seem like a better solution to me. We discussed
> this back when designing the DT bindings for Tegra DRM and came to the
> conclusion that the output resource of the display controller (RGB,
> HDMI, DSI or TVO) was the most suitable candidate to be the parent of
> the panel or display attached to it. The reason for that decision was
> that it keeps the flow of data or addressing of nodes consistent. So the
> chain would look something like this (on Tegra):
>
> CPU
> +-host1x
> +-dc
> +-rgb
> | +-panel
> +-hdmi
> +-monitor
>
> In a natural way this makes the output resource the master of the panel
> or display. From a programming point of view this becomes quite easy to
> implement and is very similar to how other busses like I2C or SPI are
> modelled. In device tree these would be represented as subnodes, while
> with platform data some kind of lookup could be done like for regulators
> or alternatively a board setup registration mechanism like what's in
> place for I2C or SPI.
That works well for panels that have a shared control and video bus (DBI, DSI)
or only a video bus (DPI), but breaks when you need to support panels with
separate control and video busses, such as panels with a parallel data bus and
an I2C or SPI control bus.
Both Linux and DT have a tree-based device model. Devices can have a single
parent, so you can't represent your panel as a child of both the video source
and the control bus master. We have the exact same problem in V4L2 with I2C
camera sensors that output video data on a separate parallel or serial bus,
and we decided to handle the device as a child of its control bus master. This
model makes usage of the Linux power management model easier (but not
straightforward when power management dependencies exist across video busses,
outside of the kernel device tree).
As the common display framework should handle both panels with common control
and video busses and panels with separate busses in a similar fashion, DT
bindings needs to reference the panel through a phandle, even though in some
cases they could technically just be children of the display controller.
--
Regards,
Laurent Pinchart
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20121217/132907d3/attachment-0001.pgp>
More information about the dri-devel
mailing list