@@ -44,6 +44,8 @@ Media Bus Formats
- Image colorspace, from enum
:c:type:`v4l2_colorspace`. See
:ref:`colorspaces` for details.
+ * - union {
+ - (anonymous)
* - __u16
- ``ycbcr_enc``
- Y'CbCr encoding, from enum :c:type:`v4l2_ycbcr_encoding`.
@@ -59,7 +61,23 @@ Media Bus Formats
V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC in the corresponding struct
:c:type:`v4l2_subdev_mbus_code_enum` during enumeration.
See :ref:`v4l2-subdev-mbus-code-flags`
-
+ * - __u16
+ - ``hsv_enc``
+ - HSV encoding, from enum :c:type:`v4l2_hsv_encoding`.
+ This information supplements the ``colorspace`` and must be set by
+ the driver for capture streams and by the application for output
+ streams, see :ref:`colorspaces`. If the application sets the
+ flag ``V4L2_MBUS_FRAMEFMT_SET_CSC`` then the application can set
+ this field for a capture stream to request a specific HSV encoding
+ for the media bus data. If the driver cannot handle requested
+ conversion, it will return another supported encoding.
+ This field is ignored for Y'CbCr media bus formats. The driver indicates
+ that hsv_enc conversion is supported by setting the flag
+ V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC in the corresponding struct
+ :c:type:`v4l2_subdev_mbus_code_enum` during enumeration.
+ See :ref:`v4l2-subdev-mbus-code-flags`
+ * - }
+ -
* - __u16
- ``quantization``
- Quantization range, from enum :c:type:`v4l2_quantization`.
@@ -103,7 +121,7 @@ Media Bus Formats
- Set by the application. It is only used for capture and is
ignored for output streams. If set, then request the subdevice to do
colorspace conversion from the received colorspace to the requested
- colorspace values. If colorimetry field (``ycbcr_enc`` or
+ colorspace values. If colorimetry field (``ycbcr_enc``, ``hsv_enc`` or
``quantization``) is set to 0, then that colorimetry setting will remain
unchanged from what was received. So to change the quantization, only the
``quantization`` field shall be set to non-zero values
@@ -26,6 +26,7 @@
* @field: used interlacing type (from enum v4l2_field)
* @colorspace: colorspace of the data (from enum v4l2_colorspace)
* @ycbcr_enc: YCbCr encoding of the data (from enum v4l2_ycbcr_encoding)
+ * @hsv_enc: HSV encoding of the data (from enum v4l2_hsv_encoding)
* @quantization: quantization of the data (from enum v4l2_quantization)
* @xfer_func: transfer function of the data (from enum v4l2_xfer_func)
*/
@@ -35,7 +36,12 @@ struct v4l2_mbus_framefmt {
__u32 code;
__u32 field;
__u32 colorspace;
- __u16 ycbcr_enc;
+ union {
+ /* enum v4l2_ycbcr_encoding */
+ __u16 ycbcr_enc;
+ /* enum v4l2_hsv_encoding */
+ __u16 hsv_enc;
+ };
__u16 quantization;
__u16 xfer_func;
__u16 flags;
@@ -66,6 +66,7 @@ struct v4l2_subdev_crop {
};
#define V4L2_SUBDEV_MBUS_CODE_CSC_YCBCR_ENC 0x00000001
+#define V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC 0x00000001
#define V4L2_SUBDEV_MBUS_CODE_CSC_QUANTIZATION 0x00000002
/**
* struct v4l2_subdev_mbus_code_enum - Media bus format enumeration
Add the flag V4L2_SUBDEV_MBUS_CODE_CSC_HSV_ENC that drivers can set when enumerating the supported mediabus formats on subdevices to indicate that the userspace can ask to set the 'hsv_enc'. The patch also replaces the 'ycbcr_enc' field in 'struct v4l2_mbus_framefmt' with a union that includes 'hsv_enc' Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> --- .../media/v4l/subdev-formats.rst | 22 +++++++++++++++++-- include/uapi/linux/v4l2-mediabus.h | 8 ++++++- include/uapi/linux/v4l2-subdev.h | 1 + 3 files changed, 28 insertions(+), 3 deletions(-)