diff mbox series

[v2,18/19] media: v4l2: Add 10- and 12-bpc luma-only formats with linear packing

Message ID 20201102224102.30292-19-laurent.pinchart@ideasonboard.com
State New
Headers show
Series [v2,01/19] media: videodev2.h: Remove unneeded comment about 4CC value | expand

Commit Message

Laurent Pinchart Nov. 2, 2020, 10:41 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(+)
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 ba8cd895cb0b..7c65d58d9e25 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 */