diff mbox

uvcvideo: Add bayer 16-bit format patterns

Message ID 8760np5mjm.fsf@edgarthier.net (mailing list archive)
State New, archived
Headers show

Commit Message

Edgar Thier Nov. 15, 2016, 5:39 a.m. UTC
From 10ce06db4ab3c037758b3cb5264007f59801f1a1 Mon Sep 17 00:00:00 2001
From: Edgar Thier <info@edgarthier.net>
Date: Tue, 15 Nov 2016 06:33:10 +0100
Subject: [PATCH] uvcvideo: Add bayer 16-bit format patterns

Signed-off-by: Edgar Thier <info@edgarthier.net>
---
drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
2 files changed, 32 insertions(+)

--
2.10.2
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Sakari Ailus Nov. 15, 2016, 1:45 p.m. UTC | #1
Hi Edgar,

On Tue, Nov 15, 2016 at 06:39:41AM +0100, Edgar Thier wrote:
> 
> From 10ce06db4ab3c037758b3cb5264007f59801f1a1 Mon Sep 17 00:00:00 2001
> From: Edgar Thier <info@edgarthier.net>
> Date: Tue, 15 Nov 2016 06:33:10 +0100
> Subject: [PATCH] uvcvideo: Add bayer 16-bit format patterns
> 
> Signed-off-by: Edgar Thier <info@edgarthier.net>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

> ---
> drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
> drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
> 2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 87b2fc3b..9d1fc33 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -168,6 +168,26 @@ static struct uvc_format_desc uvc_fmts[] = {
> .guid		= UVC_GUID_FORMAT_RW10,
> .fcc		= V4L2_PIX_FMT_SRGGB10P,
> },
> +	{
> +			.name		= "Bayer 16-bit (SBGGR16)",

Laurent, are these still needed? The V4L2 framework fills in the format
name... certainly out of scope for this patch though.

> +			.guid		= UVC_GUID_FORMAT_BG16,
> +			.fcc		= V4L2_PIX_FMT_SBGGR16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SGBRG16)",
> +			.guid		= UVC_GUID_FORMAT_GB16,
> +			.fcc		= V4L2_PIX_FMT_SGBRG16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SRGGB16)",
> +			.guid		= UVC_GUID_FORMAT_RG16,
> +			.fcc		= V4L2_PIX_FMT_SRGGB16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SGRBG16)",
> +			.guid		= UVC_GUID_FORMAT_GR16,
> +			.fcc		= V4L2_PIX_FMT_SGRBG16,
> +	},
> };
>
Laurent Pinchart Nov. 15, 2016, 2:44 p.m. UTC | #2
Hi Edgar,

Thank you for the patch.

On Tuesday 15 Nov 2016 06:39:41 Edgar Thier wrote:
> From 10ce06db4ab3c037758b3cb5264007f59801f1a1 Mon Sep 17 00:00:00 2001
> From: Edgar Thier <info@edgarthier.net>
> Date: Tue, 15 Nov 2016 06:33:10 +0100
> Subject: [PATCH] uvcvideo: Add bayer 16-bit format patterns

Which device(s) support these formats ?

> Signed-off-by: Edgar Thier <info@edgarthier.net>
> ---
> drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
> drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
> 2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c
> b/drivers/media/usb/uvc/uvc_driver.c index 87b2fc3b..9d1fc33 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -168,6 +168,26 @@ static struct uvc_format_desc uvc_fmts[] = {
> .guid		= UVC_GUID_FORMAT_RW10,
> .fcc		= V4L2_PIX_FMT_SRGGB10P,
> },
> +	{
> +			.name		= "Bayer 16-bit (SBGGR16)",
> +			.guid		= UVC_GUID_FORMAT_BG16,
> +			.fcc		= V4L2_PIX_FMT_SBGGR16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SGBRG16)",
> +			.guid		= UVC_GUID_FORMAT_GB16,
> +			.fcc		= V4L2_PIX_FMT_SGBRG16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SRGGB16)",
> +			.guid		= UVC_GUID_FORMAT_RG16,
> +			.fcc		= V4L2_PIX_FMT_SRGGB16,
> +	},
> +	{
> +			.name		= "Bayer 16-bit (SGRBG16)",
> +			.guid		= UVC_GUID_FORMAT_GR16,
> +			.fcc		= V4L2_PIX_FMT_SGRBG16,
> +	},
> };
> 
> /* ------------------------------------------------------------------------
> diff --git a/drivers/media/usb/uvc/uvcvideo.h
> b/drivers/media/usb/uvc/uvcvideo.h index 7e4d3ee..3d6cc62 100644
> --- a/drivers/media/usb/uvc/uvcvideo.h
> +++ b/drivers/media/usb/uvc/uvcvideo.h
> @@ -106,6 +106,18 @@
> #define UVC_GUID_FORMAT_RGGB \
> { 'R',  'G',  'G',  'B', 0x00, 0x00, 0x10, 0x00, \
> 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> +#define UVC_GUID_FORMAT_BG16 \
> +	{ 'B',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> +#define UVC_GUID_FORMAT_GB16 \
> +	{ 'G',  'B',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> +#define UVC_GUID_FORMAT_RG16 \
> +	{ 'R',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> +#define UVC_GUID_FORMAT_GR16 \
> +	{ 'G',  'R',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> #define UVC_GUID_FORMAT_RGBP \
> { 'R',  'G',  'B',  'P', 0x00, 0x00, 0x10, 0x00, \
> 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
Laurent Pinchart Nov. 15, 2016, 2:45 p.m. UTC | #3
Hi Sakari,

On Tuesday 15 Nov 2016 15:45:32 Sakari Ailus wrote:
> On Tue, Nov 15, 2016 at 06:39:41AM +0100, Edgar Thier wrote:
> > From 10ce06db4ab3c037758b3cb5264007f59801f1a1 Mon Sep 17 00:00:00 2001
> > From: Edgar Thier <info@edgarthier.net>
> > Date: Tue, 15 Nov 2016 06:33:10 +0100
> > Subject: [PATCH] uvcvideo: Add bayer 16-bit format patterns
> > 
> > Signed-off-by: Edgar Thier <info@edgarthier.net>
> 
> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> 
> > ---
> > drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
> > drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
> > 2 files changed, 32 insertions(+)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c index 87b2fc3b..9d1fc33 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -168,6 +168,26 @@ static struct uvc_format_desc uvc_fmts[] = {
> > .guid		= UVC_GUID_FORMAT_RW10,
> > .fcc		= V4L2_PIX_FMT_SRGGB10P,
> > },
> > +	{
> > +			.name		= "Bayer 16-bit (SBGGR16)",
> 
> Laurent, are these still needed? The V4L2 framework fills in the format
> name... certainly out of scope for this patch though.

I'll fix that.

> > +			.guid		= UVC_GUID_FORMAT_BG16,
> > +			.fcc		= V4L2_PIX_FMT_SBGGR16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SGBRG16)",
> > +			.guid		= UVC_GUID_FORMAT_GB16,
> > +			.fcc		= V4L2_PIX_FMT_SGBRG16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SRGGB16)",
> > +			.guid		= UVC_GUID_FORMAT_RG16,
> > +			.fcc		= V4L2_PIX_FMT_SRGGB16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SGRBG16)",
> > +			.guid		= UVC_GUID_FORMAT_GR16,
> > +			.fcc		= V4L2_PIX_FMT_SGRBG16,
> > +	},
> > };
Laurent Pinchart Nov. 15, 2016, 2:50 p.m. UTC | #4
Hi Edgar,

On Tuesday 15 Nov 2016 16:44:55 Laurent Pinchart wrote:
> On Tuesday 15 Nov 2016 06:39:41 Edgar Thier wrote:
> > From 10ce06db4ab3c037758b3cb5264007f59801f1a1 Mon Sep 17 00:00:00 2001
> > From: Edgar Thier <info@edgarthier.net>
> > Date: Tue, 15 Nov 2016 06:33:10 +0100
> > Subject: [PATCH] uvcvideo: Add bayer 16-bit format patterns
> 
> Which device(s) support these formats ?

And could you please try to fix your e-mail client and/or server to avoid 
corrupting patches ?

> > Signed-off-by: Edgar Thier <info@edgarthier.net>
> > ---
> > drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
> > drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
> > 2 files changed, 32 insertions(+)
> > 
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c index 87b2fc3b..9d1fc33 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -168,6 +168,26 @@ static struct uvc_format_desc uvc_fmts[] = {
> > .guid		= UVC_GUID_FORMAT_RW10,
> > .fcc		= V4L2_PIX_FMT_SRGGB10P,
> > },
> > +	{
> > +			.name		= "Bayer 16-bit (SBGGR16)",
> > +			.guid		= UVC_GUID_FORMAT_BG16,
> > +			.fcc		= V4L2_PIX_FMT_SBGGR16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SGBRG16)",
> > +			.guid		= UVC_GUID_FORMAT_GB16,
> > +			.fcc		= V4L2_PIX_FMT_SGBRG16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SRGGB16)",
> > +			.guid		= UVC_GUID_FORMAT_RG16,
> > +			.fcc		= V4L2_PIX_FMT_SRGGB16,
> > +	},
> > +	{
> > +			.name		= "Bayer 16-bit (SGRBG16)",
> > +			.guid		= UVC_GUID_FORMAT_GR16,
> > +			.fcc		= V4L2_PIX_FMT_SGRBG16,
> > +	},
> > };
> > 
> > /*
> > ------------------------------------------------------------------------
> > diff --git a/drivers/media/usb/uvc/uvcvideo.h
> > b/drivers/media/usb/uvc/uvcvideo.h index 7e4d3ee..3d6cc62 100644
> > --- a/drivers/media/usb/uvc/uvcvideo.h
> > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > @@ -106,6 +106,18 @@
> > #define UVC_GUID_FORMAT_RGGB \
> > { 'R',  'G',  'G',  'B', 0x00, 0x00, 0x10, 0x00, \
> > 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_BG16 \
> > +	{ 'B',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> > +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_GB16 \
> > +	{ 'G',  'B',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> > +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_RG16 \
> > +	{ 'R',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> > +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > +#define UVC_GUID_FORMAT_GR16 \
> > +	{ 'G',  'R',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
> > +	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> > #define UVC_GUID_FORMAT_RGBP \
> > { 'R',  'G',  'B',  'P', 0x00, 0x00, 0x10, 0x00, \
> > 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
diff mbox

Patch

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 87b2fc3b..9d1fc33 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -168,6 +168,26 @@  static struct uvc_format_desc uvc_fmts[] = {
.guid		= UVC_GUID_FORMAT_RW10,
.fcc		= V4L2_PIX_FMT_SRGGB10P,
},
+	{
+			.name		= "Bayer 16-bit (SBGGR16)",
+			.guid		= UVC_GUID_FORMAT_BG16,
+			.fcc		= V4L2_PIX_FMT_SBGGR16,
+	},
+	{
+			.name		= "Bayer 16-bit (SGBRG16)",
+			.guid		= UVC_GUID_FORMAT_GB16,
+			.fcc		= V4L2_PIX_FMT_SGBRG16,
+	},
+	{
+			.name		= "Bayer 16-bit (SRGGB16)",
+			.guid		= UVC_GUID_FORMAT_RG16,
+			.fcc		= V4L2_PIX_FMT_SRGGB16,
+	},
+	{
+			.name		= "Bayer 16-bit (SGRBG16)",
+			.guid		= UVC_GUID_FORMAT_GR16,
+			.fcc		= V4L2_PIX_FMT_SGRBG16,
+	},
};

/* ------------------------------------------------------------------------
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 7e4d3ee..3d6cc62 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -106,6 +106,18 @@ 
#define UVC_GUID_FORMAT_RGGB \
{ 'R',  'G',  'G',  'B', 0x00, 0x00, 0x10, 0x00, \
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_BG16 \
+	{ 'B',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_GB16 \
+	{ 'G',  'B',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_RG16 \
+	{ 'R',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_GR16 \
+	{ 'G',  'R',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
#define UVC_GUID_FORMAT_RGBP \
{ 'R',  'G',  'B',  'P', 0x00, 0x00, 0x10, 0x00, \
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}