diff mbox series

[v3,20/21] media: v4l2: Add 10- and 12-bpc luma-only formats with linear packing

Message ID 20201116185207.13208-21-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: Add new pixel formats for Xilinx v-frmbuf | expand

Commit Message

Laurent Pinchart Nov. 16, 2020, 6:52 p.m. UTC
Add two new formats storing luma only in 10- and 12-bpc variants, with
linear packing. They are used by the Xilinx Video Frame Buffer
Read/Write IP cores.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 .../media/v4l/pixfmt-yuv-luma.rst             | 23 +++++++++++++++++++
 include/uapi/linux/videodev2.h                |  2 ++
 2 files changed, 25 insertions(+)

Comments

Hans Verkuil Nov. 17, 2020, 3:05 p.m. UTC | #1
On 16/11/2020 19:52, Laurent Pinchart wrote:
> Add two new formats storing luma only in 10- and 12-bpc variants, with
> linear packing. They are used by the Xilinx Video Frame Buffer
> Read/Write IP cores.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  .../media/v4l/pixfmt-yuv-luma.rst             | 23 +++++++++++++++++++
>  include/uapi/linux/videodev2.h                |  2 ++
>  2 files changed, 25 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> index 0c8c5e0a380e..cc06d6d960b1 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> @@ -17,6 +17,7 @@ are often referred to as greyscale formats.
>     - Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at colum
>       `x`.
>     - `0` denotes padding bits set to 0.
> +   - `-` denotes padding bits with undefined values.
>  
>  
>  .. flat-table:: Luma-Only Image Formats
> @@ -75,6 +76,17 @@ are often referred to as greyscale formats.
>        - Y'\ :sub:`3`\ [9:2]
>        - Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
>  
> +    * .. _V4L2-PIX-FMT-Y10X:
> +
> +      - ``V4L2_PIX_FMT_Y10X``
> +      - 'Y10X'
> +
> +      - Y'\ :sub:`0`\ [7:0]
> +      - Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
> +      - Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
> +      - `- -` Y'\ :sub:`2`\ [9:4]

- - -> x x

> +      - ...
> +
>      * .. _V4L2-PIX-FMT-Y12:
>  
>        - ``V4L2_PIX_FMT_Y12``
> @@ -86,6 +98,17 @@ are often referred to as greyscale formats.
>        - ...
>        - ...
>  
> +    * .. _V4L2-PIX-FMT-Y12X:
> +
> +      - ``V4L2_PIX_FMT_Y12X``
> +      - 'Y12X'
> +
> +      - Y'\ :sub:`0`\ [7:0]
> +      - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [11:8]
> +      - Y'\ :sub:`1`\ [11:4]
> +      - Y'\ :sub:`2`\ [7:0]
> +      - `- - - -` Y'\ :sub:`2`\ [11:8]

Ditto.

Regards,

	Hans

> +
>      * .. _V4L2-PIX-FMT-Y14:
>  
>        - ``V4L2_PIX_FMT_Y14``
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index 5cdbd1a2fddb..cf9288d270c6 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -576,6 +576,8 @@ struct v4l2_pix_format {
>  /* Grey bit-packed formats */
>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */
> +#define V4L2_PIX_FMT_Y10X    v4l2_fourcc('Y', '1', '0', 'X') /* 10  Greyscale, 3 pixels in 4 bytes */
> +#define V4L2_PIX_FMT_Y12X    v4l2_fourcc('Y', '1', '2', 'X') /* 12  Greyscale, 4 pixels in 5 bytes */
>  
>  /* Palette formats */
>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
>
Hans Verkuil Nov. 17, 2020, 3:06 p.m. UTC | #2
On 17/11/2020 16:05, Hans Verkuil wrote:
> On 16/11/2020 19:52, Laurent Pinchart wrote:
>> Add two new formats storing luma only in 10- and 12-bpc variants, with
>> linear packing. They are used by the Xilinx Video Frame Buffer
>> Read/Write IP cores.
>>
>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>> ---
>>  .../media/v4l/pixfmt-yuv-luma.rst             | 23 +++++++++++++++++++
>>  include/uapi/linux/videodev2.h                |  2 ++
>>  2 files changed, 25 insertions(+)
>>
>> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
>> index 0c8c5e0a380e..cc06d6d960b1 100644
>> --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
>> +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
>> @@ -17,6 +17,7 @@ are often referred to as greyscale formats.
>>     - Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at colum

colum -> column

>>       `x`.
>>     - `0` denotes padding bits set to 0.
>> +   - `-` denotes padding bits with undefined values.

Oops, here too `-` should be `x`.

Regards,

	Hans

>>  
>>  
>>  .. flat-table:: Luma-Only Image Formats
>> @@ -75,6 +76,17 @@ are often referred to as greyscale formats.
>>        - Y'\ :sub:`3`\ [9:2]
>>        - Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
>>  
>> +    * .. _V4L2-PIX-FMT-Y10X:
>> +
>> +      - ``V4L2_PIX_FMT_Y10X``
>> +      - 'Y10X'
>> +
>> +      - Y'\ :sub:`0`\ [7:0]
>> +      - Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
>> +      - Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
>> +      - `- -` Y'\ :sub:`2`\ [9:4]
> 
> - - -> x x
> 
>> +      - ...
>> +
>>      * .. _V4L2-PIX-FMT-Y12:
>>  
>>        - ``V4L2_PIX_FMT_Y12``
>> @@ -86,6 +98,17 @@ are often referred to as greyscale formats.
>>        - ...
>>        - ...
>>  
>> +    * .. _V4L2-PIX-FMT-Y12X:
>> +
>> +      - ``V4L2_PIX_FMT_Y12X``
>> +      - 'Y12X'
>> +
>> +      - Y'\ :sub:`0`\ [7:0]
>> +      - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [11:8]
>> +      - Y'\ :sub:`1`\ [11:4]
>> +      - Y'\ :sub:`2`\ [7:0]
>> +      - `- - - -` Y'\ :sub:`2`\ [11:8]
> 
> Ditto.
> 
> Regards,
> 
> 	Hans
> 
>> +
>>      * .. _V4L2-PIX-FMT-Y14:
>>  
>>        - ``V4L2_PIX_FMT_Y14``
>> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
>> index 5cdbd1a2fddb..cf9288d270c6 100644
>> --- a/include/uapi/linux/videodev2.h
>> +++ b/include/uapi/linux/videodev2.h
>> @@ -576,6 +576,8 @@ struct v4l2_pix_format {
>>  /* Grey bit-packed formats */
>>  #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
>>  #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */
>> +#define V4L2_PIX_FMT_Y10X    v4l2_fourcc('Y', '1', '0', 'X') /* 10  Greyscale, 3 pixels in 4 bytes */
>> +#define V4L2_PIX_FMT_Y12X    v4l2_fourcc('Y', '1', '2', 'X') /* 12  Greyscale, 4 pixels in 5 bytes */
>>  
>>  /* Palette formats */
>>  #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */
>>
>
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
index 0c8c5e0a380e..cc06d6d960b1 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
@@ -17,6 +17,7 @@  are often referred to as greyscale formats.
    - Y'\ :sub:`x`\ [9:2] denotes bits 9 to 2 of the Y' value for pixel at colum
      `x`.
    - `0` denotes padding bits set to 0.
+   - `-` denotes padding bits with undefined values.
 
 
 .. flat-table:: Luma-Only Image Formats
@@ -75,6 +76,17 @@  are often referred to as greyscale formats.
       - Y'\ :sub:`3`\ [9:2]
       - Y'\ :sub:`3`\ [1:0] Y'\ :sub:`2`\ [1:0] Y'\ :sub:`1`\ [1:0] Y'\ :sub:`0`\ [1:0]
 
+    * .. _V4L2-PIX-FMT-Y10X:
+
+      - ``V4L2_PIX_FMT_Y10X``
+      - 'Y10X'
+
+      - Y'\ :sub:`0`\ [7:0]
+      - Y'\ :sub:`1`\ [5:0] Y'\ :sub:`0`\ [9:8]
+      - Y'\ :sub:`2`\ [3:0] Y'\ :sub:`1`\ [9:6]
+      - `- -` Y'\ :sub:`2`\ [9:4]
+      - ...
+
     * .. _V4L2-PIX-FMT-Y12:
 
       - ``V4L2_PIX_FMT_Y12``
@@ -86,6 +98,17 @@  are often referred to as greyscale formats.
       - ...
       - ...
 
+    * .. _V4L2-PIX-FMT-Y12X:
+
+      - ``V4L2_PIX_FMT_Y12X``
+      - 'Y12X'
+
+      - Y'\ :sub:`0`\ [7:0]
+      - Y'\ :sub:`1`\ [3:0] Y'\ :sub:`0`\ [11:8]
+      - Y'\ :sub:`1`\ [11:4]
+      - Y'\ :sub:`2`\ [7:0]
+      - `- - - -` Y'\ :sub:`2`\ [11:8]
+
     * .. _V4L2-PIX-FMT-Y14:
 
       - ``V4L2_PIX_FMT_Y14``
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 5cdbd1a2fddb..cf9288d270c6 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -576,6 +576,8 @@  struct v4l2_pix_format {
 /* Grey bit-packed formats */
 #define V4L2_PIX_FMT_Y10BPACK    v4l2_fourcc('Y', '1', '0', 'B') /* 10  Greyscale bit-packed */
 #define V4L2_PIX_FMT_Y10P    v4l2_fourcc('Y', '1', '0', 'P') /* 10  Greyscale, MIPI RAW10 packed */
+#define V4L2_PIX_FMT_Y10X    v4l2_fourcc('Y', '1', '0', 'X') /* 10  Greyscale, 3 pixels in 4 bytes */
+#define V4L2_PIX_FMT_Y12X    v4l2_fourcc('Y', '1', '2', 'X') /* 12  Greyscale, 4 pixels in 5 bytes */
 
 /* Palette formats */
 #define V4L2_PIX_FMT_PAL8    v4l2_fourcc('P', 'A', 'L', '8') /*  8  8-bit palette */