• Home
  • Raw
  • Download

Lines Matching +full:ref +full:- +full:pad

1 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
6 Sub-device Interface
13 components as software blocks called sub-devices.
15 V4L2 sub-devices are usually kernel-only objects. If the V4L2 driver
17 media entities. Applications will be able to enumerate the sub-devices
21 In addition to make sub-devices discoverable, drivers can also choose to
23 sub-device driver and the V4L2 device driver support this, sub-devices
26 - query, read and write sub-devices controls
28 - subscribe and unsubscribe to events and retrieve them
30 - negotiate image formats on individual pads
32 Sub-device character device nodes, conventionally named
33 ``/dev/v4l-subdev*``, use major number 81.
35 Drivers may opt to limit the sub-device character devices to only expose
36 operations that do not modify the device state. In such a case the sub-devices
37 are referred to as ``read-only`` in the rest of this documentation, and the
44 Most V4L2 controls are implemented by sub-device hardware. Drivers
46 Applications can control all sub-devices through a single interface.
55 Applications can access those hidden controls through the sub-device
56 node with the V4L2 control API described in :ref:`control`. The ioctls
59 sub-device.
68 V4L2 sub-devices can notify applications of events as described in
69 :ref:`event`. The API behaves identically as when used on V4L2 device
71 the sub-device. Depending on the driver, those events might also be
75 .. _pad-level-formats:
77 Pad-level Formats
82 Pad-level formats are only applicable to very complex devices that
83 need to expose low-level format configuration to user space. Generic
94 :ref:`selection <VIDIOC_SUBDEV_G_SELECTION>` ioctls. The driver is
101 :ref:`pipeline-scaling`, where image scaling can be performed on both
105 .. _pipeline-scaling:
107 .. kernel-figure:: pipeline.dot
123 Drivers that implement the :ref:`media API <media-controller-intro>`
124 can expose pad-level image format configuration to applications. When
126 :ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and
127 :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls. to
128 negotiate formats on a per-pad basis.
133 :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` time, and an ``EPIPE`` error
136 Pad-level image format configuration support can be tested by calling
137 the :ref:`VIDIOC_SUBDEV_G_FMT` ioctl on pad
138 0. If the driver returns an ``EINVAL`` error code pad-level format
139 configuration is not supported by the sub-device.
143 ------------------
153 :ref:`V4L2_SUBDEV_FORMAT_TRY <VIDIOC_SUBDEV_G_FMT>`, the
154 :ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` and
155 :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctls operate on
162 the sub-device file handles. A
163 :ref:`VIDIOC_SUBDEV_G_FMT <VIDIOC_SUBDEV_G_FMT>` call will return
164 the last try format set *on the same sub-device file handle*. Several
165 applications querying the same sub-device at the same time will thus not
170 :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` ioctl. Drivers
179 to an :ref:`VIDIOC_SUBDEV_S_FMT <VIDIOC_SUBDEV_G_FMT>` call as-is
183 Drivers automatically propagate formats inside sub-devices. When a try
184 or active format is set on a pad, corresponding formats on other pads of
185 the same sub-device can be modified by the driver. Drivers are free to
189 - Formats should be propagated from sink pads to source pads. Modifying
190 a format on a source pad should not modify the format on any sink
191 pad.
193 - Sub-devices that scale frames using variable scaling factors should
199 propagating them from one sub-device file handle to another.
205 :ref:`sample-pipeline-config` shows a sample configuration sequence
206 for the pipeline described in :ref:`pipeline-scaling` (table columns
207 list entity names and pad numbers).
216 .. _sample-pipeline-config:
218 .. flat-table:: Sample Pipeline Configuration
219 :header-rows: 1
220 :stub-columns: 0
223 * -
224 - Sensor/0
227 - Frontend/0
230 - Frontend/1
233 - Scaler/0
236 - Scaler/0
239 - Scaler/1
242 * - Initial state
243 - 2048x1536
246 - (default)
247 - (default)
248 - (default)
249 - (default)
250 - (default)
251 * - Configure frontend sink format
252 - 2048x1536
255 - *2048x1536*
258 - *2046x1534*
261 - (default)
262 - (default)
263 - (default)
264 * - Configure scaler sink format
265 - 2048x1536
268 - 2048x1536
271 - 2046x1534
274 - *2046x1534*
277 - *0,0/2046x1534*
278 - *2046x1534*
281 * - Configure scaler sink compose selection
282 - 2048x1536
285 - 2048x1536
288 - 2046x1534
291 - 2046x1534
294 - *0,0/1280x960*
295 - *1280x960*
303 1. Initial state. The sensor source pad format is set to its native 3MP
306 values, as well as the compose rectangle on the scaler's sink pad.
308 2. The application configures the frontend sink pad format's size to
310 driver propagates the format to the frontend source pad.
312 3. The application configures the scaler sink pad format's size to
315 on the sink pad is set to V4L2_MBUS_FMT_SGRBG_1X8. The driver
317 scaler's sink pad, and the format to the scaler source pad.
320 rectangle of the scaler's sink pad 1280x960. The driver propagates
321 the size to the scaler's source pad format.
330 be applied as-is by the driver without being modified.
333 .. _v4l2-subdev-selections:
336 ---------------------------------------------
338 Many sub-devices support cropping frames on their input or output pads
349 As for pad formats, drivers store try and active rectangles for the
350 selection targets :ref:`v4l2-selections-common`.
352 On sink pads, cropping is applied relative to the current pad format.
353 The pad format represents the image size as received by the sub-device
355 represents the sub-image that will be transmitted further inside the
356 sub-device for processing.
364 rectangle on the subdev's sink pad is scaled to the size configured
366 :ref:`VIDIOC_SUBDEV_S_SELECTION <VIDIOC_SUBDEV_G_SELECTION>` IOCTL
367 using ``V4L2_SEL_TGT_COMPOSE`` selection target on the same pad. If the
373 COMPOSE rectangle on the sink pad. In both sink and source pads, the
380 the image size either up or down. :ref:`v4l2-selection-flags`
384 --------------------------
401 pixel array is not rectangular but cross-shaped or round. The maximum
406 ---------------------------------------------
409 the sink pad towards the source pad. This is also reflected in the order
419 rectangle, which refers to the sink compose bounds rectangle --- if it
422 1. Sink pad format. The user configures the sink pad format. This format
424 pad for further processing.
426 2. Sink pad actual crop selection. The sink pad crop defines the crop
427 performed to the sink pad format.
429 3. Sink pad actual compose selection. The size of the sink pad compose
431 pad crop rectangle. The location of the compose rectangle specifies
435 4. Source pad actual crop selection. Crop on the source pad defines crop
438 5. Source pad format. The source pad format defines the output pixel
441 by the size of the source pad actual crop selection.
447 selection will refer to the sink pad format dimensions instead.
450 .. _subdev-image-processing-crop:
452 .. kernel-figure:: subdev-image-processing-crop.svg
453 :alt: subdev-image-processing-crop.svg
458 In the above example, the subdev supports cropping on its sink pad. To
460 pad. Now the actual crop rectangle can be set on the sink pad --- the
464 pad.
467 .. _subdev-image-processing-scaling-multi-source:
469 .. kernel-figure:: subdev-image-processing-scaling-multi-source.svg
470 :alt: subdev-image-processing-scaling-multi-source.svg
483 .. _subdev-image-processing-full:
485 .. kernel-figure:: subdev-image-processing-full.svg
486 :alt: subdev-image-processing-full.svg
501 subdev-formats