Skip to contentSkip to conversation

Add pixel formats for 10/16 bits YUV video

PATCH Superseded Randy Li 7 participants 27 messages Jan 4, 2017 – Oct 24, 2017

Subsystems (4)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Randy Li

author
#0 lore raw

v2 cover Add pixel formats for 10/16 bits YUV video

Those pixel formats mainly comes from Gstreamer and ffmpeg. Currently, the VOP(video output mixer) found on RK3288 and future support those 10 bits pixel formats are input. Also the decoder on RK3288 could use them as output.

The fourcc is not enough to store the endian information for those pixel formats in v4l2, as it doesn't have a flag like drm does.

I have not met the usage of those 16 bits per-channel format, it is a very large color range, even the DSLR only use 12 bits.

Randy Li (2):
drm_fourcc: Add new P010, P016 video format [media] v4l: Add 10/16-bits per channel YUV pixel formats

 Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++
 drivers/gpu/drm/drm_fourcc.c                  |   3 +
 include/uapi/drm/drm_fourcc.h                 |   2 +
 include/uapi/linux/videodev2.h                |   4 +
 7 files changed, 451 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p010.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p010m.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p016.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p016m.rst
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH v2 1/2 drm_fourcc: Add new P010, P016 video format

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

drm

---
 drivers/gpu/drm/drm_fourcc.c  | 3 +++
 include/uapi/drm/drm_fourcc.h | 2 ++
 2 files changed, 5 insertions(+)
drivers/gpu/drm/drm_fourcc.c +3 -0
index 90d2cc8..23c8e99 100644
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +2 -0
index 9e1bb7f..ecc2e05e5 100644
@@ -119,6 +119,8 @@ extern "C" {
 #define DRM_FORMAT_NV61		fourcc_code('N', 'V', '6', '1') /* 2x1 subsampled Cb:Cr plane */
 #define DRM_FORMAT_NV24		fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
 
 /*
  * 3 plane YCbCr
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH v2 1/2] drm_fourcc: Add new P010, P016 video format

Hi Randy,

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 169

Quoted 9 lines · Randy Li

index 90d2cc8..23c8e99 100644

drivers/gpu/drm/drm_fourcc.c +2 -0
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
                { .format = DRM_FORMAT_UYVY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
                { .format = DRM_FORMAT_VYUY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
                { .format = DRM_FORMAT_AYUV,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+               /* FIXME a pixel in Y for P010 is 10 bits */
+               { .format = DRM_FORMAT_P010,            .depth = 0,  .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 },

It seems like P010 stores each Y component in a 16-bit value, with the bottom 6 bits ignored. So I think cpp here should be 2.

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#3 lore raw

Re: [PATCH v2 1/2] drm_fourcc: Add new P010, P016 video format

從我的 iPad 傳送

Quoted 4 lines

Daniel Stone <[email protected]> 於 2017年1月5日 上午1:02 寫道:

Hi Randy,

Quoted 13 lines

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 169

Quoted 10 lines · Randy Li

index 90d2cc8..23c8e99 100644

drivers/gpu/drm/drm_fourcc.c +2 -0
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
               { .format = DRM_FORMAT_UYVY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
               { .format = DRM_FORMAT_VYUY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
               { .format = DRM_FORMAT_AYUV,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+               /* FIXME a pixel in Y for P010 is 10 bits */
+               { .format = DRM_FORMAT_P010,            .depth = 0,  .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 },

It seems like P010 stores each Y component in a 16-bit value, with the bottom 6 bits ignored. So I think cpp here should be 2.

No, the rest bits are used to store the next pixel. The P010 is just a 10 bits color depth pixel format.

Quoted 3 lines

Cheers,
Daniel

#4 lore raw

Re: [PATCH v2 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 21 lines · Ayaka

從我的 iPad 傳送

Quoted 4 lines

Daniel Stone <[email protected]> 於 2017年1月5日 上午1:02 寫道:

Hi Randy,

Quoted 13 lines

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 169

Quoted 10 lines · Randy Li

index 90d2cc8..23c8e99 100644

drivers/gpu/drm/drm_fourcc.c +2 -0
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
               { .format = DRM_FORMAT_UYVY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
               { .format = DRM_FORMAT_VYUY,            .depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
               { .format = DRM_FORMAT_AYUV,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+               /* FIXME a pixel in Y for P010 is 10 bits */
+               { .format = DRM_FORMAT_P010,            .depth = 0,  .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2 },

It seems like P010 stores each Y component in a 16-bit value, with the bottom 6 bits ignored. So I think cpp here should be 2.

Quoted 1 line

No, the rest bits are used to store the next pixel. The P010 is just a 10 bits color depth pixel format.

The reviewer is correct. In P010 and P016 the memory layout is identical as the luma and each Chroma channel are stored as words. .cpp = { 2, 4, 0 } for both P010 and P016.

-Clint

Quoted 9 lines
Quoted 3 lines

Cheers,
Daniel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#5 lore raw

PATCH v3 1/2 drm_fourcc: Add new P010, P016 video format

In reply to Randy Li

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P012 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   14 ++++++++++++++
 2 files changed, 18 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +14 -0
index ef20abb..788dc36 100644
@@ -128,6 +128,20 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats 
+ * index 0 = Y plane, word array [15:6] P010 
+ * index 0 = Y plane, word array [15:4] P012 
+ * index 0 = Y plane, word array [15:0] P016 
+ *  
+ * index 1 = U [31:22], V [15:6] P010
+ * index 1 = U [31:20], V [15:4] P012 
+ * index 1 = U [31:16], V [15:0] P016  
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

Re: [PATCH v3 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 44 lines · On Thu, Feb 23, 2017 at 03:58:19PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P012 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   14 ++++++++++++++
 2 files changed, 18 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..788dc36 100644
@@ -128,6 +128,20 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */

include/uapi/drm/drm_fourcc.h line 138

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +8 -0
 
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats 
+ * index 0 = Y plane, word array [15:6] P010 
+ * index 0 = Y plane, word array [15:4] P012 
+ * index 0 = Y plane, word array [15:0] P016 
+ *  
+ * index 1 = U [31:22], V [15:6] P010
+ * index 1 = U [31:20], V [15:4] P012 
+ * index 1 = U [31:16], V [15:0] P016  

We say Cb/Cr, not U/V. Also I'd like to see this explanation use the standard notation we have in this file for describing what the bits actually are. And we need to specify the endianness explicitly.

So something like this perhaps :)
https://lists.freedesktop.org/archives/dri-devel/2017-January/128808.html

Quoted 11 lines
include/uapi/drm/drm_fourcc.h +6 -0
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 1 line
1.7.9.5
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH v4 1/2 drm_fourcc: Add new P010, P016 video format

In reply to Randy Li

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +18 -0
index ef20abb..ad94464 100644
@@ -128,6 +128,24 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats
+ * index 0 = Y plane, word array [15:6] P010
+ * or
+ * index 0 = Y plane, word array [15:4] P012
+ * or 
+ * index 0 = Y plane, word array [15:0] P016
+ *
+ * index 1 = Cb:Cr plane, [31:22] Cb [15:6] Cr little endian P010
+ * or
+ * index 1 = Cb:Cr plane, [31:20] Cb [15:4] Cr little endian P012
+ * or
+ * index 1 = Cb:Cr plane, [31:16] Cb [15:0] Cr little endian P016
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

Re: [PATCH v4 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 29 lines · On Mon, Feb 27, 2017 at 09:21:09AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
drivers/gpu/drm/drm_fourcc.c +0 -0
index 90d2cc8..5494764 100644

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 172

Quoted 8 lines
drivers/gpu/drm/drm_fourcc.c +4 -0
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};

What's this hunk doing here?

Quoted 13 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +3 -0
index ef20abb..ad94464 100644
@@ -128,6 +128,24 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats
+ * index 0 = Y plane, word array [15:6] P010
+ * or

include/uapi/drm/drm_fourcc.h line 143

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10 -0
+ * index 0 = Y plane, word array [15:4] P012
+ * or 
+ * index 0 = Y plane, word array [15:0] P016
+ *
+ * index 1 = Cb:Cr plane, [31:22] Cb [15:6] Cr little endian P010
+ * or
+ * index 1 = Cb:Cr plane, [31:20] Cb [15:4] Cr little endian P012
+ * or
+ * index 1 = Cb:Cr plane, [31:16] Cb [15:0] Cr little endian P016
+ */

Still looks somewhat out of place when compared with the rest of the file.

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +5 -0
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 1 line
1.7.9.5
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

Re: [PATCH v4 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · On Mon, Feb 27, 2017 at 09:21:09AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
Quoted 15 lines

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 172

Quoted 13 lines
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};

What's this hunk doing here?

This hunk defines the memory layout definition to DRM, so framebuffers can be checked to make sure they are large enough for the format. Can you describe your concern here?

Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..ad94464 100644
@@ -128,6 +128,24 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
Quoted 16 lines
Quoted 4 lines
include/uapi/drm/drm_fourcc.h +3 -0
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats
+ * index 0 = Y plane, word array [15:6] P010
+ * or

include/uapi/drm/drm_fourcc.h line 143

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10 -0
+ * index 0 = Y plane, word array [15:4] P012
+ * or
+ * index 0 = Y plane, word array [15:0] P016
+ *
+ * index 1 = Cb:Cr plane, [31:22] Cb [15:6] Cr little endian P010
+ * or
+ * index 1 = Cb:Cr plane, [31:20] Cb [15:4] Cr little endian P012
+ * or
+ * index 1 = Cb:Cr plane, [31:16] Cb [15:0] Cr little endian P016
+ */

Still looks somewhat out of place when compared with the rest of the file.

The other YUV entries in the file all have 8 bit definitions and are easily grouped together. The P0?? formats change their number of bits. The only way I see is to make the comments look like the other YUV formats is to make each format have its own comment block describing the layout. I feel it's better to group them together since the difference between them (bpc) is minor.

perhaps moving the bit definitions to the defines, but then again it won't look like the other YUV format. It will look more like the RGB defines.

-Clint

Quoted 12 lines
Quoted 11 lines
include/uapi/drm/drm_fourcc.h +5 -1
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
--

1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#10 lore raw

Re: [PATCH v4 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 42 lines · Clint Taylor
Quoted 25 lines · Ville Syrjälä
Quoted 24 lines · On Mon, Feb 27, 2017 at 09:21:09AM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   18 ++++++++++++++++++
 2 files changed, 22 insertions(+)
Quoted 15 lines

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 172

Quoted 13 lines
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};

What's this hunk doing here?

Quoted 3 lines

This hunk defines the memory layout definition to DRM, so framebuffers can be checked to make sure they are large enough for the format. Can you describe your concern here?

Sorry. Just misread it hastily and thought it was something else. This lgtm.

Quoted 35 lines
Quoted 11 lines
Quoted 11 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..ad94464 100644
@@ -128,6 +128,24 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
Quoted 16 lines
Quoted 4 lines
include/uapi/drm/drm_fourcc.h +3 -0
 /*
+ * 2 plane YCbCr MSB aligned P0?? formats
+ * index 0 = Y plane, word array [15:6] P010
+ * or

include/uapi/drm/drm_fourcc.h line 143

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +10 -0
+ * index 0 = Y plane, word array [15:4] P012
+ * or
+ * index 0 = Y plane, word array [15:0] P016
+ *
+ * index 1 = Cb:Cr plane, [31:22] Cb [15:6] Cr little endian P010
+ * or
+ * index 1 = Cb:Cr plane, [31:20] Cb [15:4] Cr little endian P012
+ * or
+ * index 1 = Cb:Cr plane, [31:16] Cb [15:0] Cr little endian P016
+ */

Still looks somewhat out of place when compared with the rest of the file.

The other YUV entries in the file all have 8 bit definitions and are easily grouped together. The P0?? formats change their number of bits. The only way I see is to make the comments look like the other YUV formats is to make each format have its own comment block describing the layout. I feel it's better to group them together since the difference between them (bpc) is minor.

Quoted 3 lines

perhaps moving the bit definitions to the defines, but then again it won't look like the other YUV format. It will look more like the RGB defines.

I was mainly refrering to the way you specified the bits for each component.

So to be consistent with most other things I think it should look something like this:

"index 0 = Y plane, [15:0] Y:X 10:6 little endian" "index 1 = Cr:Cb plane, [31:0] Cr:X:Cb:X 10:6:10:6 little endian"

That might not be the world's best notation, but consistency trumps everything else here IMO. If someone has a good idea for a better notation I'd like to see it. And if we change the notation for one thing then we should change it for everything. Otherwise people will get even more confused when reading this stuff.

Quoted 15 lines

-Clint

Quoted 12 lines
Quoted 11 lines
include/uapi/drm/drm_fourcc.h +5 -1
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
--

1.7.9.5

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#11 lore raw

PATCH v5 1/2 drm_fourcc: Add new P010, P016 video format

In reply to Randy Li

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +21 -0
index ef20abb..306f979 100644
@@ -128,6 +128,27 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#12 lore raw

Re: [PATCH v5 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 30 lines · On 02/28/2017 06:57 AM, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
  drivers/gpu/drm/drm_fourcc.c  |    4 ++++
  include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
  2 files changed, 25 insertions(+)
drivers/gpu/drm/drm_fourcc.c +0 -0
index 90d2cc8..5494764 100644

drivers/gpu/drm/drm_fourcc.c const struct drm_format_info *__drm_format_info(u32 format) · line 168

Quoted 4 lines
drivers/gpu/drm/drm_fourcc.c +1 -0
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
  		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
  		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
  		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */

You may remove this line, I misunderstand the P010 that time.
What I want is adding a new pixel format never be defined before, may it should be called P010_PACK or something else.

Quoted 28 lines
drivers/gpu/drm/drm_fourcc.c +3 -0
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
  	};
 
  	unsigned int i;
include/uapi/drm/drm_fourcc.h +14 -0
index ef20abb..306f979 100644
@@ -128,6 +128,27 @@
  #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
  /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+
+/*

include/uapi/drm/drm_fourcc.h line 154

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +7 -0
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
   * 3 plane YCbCr
   * index 0: Y plane, [7:0] Y
   * index 1: Cb plane, [7:0] Cb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw

Re: [PATCH v5 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 28 lines · ayaka
Quoted 25 lines · On 02/28/2017 06:57 AM, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
  drivers/gpu/drm/drm_fourcc.c  |    4 ++++
  include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
  2 files changed, 25 insertions(+)
Quoted 14 lines
Quoted 11 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info
 *__drm_format_info(u32 format)
          { .format = DRM_FORMAT_UYVY,        .depth = 0,  .num_planes
 = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
          { .format = DRM_FORMAT_VYUY,        .depth = 0,  .num_planes
 = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
          { .format = DRM_FORMAT_AYUV,        .depth = 0,  .num_planes
Quoted 2 lines

= 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+ /* FIXME a pixel in Y for P010 is 10 bits */

You may remove this line, I misunderstand the P010 that time.

That will look better. Thanks.

Quoted 2 lines

What I want is adding a new pixel format never be defined before, may it should be called P010_PACK

We could probably add the PACK variants as DRM_FORMAT_P010V

Quoted 37 lines

or something else.

Quoted 36 lines

+ { .format = DRM_FORMAT_P010, .depth = 0, .num_planes
= 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+ { .format = DRM_FORMAT_P012, .depth = 0, .num_planes
= 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+ { .format = DRM_FORMAT_P016, .depth = 0, .num_planes
= 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },

      };
        unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..306f979 100644
@@ -128,6 +128,27 @@
  #define DRM_FORMAT_NV42        fourcc_code('N', 'V', '4', '2') /*

non-subsampled Cb:Cr plane */

    /*

+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2
subsampled Cb:Cr plane 10 bits per channel */

include/uapi/drm/drm_fourcc.h +7 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012        fourcc_code('P', '0', '1', '2') /* 2x2

subsampled Cb:Cr plane 12 bits per channel */

include/uapi/drm/drm_fourcc.h +5 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
Quoted 9 lines

include/uapi/drm/drm_fourcc.h line 154

Quoted 8 lines

+ */
+#define DRM_FORMAT_P016 fourcc_code('P', '0', '1', '6') /* 2x2
subsampled Cb:Cr plane 16 bits per channel */

include/uapi/drm/drm_fourcc.h +2 -0
+
+/*
   * 3 plane YCbCr
   * index 0: Y plane, [7:0] Y
   * index 1: Cb plane, [7:0] Cb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw

Re: [PATCH v5 1/2] drm_fourcc: Add new P010, P016 video format

In reply to [email protected]
Quoted 45 lines · On Mon, Feb 27, 2017 at 02:57:58PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..306f979 100644

include/uapi/drm/drm_fourcc.h line 134

Quoted 7 lines
include/uapi/drm/drm_fourcc.h +4 -0
@@ -128,6 +128,27 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */

Your Cb and Cr look swapped (unless my memory is playing tricks on me).

Quoted 22 lines
include/uapi/drm/drm_fourcc.h +17 -0
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 1 line
1.7.9.5
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#15 lore raw

Re: [PATCH v5 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 48 lines · Ville Syrjälä
Quoted 47 lines · On Mon, Feb 27, 2017 at 02:57:58PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..306f979 100644
@@ -128,6 +128,27 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
Quoted 7 lines

include/uapi/drm/drm_fourcc.h line 134

Quoted 5 lines
include/uapi/drm/drm_fourcc.h +4 -0
 /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */

Your Cb and Cr look swapped (unless my memory is playing tricks on me).

This is the information I have:
Y U V

YUV 4:2:0  8 bpc - NV12  7:0  15:8  7:0
YUV 4:2:0 10 bpc - P010 15:6  31:22 15:6
YUV 4:2:0 12 bpc - P012 15:4  31:20 15:4
YUV 4:2:0 16 bpc - P016 15:0  31:16 15:0

-clint

Quoted 15 lines
Quoted 15 lines
include/uapi/drm/drm_fourcc.h +14 -0
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
+ */
Quoted 9 lines
Quoted 8 lines
include/uapi/drm/drm_fourcc.h +3 -1
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
--

1.7.9.5

_______________________________________________
dri-devel mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#16 lore raw

Re: [PATCH v5 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 57 lines · Clint Taylor
Quoted 48 lines · Ville Syrjälä
Quoted 47 lines · On Mon, Feb 27, 2017 at 02:57:58PM -0800, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    4 ++++
 include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
 2 files changed, 25 insertions(+)
drivers/gpu/drm/drm_fourcc.c +4 -0
index 90d2cc8..5494764 100644
@@ -165,6 +165,10 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		/* FIXME a pixel in Y for P010 is 10 bits */
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index ef20abb..306f979 100644
@@ -128,6 +128,27 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
Quoted 7 lines

include/uapi/drm/drm_fourcc.h line 134

Quoted 5 lines
include/uapi/drm/drm_fourcc.h +4 -0
 /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [10:6:10:6] little endian
+ */

Your Cb and Cr look swapped (unless my memory is playing tricks on me).

Quoted 6 lines

This is the information I have:
Y U V

YUV 4:2:0  8 bpc - NV12  7:0  15:8  7:0
YUV 4:2:0 10 bpc - P010 15:6  31:22 15:6
YUV 4:2:0 12 bpc - P012 15:4  31:20 15:4
YUV 4:2:0 16 bpc - P016 15:0  31:16 15:0

I don't think those match the MS docs

https://msdn.microsoft.com/en-us/library/windows/desktop/bb970578%28v=vs.85%29.aspx

Quoted 27 lines

-clint

Quoted 24 lines
Quoted 23 lines
include/uapi/drm/drm_fourcc.h +17 -1
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cb:Cr plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:x:Cr:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cb:Cr plane 12 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cb:Cr plane, [31:0] Cb:Cr [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cb:Cr plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
--

1.7.9.5

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#17 lore raw

PATCH v6 1/2 drm_fourcc: Add new P010, P016 video format

In reply to Randy Li

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format
V6: reversed Cb/Cr order in comments

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
 drivers/gpu/drm/drm_fourcc.c  |    3 +++
 include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
 2 files changed, 24 insertions(+)
drivers/gpu/drm/drm_fourcc.c +3 -0
index 90d2cc8..3e0fd58 100644
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +21 -0
index ef20abb..762646d 100644
@@ -128,6 +128,27 @@
 #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
 /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
+
+/*
  * 3 plane YCbCr
  * index 0: Y plane, [7:0] Y
  * index 1: Cb plane, [7:0] Cb
Signature · 6 lines
1.7.9.5

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#18 lore raw

Re: [PATCH v6 1/2] drm_fourcc: Add new P010, P016 video format

Is this one going to land soon? The discussion was a bit hard to read but it looks like in the end consensus was that everything looks good in this patch.

Thanks;

Quoted 63 lines · On 03/01/2017 01:21 AM, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format
V6: reversed Cb/Cr order in comments

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>
---
  drivers/gpu/drm/drm_fourcc.c  |    3 +++
  include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++
  2 files changed, 24 insertions(+)
drivers/gpu/drm/drm_fourcc.c +3 -0
index 90d2cc8..3e0fd58 100644
@@ -165,6 +165,9 @@ const struct drm_format_info *__drm_format_info(u32 format)
  		{ .format = DRM_FORMAT_UYVY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
  		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
  		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+		{ .format = DRM_FORMAT_P010,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P012,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+		{ .format = DRM_FORMAT_P016,		.depth = 0,  .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
  	};
 
  	unsigned int i;
include/uapi/drm/drm_fourcc.h +14 -0
index ef20abb..762646d 100644
@@ -128,6 +128,27 @@
  #define DRM_FORMAT_NV42		fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
 
  /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010		fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane 10 bits per channel */
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012		fourcc_code('P', '0', '1', '2') /* 2x2 subsampled Cr:Cb plane 12 bits per channel */
+
+/*

include/uapi/drm/drm_fourcc.h line 154

Quoted 10 lines
include/uapi/drm/drm_fourcc.h +7 -0
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
+ */
+#define DRM_FORMAT_P016		fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */
+
+/*
   * 3 plane YCbCr
   * index 0: Y plane, [7:0] Y
   * index 1: Cb plane, [7:0] Cb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#19 lore raw

Re: [PATCH v6 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 1 line · Tapani Pälli

Is this one going to land soon? The discussion was a bit hard to read but it looks like in the end consensus was that everything looks good in this patch.

I am very sorry, I am too busy with  the other dma problem in rockchip.
The main problem is that none of the driver have used those format. Although the rockchip vop supports 10 bit pixel format but not the p010.

Quoted 75 lines

Thanks;

Quoted 70 lines · On 03/01/2017 01:21 AM, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format
V6: reversed Cb/Cr order in comments

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>

---
  drivers/gpu/drm/drm_fourcc.c  |    3 +++ include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++

  2 files changed, 24 insertions(+)
drivers/gpu/drm/drm_fourcc.c +3 -0
index 90d2cc8..3e0fd58 100644
@@ -165,6 +165,9 @@ const struct drm_format_info 
 *__drm_format_info(u32 format)
           { .format = DRM_FORMAT_UYVY,        .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
           { .format = DRM_FORMAT_VYUY,        .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
           { .format = DRM_FORMAT_AYUV,        .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+        { .format = DRM_FORMAT_P010,        .depth = 0, .num_planes 
 = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+        { .format = DRM_FORMAT_P012,        .depth = 0, .num_planes 
 = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+        { .format = DRM_FORMAT_P016,        .depth = 0, .num_planes 

= 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
      };
        unsigned int i;

include/uapi/drm/drm_fourcc.h +5 -0
index ef20abb..762646d 100644
@@ -128,6 +128,27 @@
   #define DRM_FORMAT_NV42        fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
     /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010        fourcc_code('P', '0', '1', '0') /* 

2x2 subsampled Cr:Cb plane 10 bits per channel */

include/uapi/drm/drm_fourcc.h +7 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012        fourcc_code('P', '0', '1', '2') /* 

2x2 subsampled Cr:Cb plane 12 bits per channel */

include/uapi/drm/drm_fourcc.h +6 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
+ */
Quoted 8 lines
Quoted 8 lines

+#define DRM_FORMAT_P016        fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */

include/uapi/drm/drm_fourcc.h +2 -0
+
+/*

   * 3 plane YCbCr
   * index 0: Y plane, [7:0] Y
   * index 1: Cb plane, [7:0] Cb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#20 lore raw

Re: [PATCH v6 1/2] drm_fourcc: Add new P010, P016 video format

Quoted 6 lines · ayaka
Quoted 1 line · Tapani Pälli

Is this one going to land soon? The discussion was a bit hard to read but it looks like in the end consensus was that everything looks good in this patch.

I am very sorry, I am too busy with  the other dma problem in rockchip.
The main problem is that none of the driver have used those format. Although the rockchip vop supports 10 bit pixel format but not the p010.

OK no worries, I thought these formats are already used by some driver.

Quoted 75 lines
Quoted 75 lines

Thanks;

Quoted 70 lines · On 03/01/2017 01:21 AM, [email protected] wrote:

From: Clint Taylor <[email protected]>

P010 is a planar 4:2:0 YUV with interleaved UV plane, 10 bits per channel video format. Rockchip's vop support this video format(little endian only) as the input video format.

P016 is a planar 4:2:0 YUV 12 bits per channel

P016 is a planar 4:2:0 YUV with interleaved UV plane, 16 bits per channel video format.

V3: Added P012 and fixed cpp for P010
V4: format definition refined per review
V5: Format comment block for each new pixel format
V6: reversed Cb/Cr order in comments

Cc Daniel Stone <[email protected]>
Cc Ville Syrjälä <[email protected]>

---
  drivers/gpu/drm/drm_fourcc.c  |    3 +++ include/uapi/drm/drm_fourcc.h |   21 +++++++++++++++++++++

  2 files changed, 24 insertions(+)
drivers/gpu/drm/drm_fourcc.c +3 -0
index 90d2cc8..3e0fd58 100644
@@ -165,6 +165,9 @@ const struct drm_format_info 
 *__drm_format_info(u32 format)
           { .format = DRM_FORMAT_UYVY,        .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
           { .format = DRM_FORMAT_VYUY,        .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1 },
           { .format = DRM_FORMAT_AYUV,        .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 },
+        { .format = DRM_FORMAT_P010,        .depth = 0, .num_planes 
 = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+        { .format = DRM_FORMAT_P012,        .depth = 0, .num_planes 
 = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
+        { .format = DRM_FORMAT_P016,        .depth = 0, .num_planes 

= 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2 },
      };
        unsigned int i;

include/uapi/drm/drm_fourcc.h +5 -0
index ef20abb..762646d 100644
@@ -128,6 +128,27 @@
   #define DRM_FORMAT_NV42        fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */
     /*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [10:6] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [10:6:10:6] little endian
+ */
+#define DRM_FORMAT_P010        fourcc_code('P', '0', '1', '0') /* 

2x2 subsampled Cr:Cb plane 10 bits per channel */

include/uapi/drm/drm_fourcc.h +7 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y:x [12:4] little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:x:Cb:x [12:4:12:4] little endian
+ */
+#define DRM_FORMAT_P012        fourcc_code('P', '0', '1', '2') /* 

2x2 subsampled Cr:Cb plane 12 bits per channel */

include/uapi/drm/drm_fourcc.h +6 -0
+
+/*
+ * 2 plane YCbCr MSB aligned
+ * index 0 = Y plane, [15:0] Y little endian
+ * index 1 = Cr:Cb plane, [31:0] Cr:Cb [16:16] little endian
+ */
Quoted 9 lines
Quoted 8 lines
Quoted 8 lines

+#define DRM_FORMAT_P016        fourcc_code('P', '0', '1', '6') /* 2x2 subsampled Cr:Cb plane 16 bits per channel */

include/uapi/drm/drm_fourcc.h +2 -0
+
+/*

   * 3 plane YCbCr
   * index 0: Y plane, [7:0] Y
   * index 1: Cb plane, [7:0] Cb

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#21 lore raw

PATCH v2 2/2 v4l: Add 10/16-bits per channel YUV pixel formats

In reply to Randy Li

The formats added by this patch are:

	V4L2_PIX_FMT_P010
	V4L2_PIX_FMT_P010M
	V4L2_PIX_FMT_P016
	V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

v4l2

---
 Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++
 include/uapi/linux/videodev2.h                |   4 +
 5 files changed, 446 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p010.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p010m.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p016.rst
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-p016m.rst
Documentation/media/uapi/v4l/pixfmt-p010.rst new file +86 -0
new file mode 100644
index 0000000..82b300c
@@ -0,0 +1,86 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _V4L2-PIX-FMT-P010:
+
+******************************************************
+V4L2_PIX_FMT_P010 ('P010')
+******************************************************
+
+
+V4L2_PIX_FMT_P010
+Formats with ½ horizontal and vertical chroma resolution. One luminance and
+one chrominance plane with alternating
+chroma samples as simliar to ``V4L2_PIX_FMT_NV12``
+
+
+Description
+===========
+
+It is a two-plane versions of the YUV 4:2:0 format. The three
+components are separated into two sub-images or planes. The Y plane is
+first. The Y plane has 10 bits per pixel. For ``V4L2_PIX_FMT_P010``, a
+combined CbCr plane immediately follows the Y plane in memory. The CbCr
+plane is the same width, in bytes, as the Y plane (and of the image),
+but is half as tall in pixels. Each CbCr pair belongs to four pixels.
+For example, Cb\ :sub:`0`/Cr\ :sub:`0` belongs to Y'\ :sub:`00`,
+Y'\ :sub:`01`, Y'\ :sub:`10`, Y'\ :sub:`11`.
+If the Y plane has pad bytes after each row, then the CbCr plane has as
+many pad bytes after its rows.
+
+
+**Color Sample Location..**
+
+.. flat-table::
+    :header-rows:  0
+    :stub-columns: 0
+
+    * -
+      - 0
+      -
+      - 1
+      - 2
+      -
+      - 3
+    * - 0
+      - Y
+      -
+      - Y
+      - Y
+      -
+      - Y
+    * -
+      -
+      - C
+      -
+      -
+      - C
+      -
+    * - 1
+      - Y
+      -
+      - Y
+      - Y
+      -
+      - Y
+    * -
+    * - 2
+      - Y
+      -
+      - Y
+      - Y
+      -
+      - Y
+    * -
+      -
+      - C
+      -
+      -
+      - C
+      -
+    * - 3
+      - Y
+      -
+      - Y
+      - Y
+      -
+      - Y
Documentation/media/uapi/v4l/pixfmt-p010m.rst new file +94 -0

94 lines not on this page · raw message

Documentation/media/uapi/v4l/pixfmt-p016.rst new file +126 -0

126 lines not on this page · raw message

Documentation/media/uapi/v4l/pixfmt-p016m.rst new file +136 -0

136 lines not on this page · raw message

include/uapi/linux/videodev2.h +4 -0
index 46e8a2e3..43b61f3 100644
@@ -551,6 +551,8 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_NV61    v4l2_fourcc('N', 'V', '6', '1') /* 16  Y/CrCb 4:2:2  */
 #define V4L2_PIX_FMT_NV24    v4l2_fourcc('N', 'V', '2', '4') /* 24  Y/CbCr 4:4:4  */
 #define V4L2_PIX_FMT_NV42    v4l2_fourcc('N', 'V', '4', '2') /* 24  Y/CrCb 4:4:4  */
+#define V4L2_PIX_FMT_P010    v4l2_fourcc('P', '0', '1', '0') /* 20  Y/CbCr 4:2:0, 10 bits per channel */
+#define V4L2_PIX_FMT_P016    v4l2_fourcc('P', '0', '1', '6') /* 32  Y/CbCr 4:2:0, 16 bits per channel */
 
 /* two non contiguous planes - one Y, one Cr + Cb interleaved  */
 #define V4L2_PIX_FMT_NV12M   v4l2_fourcc('N', 'M', '1', '2') /* 12  Y/CbCr 4:2:0  */
@@ -559,6 +561,8 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_NV61M   v4l2_fourcc('N', 'M', '6', '1') /* 16  Y/CrCb 4:2:2  */
 #define V4L2_PIX_FMT_NV12MT  v4l2_fourcc('T', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 64x32 macroblocks */
 #define V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12  Y/CbCr 4:2:0 16x16 macroblocks */
+#define V4L2_PIX_FMT_P010M   v4l2_fourcc('P', 'M', '1', '0') /* 20  Y/CbCr 4:2:0, 10 bits per channel */
+#define V4L2_PIX_FMT_P016M   v4l2_fourcc('P', 'M', '1', '6') /* 32  Y/CbCr 4:2:0, 16 bits per channel */
 
 /* three planes - Y Cb, Cr */
 #define V4L2_PIX_FMT_YUV410  v4l2_fourcc('Y', 'U', 'V', '9') /*  9  YUV 4:1:0     */
Signature · 1 line
2.7.4
#22 lore raw

Re: [PATCH v2 2/2] [media] v4l: Add 10/16-bits per channel YUV pixel formats

Hi Randy,

Thanks for the update.

Quoted 10 lines · Randy Li

The formats added by this patch are:

	V4L2_PIX_FMT_P010
	V4L2_PIX_FMT_P010M
	V4L2_PIX_FMT_P016
	V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

Quoted 8 lines

v4l2

---
 Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++

You need to include the formats in pixfmt.rst in order to compile the documentation.

$ make htmldocs

And you'll find it in Documentation/output/media/uapi/v4l/v4l2.html .

In Debian you'll need to install sphinx-common and python3-sphinx-rtd-theme .

Regarding P010 and the rest --- I'm fine with that, considering also that NV12 was never a great name for a format...

Signature · 8 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#23 lore raw

Re: [PATCH v2 2/2] [media] v4l: Add 10/16-bits per channel YUV pixel formats

Quoted 26 lines · Sakari Ailus

Hi Randy,

Thanks for the update.

Quoted 10 lines · Randy Li

The formats added by this patch are:

	V4L2_PIX_FMT_P010
	V4L2_PIX_FMT_P010M
	V4L2_PIX_FMT_P016
	V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

Quoted 8 lines

v4l2

---
  Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
  Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
  Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
  Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++

You need to include the formats in pixfmt.rst in order to compile the documentation.

Quoted 6 lines
$ make htmldocs

And you'll find it in Documentation/output/media/uapi/v4l/v4l2.html .

In Debian you'll need to install sphinx-common and python3-sphinx-rtd-theme .

OK, I would fix them in new version.
The view of byte order for P010 serial is left empty, it is a little hard for me to use flat-table to draw them. Is there possible to use something like latex to do this job?

Quoted 4 lines

Regarding P010 and the rest --- I'm fine with that, considering also that NV12 was never a great name for a format...

#24 lore raw

Re: [PATCH v2 2/2] [media] v4l: Add 10/16-bits per channel YUV pixel formats

Hi Randy,

Quoted 31 lines · ayaka
Quoted 28 lines · Sakari Ailus

Hi Randy,

Thanks for the update.

Quoted 10 lines · Randy Li

The formats added by this patch are:

	V4L2_PIX_FMT_P010
	V4L2_PIX_FMT_P010M
	V4L2_PIX_FMT_P016
	V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

Quoted 8 lines

v4l2

---
 Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++

You need to include the formats in pixfmt.rst in order to compile the documentation.

$ make htmldocs
Quoted 8 lines
Quoted 4 lines

And you'll find it in Documentation/output/media/uapi/v4l/v4l2.html .

In Debian you'll need to install sphinx-common and python3-sphinx-rtd-theme .

OK, I would fix them in new version.
The view of byte order for P010 serial is left empty, it is a little hard for me to use flat-table to draw them. Is there possible to use something like latex to do this job?

Hmm. Not as far as I know. We recently switched from DocBook mostly due to ReST being more simple to use AFAIU. I think LaTeX output could be produced ReST, that might not be very helpful here though.

Quoted 5 lines
Quoted 4 lines

Regarding P010 and the rest --- I'm fine with that, considering also that NV12 was never a great name for a format...

Signature · 8 lines
Kind regards,

Sakari Ailus
e-mail: [email protected]	XMPP: [email protected]
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#25 lore raw

Re: [PATCH v2 2/2] [media] v4l: Add 10/16-bits per channel YUV pixel formats

Em Thu, 5 Jan 2017 20:27:17 +0200
Sakari Ailus <[email protected]> escreveu:

Quoted 38 lines

Hi Randy,

Quoted 35 lines · ayaka
Quoted 32 lines · Sakari Ailus

Hi Randy,

Thanks for the update.

Quoted 10 lines · Randy Li

The formats added by this patch are:

	V4L2_PIX_FMT_P010
	V4L2_PIX_FMT_P010M
	V4L2_PIX_FMT_P016
	V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

Quoted 8 lines

v4l2

---
 Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
 Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++  

You need to include the formats in pixfmt.rst in order to compile the documentation.

$ make htmldocs

And you'll find it in Documentation/output/media/uapi/v4l/v4l2.html .

In Debian you'll need to install sphinx-common and python3-sphinx-rtd-theme .

Quoted 8 lines
Quoted 4 lines

OK, I would fix them in new version.
The view of byte order for P010 serial is left empty, it is a little hard for me to use flat-table to draw them. Is there possible to use something like latex to do this job?

Hmm. Not as far as I know. We recently switched from DocBook mostly due to ReST being more simple to use AFAIU. I think LaTeX output could be produced ReST, that might not be very helpful here though.

No, you can't use LaTeX, as it won't be properly displayed on all output formats. There are a few options to define tables in ReST, but we prefer using flat-table because the other formats are harder to maintain at the V4L2 uAPI documentation.

Just one note about this series: it won't be merged upstream until someone adds a driver needing those pixel formats.

Regards,
Mauro

Thanks,
Mauro

author
#26 lore raw

Re: [PATCH v2 2/2] [media] v4l: Add 10/16-bits per channel YUV pixel formats

從我的 iPad 傳送

Quoted 52 lines

Mauro Carvalho Chehab <[email protected]> 於 2017年2月3日 下午10:04 寫道:

Em Thu, 5 Jan 2017 20:27:17 +0200
Sakari Ailus <[email protected]> escreveu:

Quoted 38 lines

Hi Randy,

Quoted 36 lines · ayaka
Quoted 35 lines · Sakari Ailus

Hi Randy,

Thanks for the update.

Quoted 11 lines · Randy Li

The formats added by this patch are:

   V4L2_PIX_FMT_P010
   V4L2_PIX_FMT_P010M
   V4L2_PIX_FMT_P016
   V4L2_PIX_FMT_P016M

Currently, none of driver uses those format, but some video device has been confirmed with could as those format for video output. The Rockchip's new decoder has supported those 10 bits format for profile_10 HEVC/AVC video.

Quoted 8 lines

v4l2
---

Documentation/media/uapi/v4l/pixfmt-p010.rst  |  86 ++++++++++++++++
Documentation/media/uapi/v4l/pixfmt-p010m.rst |  94 ++++++++++++++++++
Documentation/media/uapi/v4l/pixfmt-p016.rst  | 126 ++++++++++++++++++++++++
Documentation/media/uapi/v4l/pixfmt-p016m.rst | 136 ++++++++++++++++++++++++++  

You need to include the formats in pixfmt.rst in order to compile the documentation.

$ make htmldocs

And you'll find it in Documentation/output/media/uapi/v4l/v4l2.html .

In Debian you'll need to install sphinx-common and python3-sphinx-rtd-theme .

Quoted 8 lines
Quoted 4 lines

OK, I would fix them in new version.
The view of byte order for P010 serial is left empty, it is a little hard for me to use flat-table to draw them. Is there possible to use something like latex to do this job?

Hmm. Not as far as I know. We recently switched from DocBook mostly due to ReST being more simple to use AFAIU. I think LaTeX output could be produced ReST, that might not be very helpful here though.

Quoted 8 lines

No, you can't use LaTeX, as it won't be properly displayed on all output formats. There are a few options to define tables in ReST, but we prefer using flat-table because the other formats are harder to maintain at the V4L2 uAPI documentation.

Just one note about this series: it won't be merged upstream until someone adds a driver needing those pixel formats.

I made a mistake, the pixel format I want is not P010, I would post a new patch for that.

Quoted 6 lines

Regards,
Mauro

Thanks,
Mauro