All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: linux-media@vger.kernel.org,
	Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Benoit Parrot <bparrot@ti.com>,
	linux-renesas-soc@vger.kernel.org,
	Boris Brezillon <boris.brezillon@free-electrons.com>,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: Re: [PATCH 00/20] Add multiplexed media pads to support CSI-2 virtual channels
Date: Tue, 29 Aug 2017 16:39:51 +0200	[thread overview]
Message-ID: <20170829143950.j5jhdvyt72qzjmnt@flea.lan> (raw)
In-Reply-To: <20170811095703.6170-1-niklas.soderlund+renesas@ragnatech.se>

[-- Attachment #1: Type: text/plain, Size: 4769 bytes --]

Hi Niklas,

On Fri, Aug 11, 2017 at 11:56:43AM +0200, Niklas Söderlund wrote:
> This series is a RFC for how I think one could add CSI-2 virtual channel 
> support to the V4L2 framework. The problem is that there is no way to in 
> the media framework describe and control links between subdevices which 
> carry more then one video stream, for example a CSI-2 bus which can have 
> 4 virtual channels carrying different video streams.
> 
> This series adds a new pad flag which would indicate that a pad carries 
> multiplexed streams, adds a new s_stream() operation to the pad 
> operations structure which takes a new argument 'stream'. This new 
> s_stream() operation then is both pad and stream aware. It also extends 
> struct v4l2_mbus_frame_desc_entry with a new sub-struct to describe how 
> a CSI-2 link multiplexes virtual channels. I also include one 
> implementation based on Renesas R-Car which makes use of these patches 
> as I think they help with understanding but they have no impact on the 
> RFC feature itself.
> 
> The idea is that on both sides of the multiplexed media link there are 
> one multiplexer subdevice and one demultiplexer subdevice. These two 
> subdevices can't do any format conversions, there sole purpose is to 
> (de)multiplex the CSI-2 link. If there is hardware which can do both 
> CSI-2 multiplexing and format conversions they can be modeled as two 
> subdevices from the same device driver and using the still pending 
> incremental async mechanism to connect the external pads. The reason 
> there is no format conversion is important as the multiplexed pads can't 
> have a format in the current V4L2 model, get/set_fmt are not aware of 
> streams.
> 
>         +------------------+              +------------------+
>      +-------+  subdev 1   |              |  subdev 2   +-------+
>   +--+ Pad 1 |             |              |             | Pad 3 +---+
>      +--+----+   +---------+---+      +---+---------+   +----+--+
>         |        | Muxed pad A +------+ Muxed pad B |        |
>      +--+----+   +---------+---+      +---+---------+   +----+--+
>   +--+ Pad 2 |             |              |             | Pad 4 +---+
>      +-------+             |              |             +-------+
>         +------------------+              +------------------+
> 
> In the simple example above Pad 1 is routed to Pad 3 and Pad 2 to Pad 4, 
> and the video data for both of them travels the link between pad A and 
> B. One shortcoming of this RFC is that there currently are no way to 
> express to user-space which pad is routed to which stream of the 
> multiplexed link. But inside the kernel this is known and format 
> validation is done by comparing the format of Pad 1 to Pad 3 and Pad 2 
> to Pad 4 by the V4L2 framework. But it would be nice for the user to 
> also be able to get this information while setting up the MC graph in 
> user-space.

Thanks for your patches.

I guess I already have a different use-case for this, one you might
not have envisionned (on top of the Cadence CSI2-RX driver I've been
posting and that would need it at some point).

I have a CSI2-TX controller that I'm currently writing a driver
for. That controller takes 4 video streams in input, and aggregates
them on a single CSI-2 link. Those video streams use some kind of
parallel interfaces. So far, so good.

However, those parallel interfaces come with additional signals that
set the virtual channel and data types of the associated video
signal. Those signals are under control of the upstream video output
device, and can change at runtime.

The virtual channel are direcly mapped to the CSI-2 Virtual Channels,
so that part is completely transparent to the transmitter. However,
the video input datatype is a 0-7 value. Each data type value has a
separate set of registers where you need to set up the width and
height of the video data, and the corresponding CSI-2 Data Type.

You can use this to do some interleaving of either the virtual
channels or the data types, or both.

To make things (slightly) more complicated, the FIFO registers are
per-video input. Which means that while most of the (input)
configuration will be done per-datatype, we still have to know which
input stream is generating it, for example to optimise the FIFO fill
levels to the resolution...

Since the stream is multiplexed both using the virtual channels and
the data-types, I'm not sure representing it using only muxed pads
like you did would work.

And I don't really know what a good stop gap measure would be either.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2017-08-29 14:39 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11  9:56 [PATCH 00/20] Add multiplexed media pads to support CSI-2 virtual channels Niklas Söderlund
2017-08-11  9:56 ` [PATCH 01/20] media.h: add MEDIA_PAD_FL_MUXED flag Niklas Söderlund
2017-08-11  9:56 ` [PATCH 02/20] v4l2-subdev.h: add pad and stream aware s_stream Niklas Söderlund
2017-08-11  9:56 ` [PATCH 03/20] v4l2-subdev.h: add CSI-2 bus description to struct v4l2_mbus_frame_desc_entry Niklas Söderlund
2017-08-11  9:56 ` [PATCH 04/20] v4l2-core: check that both pads in a link are muxed if one are Niklas Söderlund
2017-08-11  9:56 ` [PATCH 05/20] v4l2-core: verify all streams formats on multiplexed links Niklas Söderlund
2017-08-11  9:56 ` [PATCH 06/20] rcar-vin: use the pad and stream aware s_stream Niklas Söderlund
2017-08-11  9:56 ` [PATCH 07/20] rcar-csi2: declare sink pad as multiplexed Niklas Söderlund
2017-08-11  9:56 ` [PATCH 08/20] rcar-csi2: switch to pad and stream aware s_stream Niklas Söderlund
2017-08-11  9:56 ` [PATCH 09/20] rcar-csi2: figure out remote pad and stream which are starting Niklas Söderlund
2017-08-11  9:56 ` [PATCH 10/20] rcar-csi2: count usage for each source pad Niklas Söderlund
2017-08-11  9:56 ` [PATCH 11/20] rcar-csi2: when starting CSI-2 receiver use frame descriptor information Niklas Söderlund
2017-08-11  9:56 ` [PATCH 12/20] rcar-csi2: only allow formats on source pads Niklas Söderlund
2017-08-11  9:56 ` [PATCH 13/20] rcar-csi2: implement get_frame_desc Niklas Söderlund
2017-08-11  9:56 ` [PATCH 14/20] adv748x: add module param for virtual channel Niklas Söderlund
2017-08-11  9:56 ` [PATCH 15/20] adv748x: declare source pad as multiplexed Niklas Söderlund
2017-08-11  9:56 ` [PATCH 16/20] adv748x: add translation from pixelcode to CSI-2 datatype Niklas Söderlund
2017-08-11  9:57 ` [PATCH 17/20] adv748x: implement get_frame_desc Niklas Söderlund
2017-08-11  9:57 ` [PATCH 18/20] adv748x: switch to pad and stream aware s_stream Niklas Söderlund
2017-08-11  9:57 ` [PATCH 19/20] adv748x: only allow formats on sink pads Niklas Söderlund
2017-08-11  9:57 ` [PATCH 20/20] arm64: dts: renesas: salvator: use VC1 for CVBS Niklas Söderlund
2017-08-30  7:36   ` Simon Horman
2017-08-30  8:08     ` Niklas Söderlund
2017-08-30  8:08       ` Niklas Söderlund
2017-08-30  9:29       ` Simon Horman
2017-08-29 14:39 ` Maxime Ripard [this message]
2018-03-15  9:43 ` [PATCH 00/20] Add multiplexed media pads to support CSI-2 virtual channels Todor Tomov
2018-03-15 23:16   ` Niklas Söderlund
2018-03-15 23:16     ` Niklas Söderlund
2018-03-16  8:12     ` Todor Tomov

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=20170829143950.j5jhdvyt72qzjmnt@flea.lan \
    --to=maxime.ripard@free-electrons.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=bparrot@ti.com \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sakari.ailus@linux.intel.com \
    --cc=thomas.petazzoni@free-electrons.com \
    /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.