linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Edgar Thier <info@edgarthier.net>
To: laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi
Cc: Edgar Thier <info@edgarthier.net>,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: [PATCH 2/2] uvc: Add 12-bit raw bayer linear packed formats
Date: Fri,  5 Jul 2019 13:10:26 +0200	[thread overview]
Message-ID: <20190705111026.29758-1-info@edgarthier.net> (raw)
In-Reply-To: <20190705110723.29685-1-info@edgarthier.net>

These formats are compressed 12-bit raw bayer formats with four different
pixel orders. The pixel follow one another without any padding,
thus are packed in a 'linear' fashion.

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

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 10cfe8e51626..d12298d18406 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -179,6 +179,26 @@ static struct uvc_format_desc uvc_fmts[] = {
 		.guid		= UVC_GUID_FORMAT_RW10,
 		.fcc		= V4L2_PIX_FMT_SRGGB10P,
 	},
+	{
+		.name		= "Bayer 12-bit linear packed (SBGGR12LP)",
+		.guid		= UVC_GUID_FORMAT_BGCP,
+		.fcc		= V4L2_PIX_FMT_SBGGR12LP,
+	},
+	{
+		.name		= "Bayer 12-bit linear packed (SGBRG12LP)",
+		.guid		= UVC_GUID_FORMAT_GBCP,
+		.fcc		= V4L2_PIX_FMT_SGBRG12LP,
+	},
+	{
+		.name		= "Bayer 12-bit linear packed (SRGGB12LP)",
+		.guid		= UVC_GUID_FORMAT_RGCP,
+		.fcc		= V4L2_PIX_FMT_SRGGB12LP,
+	},
+	{
+		.name		= "Bayer 12-bit linear packed (SGRBG12LP)",
+		.guid		= UVC_GUID_FORMAT_GRCP,
+		.fcc		= V4L2_PIX_FMT_SGRBG12LP,
+	},
 	{
 		.name		= "Bayer 16-bit (SBGGR16)",
 		.guid		= UVC_GUID_FORMAT_BG16,
@@ -2924,4 +2944,3 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRIVER_VERSION);
-
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index c7c1baa90dea..f5be00fb9a73 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -108,6 +108,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_BGCP \
+	{ 'B',  'G',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_GBCP \
+	{ 'G',  'B',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_RGCP \
+	{ 'R',  'G',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_GRCP \
+	{ 'G',  'R',  'C',  'p', 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}
-- 
2.20.1


  reply	other threads:[~2019-07-05 11:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-05 11:07 [PATCH 1/2] v4l: Add 12-bit raw bayer linear packed formats Edgar Thier
2019-07-05 11:10 ` Edgar Thier [this message]
2019-07-05 12:01 ` Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190705111026.29758-1-info@edgarthier.net \
    --to=info@edgarthier.net \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).