Re: [PATCH v11 26/36] media: subdev: add stream based configuration

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/03/2022 10:38, Jacopo Mondi wrote:
Hi Tomi

On Thu, Mar 17, 2022 at 10:01:47AM +0200, Tomi Valkeinen wrote:
On 16/03/2022 11:59, Jacopo Mondi wrote:
Hi Tomi

On Tue, Mar 01, 2022 at 06:11:46PM +0200, Tomi Valkeinen wrote:
Add support to manage configurations (format, crop, compose) per stream,
instead of per pad. This is accomplished with data structures that hold
an array of all subdev's stream configurations.

The number of streams can vary at runtime based on routing. Every time
the routing is changed, the stream configurations need to be
re-initialized.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
---
   .../v4l/vidioc-subdev-enum-frame-interval.rst |   5 +-
   .../v4l/vidioc-subdev-enum-frame-size.rst     |   5 +-
   .../v4l/vidioc-subdev-enum-mbus-code.rst      |   5 +-
   .../media/v4l/vidioc-subdev-g-crop.rst        |   5 +-
   .../media/v4l/vidioc-subdev-g-fmt.rst         |   5 +-
   .../v4l/vidioc-subdev-g-frame-interval.rst    |   5 +-
   .../media/v4l/vidioc-subdev-g-selection.rst   |   5 +-
   drivers/media/v4l2-core/v4l2-subdev.c         | 129 ++++++++++++++++--
   include/media/v4l2-subdev.h                   |  48 +++++++
   include/uapi/linux/v4l2-subdev.h              |  28 +++-
   10 files changed, 218 insertions(+), 22 deletions(-)

diff --git a/Documentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst b/Documentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst
index 3703943b412f..8def4c05d3da 100644
--- a/Documentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst
+++ b/Documentation/userspace-api/media/v4l/vidioc-subdev-enum-frame-interval.rst
@@ -92,7 +92,10 @@ multiple pads of the same sub-device is not defined.
         - Frame intervals to be enumerated, from enum
   	:ref:`v4l2_subdev_format_whence <v4l2-subdev-format-whence>`.
       * - __u32
-      - ``reserved``\ [8]
+      - ``stream``
+      - Stream identifier.
+    * - __u32
+      - ``reserved``\ [7]

Does VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL (as well as
VIDIOC_SUBDEV_G_FRAME_INTERVAL) need to be stream-aware ?

What is the semantic of the stream identifiers for IOCTLs that seem to
control a paramter which is global to the subdev ? Isn't the stream semantic
required to be specified in the IOCTL documentation and not just added
to the list of fields ?

Why would it be global to the subdev? struct v4l2_subdev_frame_interval_enum
already has 'pad' field, so it operates on that pad. With streams, each
stream in a pad may have different characteristics, (similarly to different
pads in non-stream case), so it feels logical to me to add the 'stream'
field.


I understand a device with multiple output interfaces can decide to
clock out frames at different speeds due to some bus configuration
parameters. But I have an hard time immagine a device that can clock
out frames at different rates on the same bus.

I see your point, but doesn't the viability depend on the bus and protocol? A sensor could send pixel frames 60 fps, but metadata only at 10 fps. Or a HD picture 10 fps, and a low res picture 60 fps. All it needs is a bus that can interleave the streams seamlessly.

 Tomi



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux