mbox series

[v5,0/5] HDR10 static metadata

Message ID 20210209162425.3970393-1-stanimir.varbanov@linaro.org
Headers show
Series HDR10 static metadata | expand

Message

Stanimir Varbanov Feb. 9, 2021, 4:24 p.m. UTC
Changes since v4:
  * 1/5 - fixed a typo (Hans)
  * 2/5 - add some mode info about new colorimetry class (Hans)
  * 4/5 - correct cd/m2 -> cd/m\ :sup:`2`
        - change to US spelling for color word
        - use correct v4l2_ctrl_type in videodev2.h.rst.exceptions
        - documented p_hdr10_cll and p_hdr10_mastering in vidioc-g-ext-ctrls.rst

Comments are welcome!        

regards,
Stan
        
Stanimir Varbanov (5):
  v4l: Add new Colorimetry Class
  docs: Document colorimetry class
  v4l: Add HDR10 static metadata controls
  docs: Document CLL and Mastering display colorimetry controls
  venus: venc: Add support for CLL and Mastering display controls

 .../userspace-api/media/v4l/common.rst        |  1 +
 .../media/v4l/ext-ctrls-colorimetry.rst       | 93 +++++++++++++++++++
 .../media/v4l/vidioc-g-ext-ctrls.rst          | 12 +++
 .../media/videodev2.h.rst.exceptions          |  2 +
 drivers/media/platform/qcom/venus/core.h      |  2 +
 drivers/media/platform/qcom/venus/hfi_cmds.c  |  8 ++
 .../media/platform/qcom/venus/hfi_helper.h    | 20 ++++
 drivers/media/platform/qcom/venus/venc.c      | 29 ++++++
 .../media/platform/qcom/venus/venc_ctrls.c    | 16 +++-
 drivers/media/v4l2-core/v4l2-ctrls.c          | 74 ++++++++++++++-
 include/media/v4l2-ctrls.h                    |  4 +
 include/uapi/linux/v4l2-controls.h            | 35 +++++++
 include/uapi/linux/videodev2.h                |  3 +
 13 files changed, 297 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst

Comments

Stanimir Varbanov March 16, 2021, 11:07 a.m. UTC | #1
Hans, any comments?

On 2/9/21 6:24 PM, Stanimir Varbanov wrote:
> Changes since v4:

>   * 1/5 - fixed a typo (Hans)

>   * 2/5 - add some mode info about new colorimetry class (Hans)

>   * 4/5 - correct cd/m2 -> cd/m\ :sup:`2`

>         - change to US spelling for color word

>         - use correct v4l2_ctrl_type in videodev2.h.rst.exceptions

>         - documented p_hdr10_cll and p_hdr10_mastering in vidioc-g-ext-ctrls.rst

> 

> Comments are welcome!        

> 

> regards,

> Stan

>         

> Stanimir Varbanov (5):

>   v4l: Add new Colorimetry Class

>   docs: Document colorimetry class

>   v4l: Add HDR10 static metadata controls

>   docs: Document CLL and Mastering display colorimetry controls

>   venus: venc: Add support for CLL and Mastering display controls

> 

>  .../userspace-api/media/v4l/common.rst        |  1 +

>  .../media/v4l/ext-ctrls-colorimetry.rst       | 93 +++++++++++++++++++

>  .../media/v4l/vidioc-g-ext-ctrls.rst          | 12 +++

>  .../media/videodev2.h.rst.exceptions          |  2 +

>  drivers/media/platform/qcom/venus/core.h      |  2 +

>  drivers/media/platform/qcom/venus/hfi_cmds.c  |  8 ++

>  .../media/platform/qcom/venus/hfi_helper.h    | 20 ++++

>  drivers/media/platform/qcom/venus/venc.c      | 29 ++++++

>  .../media/platform/qcom/venus/venc_ctrls.c    | 16 +++-

>  drivers/media/v4l2-core/v4l2-ctrls.c          | 74 ++++++++++++++-

>  include/media/v4l2-ctrls.h                    |  4 +

>  include/uapi/linux/v4l2-controls.h            | 35 +++++++

>  include/uapi/linux/videodev2.h                |  3 +

>  13 files changed, 297 insertions(+), 2 deletions(-)

>  create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst

> 


-- 
regards,
Stan
Hans Verkuil March 16, 2021, 11:37 a.m. UTC | #2
On 09/02/2021 17:24, Stanimir Varbanov wrote:
> Add a document for ext control colorimetry class.
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>  .../userspace-api/media/v4l/common.rst        |  1 +
>  .../media/v4l/ext-ctrls-colorimetry.rst       | 22 +++++++++++++++++++
>  .../media/v4l/vidioc-g-ext-ctrls.rst          |  4 ++++
>  3 files changed, 27 insertions(+)
>  create mode 100644 Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst
> 
> diff --git a/Documentation/userspace-api/media/v4l/common.rst b/Documentation/userspace-api/media/v4l/common.rst
> index 8c263c5a85d8..ea0435182e44 100644
> --- a/Documentation/userspace-api/media/v4l/common.rst
> +++ b/Documentation/userspace-api/media/v4l/common.rst
> @@ -51,6 +51,7 @@ applicable to all devices.
>      ext-ctrls-fm-tx
>      ext-ctrls-fm-rx
>      ext-ctrls-detect
> +    ext-ctrls-colorimetry
>      fourcc
>      format
>      planar-apis
> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst
> new file mode 100644
> index 000000000000..862f78b41b32
> --- /dev/null
> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst
> @@ -0,0 +1,22 @@
> +.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
> +
> +.. _colorimetry-controls:
> +
> +*****************************
> +Colorimetry Control Reference
> +*****************************
> +
> +The Colorimetry class includes controls for High Dynamic Range
> +imaging for representing colors in digital images and video. The
> +controls should be used for video and image encoding and decoding
> +as well as in HDMI receivers and transmitters.
> +
> +Colorimetry Control IDs
> +-----------------------
> +
> +.. _colorimetry-control-id:
> +
> +``V4L2_CID_COLORIMETRY_CLASS (class)``
> +    The Colorimetry class descriptor. Calling
> +    :ref:`VIDIOC_QUERYCTRL` for this control will
> +    return a description of this control class.
> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst
> index b9c62affbb5a..8a95ebdd499a 100644
> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst
> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst
> @@ -394,6 +394,10 @@ still cause this situation.
>        - 0xa40000
>        - The class containing stateless codec controls. These controls are
>  	described in :ref:`codec-stateless-controls`.
> +    * - ``V4L2_CTRL_CLASS_COLORIMETRY``
> +      - 0xa50000
> +      - The class containing colorimetry controls. These controls are
> +	described in :ref:`colorimetry-controls`.
>  
>  Return Value
>  ============
> 

Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

Regards,

	Hans
Hans Verkuil March 16, 2021, 12:22 p.m. UTC | #3
On 09/02/2021 17:24, Stanimir Varbanov wrote:
> Document Content Light Level and Mastering Display v4l2 colorimetry

> controls.

> 

> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> ---

>  .../media/v4l/ext-ctrls-colorimetry.rst       | 71 +++++++++++++++++++

>  .../media/v4l/vidioc-g-ext-ctrls.rst          |  8 +++

>  .../media/videodev2.h.rst.exceptions          |  2 +

>  3 files changed, 81 insertions(+)

> 

> diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst

> index 862f78b41b32..a9f206a46175 100644

> --- a/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst

> +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-colorimetry.rst

> @@ -20,3 +20,74 @@ Colorimetry Control IDs

>      The Colorimetry class descriptor. Calling

>      :ref:`VIDIOC_QUERYCTRL` for this control will

>      return a description of this control class.

> +

> +``V4L2_CID_COLORIMETRY_HDR10_CLL_INFO (struct)``

> +    The Content Light Level defines upper bounds for the nominal target

> +    brightness light level of the pictures.

> +

> +.. c:type:: v4l2_ctrl_hdr10_cll_info

> +

> +.. cssclass:: longtable

> +

> +.. flat-table:: struct v4l2_ctrl_hdr10_cll_info

> +    :header-rows:  0

> +    :stub-columns: 0

> +    :widths:       1 1 2

> +

> +    * - __u16

> +      - ``max_content_light_level``

> +      - The upper bound for the maximum light level among all individual

> +        samples for the pictures of a coded video sequence, cd/m\ :sup:`2`.


I think 'coded' should be removed. This is equally valid when receiving
uncoded HDMI video, after all.

> +        When equal to 0 no such upper bound is present.

> +    * - __u16

> +      - ``max_pic_average_light_level``

> +      - The upper bound for the maximum average light level among the

> +        samples for any individual picture of a coded video sequence,


ditto.

> +        cd/m\ :sup:`2`. When equal to 0 no such upper bound is present.

> +

> +``V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY (struct)``

> +    The mastering display defines the color volume (the color primaries,

> +    white point and luminance range) of a display considered to be the

> +    mastering display for the current video content.

> +

> +.. c:type:: v4l2_ctrl_hdr10_mastering_display

> +

> +.. cssclass:: longtable

> +

> +.. flat-table:: struct v4l2_ctrl_hdr10_mastering_display

> +    :header-rows:  0

> +    :stub-columns: 0

> +    :widths:       1 1 2

> +

> +    * - __u16

> +      - ``display_primaries_x[3]``

> +      - Specifies the normalized x chromaticity coordinate of the color

> +        primary component c of the mastering display in increments of 0.00002.

> +        For describing the mastering display that uses Red, Green and Blue

> +        color primaries, index value c equal to 0 corresponds to the Green

> +        primary, c equal to 1 corresponds to Blue primary and c equal to 2

> +        corresponds to the Red color primary.

> +    * - __u16

> +      - ``display_primaries_y[3]``

> +      - Specifies the normalized y chromaticity coordinate of the color

> +        primary component c of the mastering display in increments of 0.00002.

> +        For describing the mastering display that uses Red, Green and Blue

> +        color primaries, index value c equal to 0 corresponds to the Green

> +        primary, c equal to 1 corresponds to Blue primary and c equal to 2

> +        corresponds to Red color primary.

> +    * - __u16

> +      - ``white_point_x``

> +      - Specifies the normalized x chromaticity coordinate of the white

> +        point of the mastering display in increments of 0.00002.

> +    * - __u16

> +      - ``white_point_y``

> +      - Specifies the normalized y chromaticity coordinate of the white

> +        point of the mastering display in increments of 0.00002.

> +    * - __u32

> +      - ``max_luminance``

> +      - Specifies the nominal maximum display luminance of the mastering

> +        display in units of 0.0001 cd/m\ :sup:`2`.

> +    * - __u32

> +      - ``min_luminance``

> +      - specifies the nominal minimum display luminance of the mastering

> +        display in units of 0.0001 cd/m\ :sup:`2`.

> diff --git a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> index 8a95ebdd499a..2f6d0539fb93 100644

> --- a/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> +++ b/Documentation/userspace-api/media/v4l/vidioc-g-ext-ctrls.rst

> @@ -212,6 +212,14 @@ still cause this situation.

>        - ``p_fwht_params``

>        - A pointer to a struct :c:type:`v4l2_ctrl_fwht_params`. Valid if this control is

>          of type ``V4L2_CTRL_TYPE_FWHT_PARAMS``.

> +    * - struct :c:type:`v4l2_ctrl_hdr10_cll_info` *

> +      - ``p_hdr10_cll``

> +      - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_cll_info`. Valid if this control is

> +        of type ``V4L2_CTRL_TYPE_HDR10_CLL_INFO``.

> +    * - struct :c:type:`v4l2_ctrl_hdr10_mastering_display` *

> +      - ``p_hdr10_mastering``

> +      - A pointer to a struct :c:type:`v4l2_ctrl_hdr10_mastering_display`. Valid if this control is

> +        of type ``V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY``.

>      * - void *

>        - ``ptr``

>        - A pointer to a compound type which can be an N-dimensional array

> diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> index 0ed170c6e720..38b31a9b9580 100644

> --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions

> @@ -147,6 +147,8 @@ replace symbol V4L2_CTRL_TYPE_HEVC_PPS :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_AREA :c:type:`v4l2_ctrl_type`

>  replace symbol V4L2_CTRL_TYPE_FWHT_PARAMS :c:type:`v4l2_ctrl_type`

> +replace symbol V4L2_CTRL_TYPE_HDR10_CLL_INFO :c:type:`v4l2_ctrl_type`

> +replace symbol V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY :c:type:`v4l2_ctrl_type`

>  

>  # V4L2 capability defines

>  replace define V4L2_CAP_VIDEO_CAPTURE device-capabilities

> 


After making the change suggested above, you can add my:

Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>


Regards,

	Hans