Skip to contentSkip to conversation

drm: Introduce new DRM_FORMAT_XYUV

PATCH Superseded StanLis 2 participants 3 messages Aug 10, 2018 – Aug 13, 2018

Subsystems (2)

v5 of 12 Superseded Latest is v12 →

lore
Share & tools
lore

StanLis

author
#0 lore raw

PATCH v5 1/2 drm: Introduce new DRM_FORMAT_XYUV

From: Stanislav Lisovskiy <[email protected]>

v5: This is YUV444 packed format same as AYUV, but without alpha,
as supported by i915.

---
 drivers/gpu/drm/drm_fourcc.c  | 1 +
 include/uapi/drm/drm_fourcc.h | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/drm_fourcc.c +1 -0
index 5ca6395cd4d3..5bde1b20a098 100644
@@ -173,6 +173,7 @@ 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, .has_alpha = true },
+		{ .format = DRM_FORMAT_XYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = false },
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +1 -0
index d5e52350a3aa..c4eb69468eda 100644
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV		fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

Hi Stanislav,

FYI, we are trying to add same format under a slightly different name. See https://lists.freedesktop.org/archives/dri-devel/2018-July/184598.html

Quoted 16 lines · StanLis

From: Stanislav Lisovskiy <[email protected]>

v5: This is YUV444 packed format same as AYUV, but without alpha,
as supported by i915.

---
 drivers/gpu/drm/drm_fourcc.c  | 1 +
 include/uapi/drm/drm_fourcc.h | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/drm_fourcc.c +0 -0
index 5ca6395cd4d3..5bde1b20a098 100644

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

Quoted 4 lines
drivers/gpu/drm/drm_fourcc.c +1 -0
@@ -173,6 +173,7 @@ 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, .has_alpha = true },
+		{ .format = DRM_FORMAT_XYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = false },

I would rather drop the .has_alpha = false, since these lines are long enough already.

Quoted 22 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +1 -0
index d5e52350a3aa..c4eb69468eda 100644
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */
 
 #define DRM_FORMAT_AYUV		fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV		fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */
 
 /*
  * 2 plane RGB + A
Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Cheers,
Alex G
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 6 lines · Alexandru-Cosmin Gheorghe

Hi Stanislav,

FYI, we are trying to add same format under a slightly different name.
See https://lists.freedesktop.org/archives/dri-devel/2018-
July/184598.html

So we probably just need to decide, if this should be DRM_FORMAT_XYUV or DRM_FORMAT_XYUV8888 :)

Quoted 26 lines · StanLis
Quoted 24 lines

From: Stanislav Lisovskiy <[email protected]>

v5: This is YUV444 packed format same as AYUV, but without alpha,
as supported by i915.

---
 drivers/gpu/drm/drm_fourcc.c  | 1 +
 include/uapi/drm/drm_fourcc.h | 1 +
 2 files changed, 2 insertions(+)
drivers/gpu/drm/drm_fourcc.c +0 -0
index 5ca6395cd4d3..5bde1b20a098 100644
@@ -173,6 +173,7 @@ 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,

Quoted 8 lines
Quoted 4 lines

.has_alpha = true },

drivers/gpu/drm/drm_fourcc.c +1 -0
+		{ .format = DRM_FORMAT_XYUV,		.depth

= 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = false },

I would rather drop the .has_alpha = false, since these lines are long
enough already.

Sounds reasonable.

Quoted 29 lines
Quoted 27 lines
drivers/gpu/drm/drm_fourcc.c +0 -0
 	};
 
 	unsigned int i;
include/uapi/drm/drm_fourcc.h +0 -0
index d5e52350a3aa..c4eb69468eda 100644
@@ -112,6 +112,7 @@ extern "C" {
 #define DRM_FORMAT_VYUY		fourcc_code('V', 'Y', 'U',

'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */

#define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U',
'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */
+#define DRM_FORMAT_XYUV fourcc_code('X', 'Y', 'U',
'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */

/*
* 2 plane RGB + A

Signature · 6 lines
2.17.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx