Skip to contentSkip to conversation

media: uvcvideo: Add GUID for BGRA/X 8:8:8:8

PATCH In review Marek Vasut 4 participants 7 messages Jan 16, 2023 – Jan 22, 2023 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 media: uvcvideo: Add GUID for BGRA/X 8:8:8:8

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +8 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
 	{ 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
 	 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+	{ 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+	 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
 	{ 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
 		.guid		= UVC_GUID_FORMAT_BGR3,
 		.fcc		= V4L2_PIX_FMT_BGR24,
 	},
+	{
+		.name		= "BGRA/X 8:8:8:8 (BGR4)",
+		.guid		= UVC_GUID_FORMAT_BGR4,
+		.fcc		= V4L2_PIX_FMT_XBGR32,
+	},
 	{
 		.name		= "H.264",
 		.guid		= UVC_GUID_FORMAT_H264,
Signature · 1 line
2.39.0
Reviewed-by on v2 1/1
#1 lore raw

Hi Marek,

Thank you for the patch.

Quoted 17 lines · Marek Vasut

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

Quoted 6 lines

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Quoted 38 lines

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +8 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
 	{ 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
 	 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+	{ 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+	 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
 	{ 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
 		.guid		= UVC_GUID_FORMAT_BGR3,
 		.fcc		= V4L2_PIX_FMT_BGR24,
 	},
+	{
+		.name		= "BGRA/X 8:8:8:8 (BGR4)",
+		.guid		= UVC_GUID_FORMAT_BGR4,
+		.fcc		= V4L2_PIX_FMT_XBGR32,
+	},
 	{
 		.name		= "H.264",
 		.guid		= UVC_GUID_FORMAT_H264,
Signature · 3 lines
Regards,

Laurent Pinchart
Reviewed-by
#2 lore raw

Hi Marek!!!

Why do they call MEDIASUBTYPE_RGB32 something that is BRG ? !

Why do WE call XBGR something that is BGRX? !!

Besides our insanity, your patch looks sane. Thanks for it :)

There are some patches on the queue to remove the format definitions, so your patch might not apply cleanly, I guess Laurent will take care of it

Thanks

Quoted 23 lines · Laurent Pinchart

Hi Marek,

Thank you for the patch.

Quoted 17 lines · Marek Vasut

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

Quoted 8 lines
Quoted 6 lines

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Quoted 44 lines
Quoted 29 lines

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +3 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
      { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
       0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+     { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+      0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
      { 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
       0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
              .guid           = UVC_GUID_FORMAT_BGR3,

include/media/v4l2-uvc.h static struct uvc_format_desc uvc_fmts[] = { · line 279

Quoted 10 lines
include/media/v4l2-uvc.h +5 -0
              .fcc            = V4L2_PIX_FMT_BGR24,
      },
+     {
+             .name           = "BGRA/X 8:8:8:8 (BGR4)",
+             .guid           = UVC_GUID_FORMAT_BGR4,
+             .fcc            = V4L2_PIX_FMT_XBGR32,
+     },
      {
              .name           = "H.264",
              .guid           = UVC_GUID_FORMAT_H264,

--
Regards,

Laurent Pinchart

Signature · 1 line
Ricardo Ribalda
#3 lore raw

Hello,

(CC'ing Michael)

Quoted 11 lines · Ricardo Ribalda

Hi Marek!!!

Why do they call MEDIASUBTYPE_RGB32 something that is BRG ? !

Why do WE call XBGR something that is BGRX? !!

Besides our insanity, your patch looks sane. Thanks for it :)

There are some patches on the queue to remove the format definitions, so your patch might not apply cleanly, I guess Laurent will take care of it

Ricardo meant [5].

Michael, I'm waiting for Mauro to merge the uvcvideo pull request for v6.3 ([6]). Once done, you can use that as a base branch for your series, and send a pull request to Greg. Could you include Marek's patch, either at the bottom or the top of your series ? Alternatively I can send a v4 of the uvcvideo pull request with this patch included if you prefer.

[5] https://lore.kernel.org/linux-media/[email protected]/
[6] https://lore.kernel.org/linux-media/Y8R0yfSL+1BNi%[email protected]/

Quoted 68 lines · Laurent Pinchart
Quoted 18 lines · Marek Vasut
Quoted 17 lines

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

Quoted 8 lines
Quoted 6 lines

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Quoted 38 lines
Quoted 38 lines

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +8 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
      { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
       0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+     { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+      0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
      { 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
       0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
              .guid           = UVC_GUID_FORMAT_BGR3,
              .fcc            = V4L2_PIX_FMT_BGR24,
      },
+     {
+             .name           = "BGRA/X 8:8:8:8 (BGR4)",
+             .guid           = UVC_GUID_FORMAT_BGR4,
+             .fcc            = V4L2_PIX_FMT_XBGR32,
+     },
      {
              .name           = "H.264",
              .guid           = UVC_GUID_FORMAT_H264,
Signature · 3 lines
Regards,

Laurent Pinchart
#4 lore raw

Hi!

Quoted 22 lines · Laurent Pinchart
Quoted 11 lines · Ricardo Ribalda

Hi Marek!!!

Why do they call MEDIASUBTYPE_RGB32 something that is BRG ? !

Why do WE call XBGR something that is BGRX? !!

Besides our insanity, your patch looks sane. Thanks for it :)

There are some patches on the queue to remove the format definitions, so your patch might not apply cleanly, I guess Laurent will take care of it

Ricardo meant [5].

Michael, I'm waiting for Mauro to merge the uvcvideo pull request for v6.3 ([6]). Once done, you can use that as a base branch for your series, and send a pull request to Greg. Could you include Marek's patch, either at the bottom or the top of your series ? Alternatively I can send a v4 of the uvcvideo pull request with this patch included if you prefer.

Quoted 2 lines

[5] https://lore.kernel.org/linux-media/[email protected]/
[6] https://lore.kernel.org/linux-media/Y8R0yfSL+1BNi%[email protected]/

I sure will pick up this patch and create a pull request for my series.

Thanks.

Quoted 74 lines
Quoted 68 lines · Laurent Pinchart
Quoted 18 lines · Marek Vasut
Quoted 17 lines

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

Quoted 8 lines
Quoted 6 lines

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Quoted 38 lines
Quoted 38 lines

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +8 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
      { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
       0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+     { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+      0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
      { 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
       0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
              .guid           = UVC_GUID_FORMAT_BGR3,
              .fcc            = V4L2_PIX_FMT_BGR24,
      },
+     {
+             .name           = "BGRA/X 8:8:8:8 (BGR4)",
+             .guid           = UVC_GUID_FORMAT_BGR4,
+             .fcc            = V4L2_PIX_FMT_XBGR32,
+     },
      {
              .name           = "H.264",
              .guid           = UVC_GUID_FORMAT_H264,
Signature · 3 lines
Regards,

Laurent Pinchart
Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#5 lore raw

Hi Michael,

Quoted 23 lines · Michael Grzeschik
Quoted 22 lines · Laurent Pinchart
Quoted 11 lines · Ricardo Ribalda

Hi Marek!!!

Why do they call MEDIASUBTYPE_RGB32 something that is BRG ? !

Why do WE call XBGR something that is BGRX? !!

Besides our insanity, your patch looks sane. Thanks for it :)

There are some patches on the queue to remove the format definitions, so your patch might not apply cleanly, I guess Laurent will take care of it

Ricardo meant [5].

Michael, I'm waiting for Mauro to merge the uvcvideo pull request for v6.3 ([6]). Once done, you can use that as a base branch for your series, and send a pull request to Greg. Could you include Marek's patch, either at the bottom or the top of your series ? Alternatively I can send a v4 of the uvcvideo pull request with this patch included if you prefer.

Quoted 4 lines
Quoted 2 lines

[5] https://lore.kernel.org/linux-media/[email protected]/
[6] https://lore.kernel.org/linux-media/Y8R0yfSL+1BNi%[email protected]/

I sure will pick up this patch and create a pull request for my series.

Mauro has merged the media-uvc-next-20230115 tag from
git://git.kernel.org/pub/scm/linux/kernel/git/pinchartl/linux.git, you can now use it as a base.

Quoted 68 lines
Quoted 68 lines
Quoted 68 lines · Laurent Pinchart
Quoted 18 lines · Marek Vasut
Quoted 17 lines

The Cypress EZUSB FX3 UVC example can be configured to report pixel format "e436eb7e-524f-11ce-9f53-0020af0ba770". This is its GUID for BGRA/X 8:8:8:8.

The UVC 1.5 spec [1] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[2]. This Media Format SDK defines this GUID as corresponding to MEDIASUBTYPE_RGB32, which is confirmed by [4] as MEDIASUBTYPE_ARGB32 has different GUID.

Note that in my case, the FX3 UVC can output either channel order, BGR or RGB or any other mix for that matter. Since Linux commit 1b8dc32286a1a ("[media] uvcvideo: Add GUID for BGR 8:8:8") defined a GUID for MEDIASUBTYPE_RGB24 channel order as BGR, keep this change consistent and define MEDIASUBTYPE_RGB32 as BGR as well. Document [3] also indicates the channel order is BGR.

Quoted 8 lines
Quoted 6 lines

[1] https://www.usb.org/document-library/video-class-v15-document-set
[2] https://learn.microsoft.com/en-us/windows/win32/wmformat/media-type-identifiers
[3] https://learn.microsoft.com/en-us/windows/win32/directshow/uncompressed-rgb-video-subtypes
[4] https://gix.github.io/media-types/

Quoted 38 lines
Quoted 38 lines

---
Cc: Laurent Pinchart <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: William Manley <[email protected]>
---
V2: - Reference document [3] confirming BGR channel order
- Reference document [4] describing MEDIASUBTYPE_ARGB32 with different GUID
- Use V4L2_PIX_FMT_XBGR32 instead of V4L2_PIX_FMT_BGR32 which is deprecated

---
 include/media/v4l2-uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/media/v4l2-uvc.h +8 -0
index f83e31661333b..b010a36fc1d95 100644
@@ -99,6 +99,9 @@
 #define UVC_GUID_FORMAT_BGR3 \
      { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
       0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
+#define UVC_GUID_FORMAT_BGR4 \
+     { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \
+      0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}
 #define UVC_GUID_FORMAT_M420 \
      { 'M',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
       0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
@@ -266,6 +269,11 @@ static struct uvc_format_desc uvc_fmts[] = {
              .guid           = UVC_GUID_FORMAT_BGR3,
              .fcc            = V4L2_PIX_FMT_BGR24,
      },
+     {
+             .name           = "BGRA/X 8:8:8:8 (BGR4)",
+             .guid           = UVC_GUID_FORMAT_BGR4,
+             .fcc            = V4L2_PIX_FMT_XBGR32,
+     },
      {
              .name           = "H.264",
              .guid           = UVC_GUID_FORMAT_H264,
Signature · 3 lines
Regards,

Laurent Pinchart
#6 lore raw
In reply to Ricardo Ribalda
Quoted 1 line · Ricardo Ribalda

Hi Marek!!!

Hello Ricardo,

Quoted 1 line

Why do they call MEDIASUBTYPE_RGB32 something that is BRG ? !

This I do not know.

Quoted 1 line

Why do WE call XBGR something that is BGRX? !!

This is ... sigh.

Quoted 1 line

Besides our insanity, your patch looks sane. Thanks for it :)

You're welcome.

Quoted 3 lines

There are some patches on the queue to remove the format definitions, so your patch might not apply cleanly, I guess Laurent will take care of it

I have it in my upstream queue, so I'll rebase it and send V3 if there is any conflict in one of the next linux-next trees.

Cheers