[RFC v2 PATCH] mipi-dsi-bus: add MIPI DSI bus support
Thierry Reding
thierry.reding at gmail.com
Fri Dec 6 04:54:25 PST 2013
On Thu, Dec 05, 2013 at 04:37:39PM +0200, Tomi Valkeinen wrote:
> On 2013-11-27 12:54, Thierry Reding wrote:
>
> >> I am not sure about hardwiring devices to virtual channels.
> >> There could be devices which uses more than one virtual channel,
> >> in fact exynos-drm docs suggests that such hardware exists.
> >
> > In that case, why not make them two logically separate devices within
> > the kernel. We need the channel number so that the device can be
> > addressed in the first place, so I don't see what's wrong with using
> > that number in the device's name.
> >
> > The whole point of this patch is to add MIPI DSI bus infrastructure, and
> > the virtual channel is one of the fundamental aspects of that bus, so I
> > think we need to make it an integral part of the implementation.
>
> (I speak here more in the context of OMAP display subsystem and CDF, and
> this might not be totally applicable to DRM).
>
> In my opinion, DSI shouldn't be though of in the same way as other buses.
>
> In most of the cases, there's just one DSI peripheral connected. This
> peripheral may answer to multiple DSI VC IDs, though. I don't like the
> idea of having to split one device driver into multiple drivers, just to
> manage multiple DSI VC IDs.
If they respond to multiple VCs, then I suppose they would be logically
separate devices, even if only a single physical device. What would be
the point of addressing them individually if they are just the same
device?
> In some rare cases (I've never seen one in production) there may be a
> DSI hub, and one or two DSI peripherals behind it. But the hub is not
> really a hub, but a router, and the router requires configuration. The
> case here is not really one DSI bus with two or more peripherals, but
> two or more independent 1-to-1 DSI buses.
From the CPUs perspective there's still only one bus. Or perhaps to put
it another way, there is a single address space, because that's what's
implied by how the virtual channel number is defined.
So you would still represent the DSI hub as one device with a specific
VC and the two peripherals behind it with different VC numbers. The VC
number space simply doesn't allow much else to be done.
> I have never seen a pure hub, i.e. something that would just
> forward/broadcast the DSI packet to two or more DSI peripherals.
>
> So I think we should consider DSI as a one-to-one link, and let the DSI
> peripheral manage the VC IDs as it wants.
But doing so would prevent us from supporting setups where we have two
separate peripherals with different VC numbers.
> I don't see any benefit in trying to create a similar linux bus for
> DSI as we have for, say, i2c or spi.
> > Without that fixed virtual channel number we can't use the device in the
> > first place. How are you going to address the device if you don't know
> > its virtual channel?
>
> The DSI peripheral driver must know the VC IDs. Often they are hardcoded
> values, and they can be defined in the driver code.
When you say "often", can you make a guarantee that it will always be
the case? I don't think so. I can easily imagine somebody making the VC
configurable via straps, which would come in handy if you wanted to use
the same IC multiple times within the same design.
In that case you still need some way to specify the VC on a per-board
basis, either in DT or "platform data".
> I don't see why the DSI host driver would need to know the VC IDs, as
> it can't really do anything independently with the peripheral anyway.
> All the transactions should be started by the DSI peripheral driver.
There are things that are standardized in DSI. The core could for
instance try to probe peripherals by reading the DDB.
But even that aside, we'll still need some way to store a device's VC
number somewhere. Even if the DSI host doesn't have any explicit
knowledge about it, you still need to pass it along when you want to
send a message to a device. So when you start a transaction from within
a device driver, you still need to get the VC number from somewhere.
The proposal is to store that number in struct mipi_dsi_device. It's a
logical choice because it is something that characterises a device. It
is also a property of every device, so by storing it within a common
structure gives drivers a standard way of accessing it instead of having
each driver come up with it's own way to store it.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20131206/0e06da03/attachment.pgp>
More information about the dri-devel
mailing list