All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien BERAUD <julien.beraud@parrot.com>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: <linux-media@vger.kernel.org>
Subject: Re: Configurable Video Controller Driver
Date: Thu, 31 Jul 2014 10:53:45 +0200	[thread overview]
Message-ID: <53DA0419.2090405@parrot.com> (raw)
In-Reply-To: <20140721111432.GQ16460@valkosipuli.retiisi.org.uk>

Hi Sakari,
Thank you for your answer.
Le 21/07/2014 13:14, Sakari Ailus a écrit :
> Hi Julien,
>
> On Thu, Jul 10, 2014 at 04:19:06PM +0200, Julien BERAUD wrote:
>> We are developing a driver for our video controller which has the
>> particularity of being very reconfigurable.
>>
>> We have reached a point at which the complexity and variety of the
>> applications we need to implement forces us to
>> design an api/library that allows us to configure the
>> interconnection of the different video processing units(Camera
>> interfaces,
>> LCD interfaces, scalers, rotators, demosaicing, dead pixel
>> correction, etc...) from userland.
>>
>> The media controller api has the limitation of not being able to
>> create links but just browsing and activating/deactivating them.
>> If we just allowed a user to activate/deactivate links, then we
>> would have to declare all the possible connections between
>> the different blocks, which would make it very confusing from a
>> userland point of view. Moreover, the interconnection constraints
>> would have to be dealt with very generically, which would make it
>> very difficult in the kernel too.
> How many different blocks do you have? Can they be connected in arbitrary
> ways? If not, what kind of limitations do you have?
>
> The Media controller is originally intended for modelling complex devices
> with hardware data paths between the sub-blocks. The question is: does your
> device fit into that group, even if could be a little more complex than the
> devices that are currently supported?
We have 44 different hardware blocks that can be connected in arbitrary 
ways but with some constraints. Some of the blocks have several 
inputs(blenders) and some(one type only) have 2 outputs(the block is a 
fork).
There are some limitations. Some blocks only accept Raw Bayer as 
input(ISP). There are some small limitations here and there, like if you 
use a scaler with a high scaling factor, you need to go to memory 
because the internal memory is not sufficient.
Some of the blocks are FIFOs to write/read to memory.
In the end, there are 6 camera inputs and 2 lcd outputs, all of them 
parallel, 2 ISPs with 2 blocks each(bayer/yuv), and 2 stat calculators, 
12 Fifos, 4 color converters, 2 blenders with 4 inputs each, 2 
scalers/rotators, 4 forks, 2 sat, 2 I3D, 2 gamma converters.

Our device might be a little more complex than the devices that are 
currently supported, though I am not aware of all the currently 
supported devices.

Something else, the Media controller doesn't allow to create links from 
userland, which is what I think we would need in order to avoid to 
declare all the possible combinations because that would be hard to 
understand in userland and complicated to handle in the kernel.

We have come from a totally rigid interconnection declared in the BSP to 
become more and more generic but it is probable that becoming too 
generic wouldn't make things any better.


>
>> The conclusion we have reached yet is that we have to design an API
>> that allows us to create v4l2 subdevices that have certain
>> capabilities(scaling,rotating, demosaicing, etc...) and then to
>> create links between them from a userland library.
> Can you create arbitrary devices at will, or do these devices exist on
> hardware all the time?
>
The devices exist on hardware at all time. What I would like to do is to 
create "virtual" subdevices that have some of the capabilities provided 
by the blocks in order to benefit from all the features the hardware 
provides in order to have a media controller tree that is clear and that 
fits the needs of the current application. We are currently thinking 
about designing a kernel driver along with a userland library that 
allows us to reconfigure our hardware paths in order to create those 
virtual subdevices and then expose them with the Media Controller/V4L2 
subdev api.

I have tried to bring the topic up on the  v4l irc because it is a 
complicated matter. I will try again.

There may be a better way to handle such a complicated video controller, 
but I haven't found it yet. If you have any idea, I am totally open to 
reconsider the path we are taking.

In the end, it would be possible to handle each hardware block as an 
independant subdev or input/output as long as we would be able to create 
links with the media api but 2 considerations make it easier to do what 
we are currently doing :
-> In our applications, most of the hardware paths between the blocks 
won't move at runtime, just a few links would have to be reconfigured at 
runtime which could be exposed with the media api.
-> We already have a low level api that allows us to handle the creation 
of a hardware block that provide a list of capabilities.

Thank you,
Julien

      reply	other threads:[~2014-07-31  8:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-10 14:19 Configurable Video Controller Driver Julien BERAUD
2014-07-21 11:14 ` Sakari Ailus
2014-07-31  8:53   ` Julien BERAUD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53DA0419.2090405@parrot.com \
    --to=julien.beraud@parrot.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.