[PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010

Tomi Valkeinen posted 11 patches 10 months ago
There is a newer version of this series
[PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Tomi Valkeinen 10 months ago
Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
container.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
 drivers/gpu/drm/drm_fourcc.c  | 1 +
 include/uapi/drm/drm_fourcc.h | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index cc7e1ef4ef21..07b03b0fe9ad 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -280,6 +280,7 @@ const struct drm_format_info *__drm_format_info(u32 format)
 		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
 		{ .format = DRM_FORMAT_XYUV8888,	.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
 		{ .format = DRM_FORMAT_VUY888,          .depth = 0,  .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
+		{ .format = DRM_FORMAT_XVUY2101010,     .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
 		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true },
 		{ .format = DRM_FORMAT_Y210,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
 		{ .format = DRM_FORMAT_Y212,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
index f936cac2aebc..7e8aa3bd52b9 100644
--- a/include/uapi/drm/drm_fourcc.h
+++ b/include/uapi/drm/drm_fourcc.h
@@ -246,6 +246,7 @@ extern "C" {
 #define DRM_FORMAT_XVUY8888	fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
 #define DRM_FORMAT_VUY888	fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
 #define DRM_FORMAT_VUY101010	fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
+#define DRM_FORMAT_XVUY2101010	fourcc_code('X', 'Y', '3', '0') /* [31:0] x:Cr:Cb:Y 2:10:10:10 little endian */
 
 /*
  * packed Y2xx indicate for each component, xx valid data occupy msb

-- 
2.43.0
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Dmitry Baryshkov 10 months ago
On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
> container.

Is there a more common name for this format? Otherwise googling for it
reveals only your series.

> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> ---
>  drivers/gpu/drm/drm_fourcc.c  | 1 +
>  include/uapi/drm/drm_fourcc.h | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
> index cc7e1ef4ef21..07b03b0fe9ad 100644
> --- a/drivers/gpu/drm/drm_fourcc.c
> +++ b/drivers/gpu/drm/drm_fourcc.c
> @@ -280,6 +280,7 @@ const struct drm_format_info *__drm_format_info(u32 format)
>  		{ .format = DRM_FORMAT_VYUY,		.depth = 0,  .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
>  		{ .format = DRM_FORMAT_XYUV8888,	.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
>  		{ .format = DRM_FORMAT_VUY888,          .depth = 0,  .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
> +		{ .format = DRM_FORMAT_XVUY2101010,     .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true },
>  		{ .format = DRM_FORMAT_AYUV,		.depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true },
>  		{ .format = DRM_FORMAT_Y210,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
>  		{ .format = DRM_FORMAT_Y212,            .depth = 0,  .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true },
> diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h
> index f936cac2aebc..7e8aa3bd52b9 100644
> --- a/include/uapi/drm/drm_fourcc.h
> +++ b/include/uapi/drm/drm_fourcc.h
> @@ -246,6 +246,7 @@ extern "C" {
>  #define DRM_FORMAT_XVUY8888	fourcc_code('X', 'V', 'U', 'Y') /* [31:0] X:Cr:Cb:Y 8:8:8:8 little endian */
>  #define DRM_FORMAT_VUY888	fourcc_code('V', 'U', '2', '4') /* [23:0] Cr:Cb:Y 8:8:8 little endian */
>  #define DRM_FORMAT_VUY101010	fourcc_code('V', 'U', '3', '0') /* Y followed by U then V, 10:10:10. Non-linear modifier only */
> +#define DRM_FORMAT_XVUY2101010	fourcc_code('X', 'Y', '3', '0') /* [31:0] x:Cr:Cb:Y 2:10:10:10 little endian */
>  
>  /*
>   * packed Y2xx indicate for each component, xx valid data occupy msb
> 
> -- 
> 2.43.0
> 

-- 
With best wishes
Dmitry
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Tomi Valkeinen 10 months ago
Hi,

On 17/02/2025 22:15, Dmitry Baryshkov wrote:
> On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
>> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
>> container.
> 
> Is there a more common name for this format? Otherwise googling for it
> reveals only your series.

In the cover letter I mention the gstreamer names where available (this 
particular format is not in gstreamer). AMD has these in their zynqmp 
documentation 
(https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).

XVUY2101010 is YUV444_10BPC in AMD docs.

X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.

I'm not sure you'll have much more luck googling with those names, 
though =).

  Tomi
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Dmitry Baryshkov 10 months ago
On Mon, Feb 17, 2025 at 10:27:56PM +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 17/02/2025 22:15, Dmitry Baryshkov wrote:
> > On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
> > > Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
> > > container.
> > 
> > Is there a more common name for this format? Otherwise googling for it
> > reveals only your series.
> 
> In the cover letter I mention the gstreamer names where available (this
> particular format is not in gstreamer). AMD has these in their zynqmp
> documentation (https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).
> 
> XVUY2101010 is YUV444_10BPC in AMD docs.
> 
> X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.
> 
> I'm not sure you'll have much more luck googling with those names, though
> =).

I'm asking, because include/uapi/drm/drm_fourcc.h has a pretty explicit
waiver: GL, Vulkan or other open standards. Otherwise normal
requirements apply and it's required to have an open-source usespace
implementation, etc.

-- 
With best wishes
Dmitry
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Tomi Valkeinen 9 months, 4 weeks ago
Hi,

On 18/02/2025 05:26, Dmitry Baryshkov wrote:
> On Mon, Feb 17, 2025 at 10:27:56PM +0200, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 17/02/2025 22:15, Dmitry Baryshkov wrote:
>>> On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
>>>> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
>>>> container.
>>>
>>> Is there a more common name for this format? Otherwise googling for it
>>> reveals only your series.
>>
>> In the cover letter I mention the gstreamer names where available (this
>> particular format is not in gstreamer). AMD has these in their zynqmp
>> documentation (https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).
>>
>> XVUY2101010 is YUV444_10BPC in AMD docs.
>>
>> X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.
>>
>> I'm not sure you'll have much more luck googling with those names, though
>> =).
> 
> I'm asking, because include/uapi/drm/drm_fourcc.h has a pretty explicit
> waiver: GL, Vulkan or other open standards. Otherwise normal
> requirements apply and it's required to have an open-source usespace
> implementation, etc.

I can drop DRM_FORMAT_XVUY2101010 until we get it to gstreamer. I just 
had it ready, so I thought it's better to include it than leave out.

Is the current gstreamer support enough for the other formats to fulfill 
the userspace requirement?

  Tomi
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Laurent Pinchart 9 months, 4 weeks ago
On Wed, Feb 19, 2025 at 04:47:26PM +0200, Tomi Valkeinen wrote:
> Hi,
> 
> On 18/02/2025 05:26, Dmitry Baryshkov wrote:
> > On Mon, Feb 17, 2025 at 10:27:56PM +0200, Tomi Valkeinen wrote:
> >> Hi,
> >>
> >> On 17/02/2025 22:15, Dmitry Baryshkov wrote:
> >>> On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
> >>>> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
> >>>> container.
> >>>
> >>> Is there a more common name for this format? Otherwise googling for it
> >>> reveals only your series.
> >>
> >> In the cover letter I mention the gstreamer names where available (this
> >> particular format is not in gstreamer). AMD has these in their zynqmp
> >> documentation (https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).
> >>
> >> XVUY2101010 is YUV444_10BPC in AMD docs.
> >>
> >> X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.
> >>
> >> I'm not sure you'll have much more luck googling with those names, though
> >> =).
> > 
> > I'm asking, because include/uapi/drm/drm_fourcc.h has a pretty explicit
> > waiver: GL, Vulkan or other open standards. Otherwise normal
> > requirements apply and it's required to have an open-source usespace
> > implementation, etc.
> 
> I can drop DRM_FORMAT_XVUY2101010 until we get it to gstreamer. I just 
> had it ready, so I thought it's better to include it than leave out.
> 
> Is the current gstreamer support enough for the other formats to fulfill 
> the userspace requirement?

We've received a green light in the past to add formats to drm_fourcc.h
that would be used by cameras only. There's no open formal standard there, but
we have libcamera as a de-facto standard. I would assume GStreamer to be
enough for a scanout format.

-- 
Regards,

Laurent Pinchart
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Dmitry Baryshkov 9 months, 4 weeks ago
On Wed, Feb 19, 2025 at 05:08:40PM +0200, Laurent Pinchart wrote:
> On Wed, Feb 19, 2025 at 04:47:26PM +0200, Tomi Valkeinen wrote:
> > Hi,
> > 
> > On 18/02/2025 05:26, Dmitry Baryshkov wrote:
> > > On Mon, Feb 17, 2025 at 10:27:56PM +0200, Tomi Valkeinen wrote:
> > >> Hi,
> > >>
> > >> On 17/02/2025 22:15, Dmitry Baryshkov wrote:
> > >>> On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
> > >>>> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
> > >>>> container.
> > >>>
> > >>> Is there a more common name for this format? Otherwise googling for it
> > >>> reveals only your series.
> > >>
> > >> In the cover letter I mention the gstreamer names where available (this
> > >> particular format is not in gstreamer). AMD has these in their zynqmp
> > >> documentation (https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).
> > >>
> > >> XVUY2101010 is YUV444_10BPC in AMD docs.
> > >>
> > >> X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.
> > >>
> > >> I'm not sure you'll have much more luck googling with those names, though
> > >> =).
> > > 
> > > I'm asking, because include/uapi/drm/drm_fourcc.h has a pretty explicit
> > > waiver: GL, Vulkan or other open standards. Otherwise normal
> > > requirements apply and it's required to have an open-source usespace
> > > implementation, etc.
> > 
> > I can drop DRM_FORMAT_XVUY2101010 until we get it to gstreamer. I just 
> > had it ready, so I thought it's better to include it than leave out.
> > 
> > Is the current gstreamer support enough for the other formats to fulfill 
> > the userspace requirement?
> 
> We've received a green light in the past to add formats to drm_fourcc.h
> that would be used by cameras only. There's no open formal standard there, but
> we have libcamera as a de-facto standard. I would assume GStreamer to be
> enough for a scanout format.

Thanks for the clarification!

-- 
With best wishes
Dmitry
Re: [PATCH v3 06/11] drm/fourcc: Add DRM_FORMAT_XVUY2101010
Posted by Laurent Pinchart 9 months, 4 weeks ago
On Wed, Feb 19, 2025 at 07:28:44PM +0200, Dmitry Baryshkov wrote:
> On Wed, Feb 19, 2025 at 05:08:40PM +0200, Laurent Pinchart wrote:
> > On Wed, Feb 19, 2025 at 04:47:26PM +0200, Tomi Valkeinen wrote:
> > > Hi,
> > > 
> > > On 18/02/2025 05:26, Dmitry Baryshkov wrote:
> > > > On Mon, Feb 17, 2025 at 10:27:56PM +0200, Tomi Valkeinen wrote:
> > > >> Hi,
> > > >>
> > > >> On 17/02/2025 22:15, Dmitry Baryshkov wrote:
> > > >>> On Wed, Feb 12, 2025 at 04:56:10PM +0200, Tomi Valkeinen wrote:
> > > >>>> Add XVUY2101010, a 10 bits per component YCbCr format in a 32 bit
> > > >>>> container.
> > > >>>
> > > >>> Is there a more common name for this format? Otherwise googling for it
> > > >>> reveals only your series.
> > > >>
> > > >> In the cover letter I mention the gstreamer names where available (this
> > > >> particular format is not in gstreamer). AMD has these in their zynqmp
> > > >> documentation (https://docs.amd.com/r/en-US/ug1085-zynq-ultrascale-trm/Video-Packer-Format).
> > > >>
> > > >> XVUY2101010 is YUV444_10BPC in AMD docs.
> > > >>
> > > >> X403 is Y444_10LE32 in gstreamer, and YV24_10BPC in AMD docs.
> > > >>
> > > >> I'm not sure you'll have much more luck googling with those names, though
> > > >> =).
> > > > 
> > > > I'm asking, because include/uapi/drm/drm_fourcc.h has a pretty explicit
> > > > waiver: GL, Vulkan or other open standards. Otherwise normal
> > > > requirements apply and it's required to have an open-source usespace
> > > > implementation, etc.
> > > 
> > > I can drop DRM_FORMAT_XVUY2101010 until we get it to gstreamer. I just 
> > > had it ready, so I thought it's better to include it than leave out.
> > > 
> > > Is the current gstreamer support enough for the other formats to fulfill 
> > > the userspace requirement?
> > 
> > We've received a green light in the past to add formats to drm_fourcc.h
> > that would be used by cameras only. There's no open formal standard there, but
> > we have libcamera as a de-facto standard. I would assume GStreamer to be
> > enough for a scanout format.
> 
> Thanks for the clarification!

To make it extra clear, this format is not currently (as in the mainline
kernel, with Tomi's work) used for cameras, but only for display
scanout. My comment related to cameras was meant to indicate I expect
drm_fourcc.h to not strictly require all formats to match open formal
standards.

-- 
Regards,

Laurent Pinchart