Re: [PATCH 1/2] Documentation: v4l: Flip handling for RAW sensors

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

 



Hi Jacopo

Thanks for adding documentation.
Sorry I couldn't be at your presentation, but I'll find the slides
(and recording if there is one).

On Mon, 3 Jul 2023 at 21:29, Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx> wrote:
>
> Document the requirement of notifying to userspace the possible
> re-ordering of the color sample components when a vertical or horizontal
> flip is applied to a RAW camera sensor.
>
> Signed-off-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>
> ---
>  Documentation/driver-api/media/camera-sensor.rst | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/Documentation/driver-api/media/camera-sensor.rst b/Documentation/driver-api/media/camera-sensor.rst
> index 93f4f2536c25..ee4a7fe5f72a 100644
> --- a/Documentation/driver-api/media/camera-sensor.rst
> +++ b/Documentation/driver-api/media/camera-sensor.rst
> @@ -173,3 +173,19 @@ V4L2_CID_VFLIP controls with the values programmed by the register sequences.
>  The default values of these controls shall be 0 (disabled). Especially these
>  controls shall not be inverted, independently of the sensor's mounting
>  rotation.
> +
> +Flip handling for raw camera sensors
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Possibly "for colour raw camera sensors".
Mono sensors are still raw in that they need processing for black
level, lens shading, etc, but they won't change the colour ordering.

> +
> +Applying vertical and horizontal flips on raw camera sensors inverts the color
> +sample reading direction on the sensor's pixel array. This causes the
> +re-ordering of the color samples on the sensor's output frame.

This *may* cause the re-ordering....

Not all sensors do. Some shift the readout by one line/column to keep
the Bayer order the same, and technically should update the selection.
OnSemi sensors in particular seem to do this, as do the Sony
IMX327/290/462 family.

> As an example, a
> +raw camera sensor with a Bayer pattern color filter array and a native RGGB
> +Bayer order will produce frames with GRBG component ordering when a vertical
> +flip is applied.

Vertical flip of RGGB would be GBRG as the RG and GB get swapped, not
GRBG (which would be horizontal flip).

  Dave

> Camera sensor drivers where inverting the reading order
> +direction causes a re-ordering of the color components are requested to register
> +the ``V4L2_CID_VFLIP`` and ``V4L2_CID_HFLIP`` controls with the
> +``V4L2_CTRL_FLAG_MODIFY_LAYOUT`` flag enabled to notify userspace that enabling
> +a flip can potentially change the output buffer content layout. Flips should
> +also be taken into account when enumerating and handling media bus formats
> +on the camera sensor source pads.
> --
> 2.40.1
>



[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