You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
265 lines
10 KiB
265 lines
10 KiB
From 5a856a80549a98f0a890530f0cda0461783c3aec Mon Sep 17 00:00:00 2001
|
|
From: Dmitry Perchanov <dmitry.perchanov@intel.com>
|
|
Date: Sun, 21 Aug 2022 15:45:33 +0300
|
|
Subject: [PATCH] RS4xx, ZR300, RS5 Pixel formats for kernel 4.4 Also include
|
|
development formats, Y16I
|
|
|
|
Signed-off-by: Dmitry Perchanov <dmitry.perchanov@intel.com>
|
|
---
|
|
drivers/media/usb/uvc/Makefile | 1 +
|
|
drivers/media/usb/uvc/uvc_driver.c | 96 ++++++++++++++++++++++++++++
|
|
drivers/media/usb/uvc/uvcvideo.h | 57 +++++++++++++++++
|
|
drivers/media/v4l2-core/v4l2-ioctl.c | 12 ++++
|
|
include/uapi/linux/videodev2.h | 14 ++++
|
|
5 files changed, 180 insertions(+)
|
|
|
|
diff --git a/drivers/media/usb/uvc/Makefile b/drivers/media/usb/uvc/Makefile
|
|
index c26d12fdb8f4..d86cf22155d1 100644
|
|
--- a/drivers/media/usb/uvc/Makefile
|
|
+++ b/drivers/media/usb/uvc/Makefile
|
|
@@ -1,3 +1,4 @@
|
|
+CONFIG_MODULE_SIG=n
|
|
uvcvideo-objs := uvc_driver.o uvc_queue.o uvc_v4l2.o uvc_video.o uvc_ctrl.o \
|
|
uvc_status.o uvc_isight.o uvc_debugfs.o
|
|
ifeq ($(CONFIG_MEDIA_CONTROLLER),y)
|
|
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
|
|
index 8805f555e4c8..e618e65f5ea2 100644
|
|
--- a/drivers/media/usb/uvc/uvc_driver.c
|
|
+++ b/drivers/media/usb/uvc/uvc_driver.c
|
|
@@ -158,6 +158,11 @@ static struct uvc_format_desc uvc_fmts[] = {
|
|
.guid = UVC_GUID_FORMAT_Y12I,
|
|
.fcc = V4L2_PIX_FMT_Y12I,
|
|
},
|
|
+ {
|
|
+ .name = "Greyscale 16 L/R (Y16I)",
|
|
+ .guid = UVC_GUID_FORMAT_Y16I,
|
|
+ .fcc = V4L2_PIX_FMT_Y16I,
|
|
+ },
|
|
{
|
|
.name = "Depth data 16-bit (Z16)",
|
|
.guid = UVC_GUID_FORMAT_Z16,
|
|
@@ -168,6 +173,97 @@ static struct uvc_format_desc uvc_fmts[] = {
|
|
.guid = UVC_GUID_FORMAT_RW10,
|
|
.fcc = V4L2_PIX_FMT_SRGGB10P,
|
|
},
|
|
+ {
|
|
+ .name = "Raw data 8-bit (RAW8)",
|
|
+ .guid = UVC_GUID_FORMAT_RAW8,
|
|
+ .fcc = V4L2_PIX_FMT_GREY,
|
|
+ },
|
|
+ {
|
|
+ .name = "Raw data 16-bit (RW16)",
|
|
+ .guid = UVC_GUID_FORMAT_RW16,
|
|
+ .fcc = V4L2_PIX_FMT_RW16,
|
|
+ },
|
|
+ {
|
|
+ .name = "Depth 16-bit (INVZ)",
|
|
+ .guid = UVC_GUID_FORMAT_INVZ,
|
|
+ .fcc = V4L2_PIX_FMT_Z16,
|
|
+ },
|
|
+ {
|
|
+ .name = "Depth:IR 16:8 24-bit (INZI)",
|
|
+ .guid = UVC_GUID_FORMAT_INZI,
|
|
+ .fcc = V4L2_PIX_FMT_INZI,
|
|
+ },
|
|
+ {
|
|
+ .name = "Depth 16-bit (INVR)",
|
|
+ .guid = UVC_GUID_FORMAT_INVR,
|
|
+ .fcc = V4L2_PIX_FMT_INVR,
|
|
+ },
|
|
+ {
|
|
+ .name = "Depth:IR 16:8 24-bit (INRI)",
|
|
+ .guid = UVC_GUID_FORMAT_INRI,
|
|
+ .fcc = V4L2_PIX_FMT_INRI,
|
|
+ },
|
|
+ {
|
|
+ .name = "Infrared 8-bit (INVI)",
|
|
+ .guid = UVC_GUID_FORMAT_INVI,
|
|
+ .fcc = V4L2_PIX_FMT_GREY,
|
|
+ },
|
|
+ {
|
|
+ .name = "FlickerIR 8-bit (RELI)",
|
|
+ .guid = UVC_GUID_FORMAT_RELI,
|
|
+ .fcc = V4L2_PIX_FMT_RELI,
|
|
+ },
|
|
+ {
|
|
+ .name = "Luminosity data 8-bit (L8)",
|
|
+ .guid = UVC_GUID_FORMAT_L8,
|
|
+ .fcc = V4L2_PIX_FMT_GREY,
|
|
+ },
|
|
+ {
|
|
+ .name = "Luminosity data 16-bit (L16)",
|
|
+ .guid = UVC_GUID_FORMAT_L16,
|
|
+ .fcc = V4L2_PIX_FMT_Y16,
|
|
+ },
|
|
+ {
|
|
+ .name = "Depth data 16-bit (D16)",
|
|
+ .guid = UVC_GUID_FORMAT_D16,
|
|
+ .fcc = V4L2_PIX_FMT_Z16,
|
|
+ },
|
|
+ {
|
|
+ .name = "16-bit Bayer BGBG/GRGR",
|
|
+ .guid = UVC_GUID_FORMAT_BAYER16,
|
|
+ .fcc = V4L2_PIX_FMT_SBGGR16,
|
|
+ },
|
|
+ {
|
|
+ .name = "Packed raw data 10-bit",
|
|
+ .guid = UVC_GUID_FORMAT_W10,
|
|
+ .fcc = V4L2_PIX_FMT_W10,
|
|
+ },
|
|
+ {
|
|
+ .name = "Confidence data (C )",
|
|
+ .guid = UVC_GUID_FORMAT_CONFIDENCE_MAP,
|
|
+ .fcc = V4L2_PIX_FMT_CONFIDENCE_MAP,
|
|
+ },
|
|
+ /* Legacy/Development formats for backward-compatibility*/
|
|
+ {
|
|
+ .name = "Frame Grabber (FG )",
|
|
+ .guid = UVC_GUID_FORMAT_FG,
|
|
+ .fcc = V4L2_PIX_FMT_FG,
|
|
+ },
|
|
+ {
|
|
+ .name = "SR300 Depth/Confidence (INZC)",
|
|
+ .guid = UVC_GUID_FORMAT_INZC,
|
|
+ .fcc = V4L2_PIX_FMT_INZC,
|
|
+ },
|
|
+ {
|
|
+ .name = "Relative IR (PAIR)",
|
|
+ .guid = UVC_GUID_FORMAT_PAIR,
|
|
+ .fcc = V4L2_PIX_FMT_PAIR,
|
|
+ },
|
|
+ {
|
|
+ .name = "Z16 Huffman Compression",
|
|
+ .guid = UVC_GUID_FORMAT_Z16H,
|
|
+ .fcc = V4L2_PIX_FMT_Z16H,
|
|
+ },
|
|
};
|
|
|
|
/* ------------------------------------------------------------------------
|
|
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
|
|
index 7e4d3eea371b..a5ea1b4b7902 100644
|
|
--- a/drivers/media/usb/uvc/uvcvideo.h
|
|
+++ b/drivers/media/usb/uvc/uvcvideo.h
|
|
@@ -125,12 +125,69 @@
|
|
#define UVC_GUID_FORMAT_Y12I \
|
|
{ 'Y', '1', '2', 'I', 0x00, 0x00, 0x10, 0x00, \
|
|
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_Y16I \
|
|
+ { 'Y', '1', '6', 'I', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
#define UVC_GUID_FORMAT_Z16 \
|
|
{ 'Z', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \
|
|
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
#define UVC_GUID_FORMAT_RW10 \
|
|
{ 'R', 'W', '1', '0', 0x00, 0x00, 0x10, 0x00, \
|
|
0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_RAW8 \
|
|
+ { 'R', 'A', 'W', '8', 0x66, 0x1a, 0x42, 0xa2, \
|
|
+ 0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a}
|
|
+#define UVC_GUID_FORMAT_RW16 \
|
|
+ { 'R', 'W', '1', '6', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_INVZ \
|
|
+ { 'I', 'N', 'V', 'Z', 0x90, 0x2d, 0x58, 0x4a, \
|
|
+ 0x92, 0x0b, 0x77, 0x3f, 0x1f, 0x2c, 0x55, 0x6b}
|
|
+#define UVC_GUID_FORMAT_INZI \
|
|
+ { 'I', 'N', 'Z', 'I', 0x66, 0x1a, 0x42, 0xa2, \
|
|
+ 0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a}
|
|
+#define UVC_GUID_FORMAT_INVR \
|
|
+ { 'I', 'N', 'V', 'R', 0x90, 0x2d, 0x58, 0x4a, \
|
|
+ 0x92, 0x0b, 0x77, 0x3f, 0x1f, 0x2c, 0x55, 0x6b}
|
|
+#define UVC_GUID_FORMAT_INRI \
|
|
+ { 'I', 'N', 'R', 'I', 0x90, 0x2d, 0x58, 0x4a, \
|
|
+ 0x92, 0x0b, 0x77, 0x3f, 0x1f, 0x2c, 0x55, 0x6b}
|
|
+#define UVC_GUID_FORMAT_INVI \
|
|
+ { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \
|
|
+ 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f}
|
|
+#define UVC_GUID_FORMAT_RELI \
|
|
+ { 'R', 'E', 'L', 'I', 0x14, 0x13, 0x43, 0xf9, \
|
|
+ 0xa7, 0x5a, 0xee, 0x6b, 0xbf, 0x01, 0x2e, 0x23}
|
|
+#define UVC_GUID_FORMAT_L8 \
|
|
+ { '2', 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_L16 \
|
|
+ { 'Q', 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_D16 \
|
|
+ { 'P', 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_BAYER16 \
|
|
+ { 'R', 'W', '1', '6', 0x66, 0x1a, 0x42, 0xa2, \
|
|
+ 0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a}
|
|
+#define UVC_GUID_FORMAT_W10 \
|
|
+ { 'W', '1', '0', ' ', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_CONFIDENCE_MAP \
|
|
+ { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_FG \
|
|
+ { 'F', 'G', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
+#define UVC_GUID_FORMAT_INZC \
|
|
+ { 'I', 'N', 'Z', 'C', 0x02, 0xb6, 0x0f, 0x48, \
|
|
+ 0x97, 0x8c, 0xe4, 0xe8, 0x8a, 0xe8, 0x9b, 0x89}
|
|
+#define UVC_GUID_FORMAT_PAIR \
|
|
+ { 'P', 'A', 'I', 'R', 0x36, 0x85, 0x41, 0x48, \
|
|
+ 0xb6, 0xbf, 0x8f, 0xc6, 0xff, 0xb0, 0x83, 0xa8}
|
|
+#define UVC_GUID_FORMAT_Z16H \
|
|
+ { 'Z', '1', '6', 'H', 0x00, 0x00, 0x10, 0x00, \
|
|
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
|
|
|
|
/* ------------------------------------------------------------------------
|
|
* Driver specific constants.
|
|
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
|
|
index 75bdcb4b7d57..ca906a9173fd 100644
|
|
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
|
|
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
|
|
@@ -1229,6 +1229,18 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
|
|
case V4L2_SDR_FMT_CS8: descr = "Complex S8"; break;
|
|
case V4L2_SDR_FMT_CS14LE: descr = "Complex S14LE"; break;
|
|
case V4L2_SDR_FMT_RU12LE: descr = "Real U12LE"; break;
|
|
+ case V4L2_PIX_FMT_Y8I: descr = "8-bit Greyscale L/R interleaved"; break;
|
|
+ case V4L2_PIX_FMT_Y12I: descr = "12-bit Grey L/R interleaved"; break;
|
|
+ case V4L2_PIX_FMT_Y16I: descr = "16-bit Grey L/R interleaved"; break;
|
|
+ case V4L2_PIX_FMT_Z16: descr = "16-bit Depth data"; break;
|
|
+ case V4L2_PIX_FMT_RW16: descr = "16-bit Raw data"; break;
|
|
+ case V4L2_PIX_FMT_INZI: descr = "32-bit IR:Depth 10:16"; break;
|
|
+ case V4L2_PIX_FMT_W10: descr = "10-bit packed 8888[2222]"; break;
|
|
+ case V4L2_PIX_FMT_CONFIDENCE_MAP: descr = "4-bit per pixel packed"; break;
|
|
+ case V4L2_PIX_FMT_FG: descr = "Frame Grabber (FG )"; break;
|
|
+ case V4L2_PIX_FMT_INZC: descr = "Planar Depth/Confidence (INZC)"; break;
|
|
+ case V4L2_PIX_FMT_PAIR: descr = "Relative IR (PAIR)"; break;
|
|
+ case V4L2_PIX_FMT_Z16H: descr = "Z16 Huffman Compression"; break;
|
|
|
|
default:
|
|
/* Compressed formats */
|
|
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
|
|
index 421d27413731..e49ee3858c23 100644
|
|
--- a/include/uapi/linux/videodev2.h
|
|
+++ b/include/uapi/linux/videodev2.h
|
|
@@ -623,7 +623,21 @@ struct v4l2_pix_format {
|
|
#define V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
|
|
#define V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
|
|
#define V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
|
|
+#define V4L2_PIX_FMT_Y16I v4l2_fourcc('Y', '1', '6', 'I') /* Greyscale 16-bit L/R interleaved */
|
|
#define V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
|
|
+#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* Greyscale 16-bit */
|
|
+#define V4L2_PIX_FMT_RW16 v4l2_fourcc('R', 'W', '1', '6') /* Raw data 16-bit */
|
|
+#define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* 24 Depth/IR 16:8 */
|
|
+#define V4L2_PIX_FMT_INVR v4l2_fourcc('I', 'N', 'V', 'R') /* 16 Depth */
|
|
+#define V4L2_PIX_FMT_INRI v4l2_fourcc('I', 'N', 'R', 'I') /* 24 Depth/IR 16:8 */
|
|
+#define V4L2_PIX_FMT_RELI v4l2_fourcc('R', 'E', 'L', 'I') /* 8 IR alternating on off illumination */
|
|
+#define V4L2_PIX_FMT_W10 v4l2_fourcc('W', '1', '0', ' ') /* Packed raw data 10-bit */
|
|
+#define V4L2_PIX_FMT_CONFIDENCE_MAP v4l2_fourcc('C', ' ', ' ', ' ') /* Two pixels in one byte */
|
|
+/* Librealsense development*/
|
|
+#define V4L2_PIX_FMT_FG v4l2_fourcc('F', 'G', ' ', ' ') /* Frame Grabber */
|
|
+#define V4L2_PIX_FMT_INZC v4l2_fourcc('I', 'N', 'Z', 'C') /* Planar Depth/Confidence */
|
|
+#define V4L2_PIX_FMT_PAIR v4l2_fourcc('P', 'A', 'I', 'R') /* Relative IR */
|
|
+#define V4L2_PIX_FMT_Z16H v4l2_fourcc('Z', '1', '6', 'H') /* Depth Z16 custom Huffman Code compression*/
|
|
|
|
/* SDR formats - used only for Software Defined Radio devices */
|
|
#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
|
|
--
|
|
2.37.1
|
|
|