Re: [PATCH] [uvcvideo] Add "Auto" to power line frequency control

2019-04-01 Thread Sergey Dorodnic
Hello,
Any feedback on the patch?
Thank you,
Sergey


On Sun, Mar 17, 2019 at 9:51 AM  wrote:
>
> From: Sergey Dorodnicov 
>
> Based on section 4.2.2.3.6 of the USB Device Class Definition for Video 
> Devices
> and inline with v4l2-ctrls.c, this patch is adding "Auto" to the list of valid
> values of the power line frequency control.
>
> Tested on 5.0.0-rc7 using Intel D415 and D435 USB cameras.
>
> Sergey Dorodnicov (1):
>   media: Add missing "Auto" option to the power line frequency control
>
>  drivers/media/usb/uvc/uvc_ctrl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> --
> 2.7.4
>


[PATCH] media: Add missing "Auto" option to the power line frequency control

2019-03-17 Thread dorodnic
From: Sergey Dorodnicov 

Section 4.2.2.3.6 of the USB Device Class Definition for Video Devices,
specifies "Auto" as a valid value for the power line frequency control.
This makes uvcvideo module consistent with control definition inside
/drivers/media/v4l2-core/v4l2-ctrls.c:
camera_power_line_frequency[] = {
"Disabled",
"50 Hz",
"60 Hz",
"Auto",

Signed-off-by: Sergey Dorodnicov 
Signed-off-by: Evgeni Raikhel 
---
 drivers/media/usb/uvc/uvc_ctrl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 14cff91..a85910a 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -358,6 +358,7 @@ static const struct uvc_menu_info 
power_line_frequency_controls[] = {
{ 0, "Disabled" },
{ 1, "50 Hz" },
{ 2, "60 Hz" },
+   { 3, "Auto" },
 };
 
 static const struct uvc_menu_info exposure_auto_controls[] = {
-- 
2.7.4



[PATCH] [uvcvideo] Add "Auto" to power line frequency control

2019-03-17 Thread dorodnic
From: Sergey Dorodnicov 

Based on section 4.2.2.3.6 of the USB Device Class Definition for Video Devices
and inline with v4l2-ctrls.c, this patch is adding "Auto" to the list of valid
values of the power line frequency control.

Tested on 5.0.0-rc7 using Intel D415 and D435 USB cameras. 

Sergey Dorodnicov (1):
  media: Add missing "Auto" option to the power line frequency control

 drivers/media/usb/uvc/uvc_ctrl.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.7.4



Re: [PATCH v2 2/2] [media] CNF4 pixel format for media subsystem

2018-11-04 Thread Sergey Dorodnic
Hello Laurent,

Thank you for the review and the comments.
Please modify the subject / description as you see fit.
I will make sure to use the right prefix in future submissions.

Best regards,
Sergey
On Thu, Nov 1, 2018 at 9:10 AM Laurent Pinchart
 wrote:
>
> Hi Sergey,
>
> Thank you for the patch.
>
> As for patch 1/2, the subject line needs a prefix. Furthermore it doesn't
> really describe the patch. I propose writing it as
>
> media: uvcvideo: Add support for the CNF4 format
>
> On Wednesday, 12 September 2018 09:42:07 EET dorod...@gmail.com wrote:
> > From: Sergey Dorodnicov 
> >
> > Registering new GUID used by Intel RealSense cameras with fourcc CNF4,
> > encoding depth sensor confidence information for every pixel.
>
> And there I would write "Register the GUID ...".
>
> Apart from that the patch looks good to me,
>
> Reviewed-by: Laurent Pinchart 
>
> If you're fine with the subject line change there's no need to resubmit, I'll
> fix it when applying the patch to my tree.
>
> > Signed-off-by: Sergey Dorodnicov 
> > Signed-off-by: Evgeni Raikhel 
> > ---
> >  drivers/media/usb/uvc/uvc_driver.c | 5 +
> >  drivers/media/usb/uvc/uvcvideo.h   | 3 +++
> >  2 files changed, 8 insertions(+)
> >
> > diff --git a/drivers/media/usb/uvc/uvc_driver.c
> > b/drivers/media/usb/uvc/uvc_driver.c index d46dc43..19f129f 100644
> > --- a/drivers/media/usb/uvc/uvc_driver.c
> > +++ b/drivers/media/usb/uvc/uvc_driver.c
> > @@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = {
> >   .guid   = UVC_GUID_FORMAT_INZI,
> >   .fcc= V4L2_PIX_FMT_INZI,
> >   },
> > + {
> > + .name   = "4-bit Depth Confidence (Packed)",
> > + .guid   = UVC_GUID_FORMAT_CNF4,
> > + .fcc= V4L2_PIX_FMT_CNF4,
> > + },
> >  };
> >
> >  /* 
> > diff --git a/drivers/media/usb/uvc/uvcvideo.h
> > b/drivers/media/usb/uvc/uvcvideo.h index e5f5d84..779bab2 100644
> > --- a/drivers/media/usb/uvc/uvcvideo.h
> > +++ b/drivers/media/usb/uvc/uvcvideo.h
> > @@ -154,6 +154,9 @@
> >  #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_CNF4 \
> > + { 'C',  ' ',  ' ',  ' ', 0x00, 0x00, 0x10, 0x00, \
> > +  0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
> >
> >  #define UVC_GUID_FORMAT_D3DFMT_L8 \
> >   {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
>
> --
> Regards,
>
> Laurent Pinchart
>
>
>


Re: [PATCH v2 0/2] [media] Depth confidence pixel-format for Intel RealSense cameras

2018-11-01 Thread Sergey Dorodnic
Hello Hans, Laurent

Could you please comment on this topic?
If the patches require any additional work, we will be eager to address it.
For now we are publishing a custom DKMS, but it would be great to see
better 3D-camera hardware support in the near future.

Regards,
Sergey
(sorry, re-sending in plain-text mode)

On Wed, Oct 3, 2018 at 5:27 AM Hans Verkuil  wrote:
>
> On 10/03/18 14:08, Raikhel, Evgeni wrote:
> > Hans hello,
> >
> > Can you update this patch series status ?
> > Thanks in advance,
> >
> > With regards,
> > Evgeni
> >
> > -Original Message-
> > From: Hans Verkuil [mailto:hverk...@xs4all.nl]
> > Sent: Wednesday, September 12, 2018 09:40
> > To: dorod...@gmail.com; linux-media@vger.kernel.org
> > Cc: laurent.pinch...@ideasonboard.com; Raikhel, Evgeni 
> > ; Dorodnicov, Sergey 
> > Subject: Re: [PATCH v2 0/2] [media] Depth confidence pixel-format for Intel 
> > RealSense cameras
> >
> > On 09/12/2018 08:42 AM, dorod...@gmail.com wrote:
> >> From: Sergey Dorodnicov 
> >>
> >> Define new fourcc describing depth sensor confidence data used in Intel 
> >> RealSense cameras.
> >> Confidence information is stored as packed 4 bits per pixel single-plane 
> >> image.
> >> The patches were tested on 4.18-rc2 and merged with media_tree/master.
> >> Addressing code-review comments by Hans Verkuil 
> >> and Laurent Pinchart .
> >>
> >> Sergey Dorodnicov (2):
> >>   CNF4 fourcc for 4 bit-per-pixel packed depth confidence information
> >>   CNF4 pixel format for media subsystem
> >>
> >>  Documentation/media/uapi/v4l/depth-formats.rst |  1 +
> >>  Documentation/media/uapi/v4l/pixfmt-cnf4.rst   | 31 
> >> ++
> >>  drivers/media/usb/uvc/uvc_driver.c |  5 +
> >>  drivers/media/usb/uvc/uvcvideo.h   |  3 +++
> >>  drivers/media/v4l2-core/v4l2-ioctl.c   |  1 +
> >>  include/uapi/linux/videodev2.h |  1 +
> >>  6 files changed, 42 insertions(+)
> >>  create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst
> >>
> >
> > Laurent, this looks good to me. Do you want to take this series or shall I?
> >
> > If you take it, then you can add my:
> >
> > Acked-by: Hans Verkuil 
> >
> > to these patches. If you want me to take it, then I'll need your Ack of 
> > course.
>
> Still waiting for a reply from Laurent. But thanks for reminding us,
> I've pinged Laurent and he will hopefully come back with an Ack or review
> by the end of the week.
>
> Regards,
>
> Hans
>
> >
> > Regards,
> >
> >   Hans
> > -
> > Intel Israel (74) Limited
> >
> > This e-mail and any attachments may contain confidential material for
> > the sole use of the intended recipient(s). Any review or distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> >
>


[PATCH v2 2/2] [media] CNF4 pixel format for media subsystem

2018-09-11 Thread dorodnic
From: Sergey Dorodnicov 

Registering new GUID used by Intel RealSense cameras with fourcc CNF4,
encoding depth sensor confidence information for every pixel.

Signed-off-by: Sergey Dorodnicov 
Signed-off-by: Evgeni Raikhel 
---
 drivers/media/usb/uvc/uvc_driver.c | 5 +
 drivers/media/usb/uvc/uvcvideo.h   | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index d46dc43..19f129f 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = {
.guid   = UVC_GUID_FORMAT_INZI,
.fcc= V4L2_PIX_FMT_INZI,
},
+   {
+   .name   = "4-bit Depth Confidence (Packed)",
+   .guid   = UVC_GUID_FORMAT_CNF4,
+   .fcc= V4L2_PIX_FMT_CNF4,
+   },
 };
 
 /* 
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index e5f5d84..779bab2 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -154,6 +154,9 @@
 #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_CNF4 \
+   { 'C',  ' ',  ' ',  ' ', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 
 #define UVC_GUID_FORMAT_D3DFMT_L8 \
{0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
-- 
2.7.4



[PATCH v2 0/2] [media] Depth confidence pixel-format for Intel RealSense cameras

2018-09-11 Thread dorodnic
From: Sergey Dorodnicov 

Define new fourcc describing depth sensor confidence data used in Intel 
RealSense cameras.
Confidence information is stored as packed 4 bits per pixel single-plane image.
The patches were tested on 4.18-rc2 and merged with media_tree/master.
Addressing code-review comments by Hans Verkuil  and
Laurent Pinchart .

Sergey Dorodnicov (2):
  CNF4 fourcc for 4 bit-per-pixel packed depth confidence information
  CNF4 pixel format for media subsystem

 Documentation/media/uapi/v4l/depth-formats.rst |  1 +
 Documentation/media/uapi/v4l/pixfmt-cnf4.rst   | 31 ++
 drivers/media/usb/uvc/uvc_driver.c |  5 +
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 drivers/media/v4l2-core/v4l2-ioctl.c   |  1 +
 include/uapi/linux/videodev2.h |  1 +
 6 files changed, 42 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst

-- 
2.7.4



[PATCH v2 1/2] [media] CNF4 fourcc for 4 bit-per-pixel packed depth confidence information

2018-09-11 Thread dorodnic
From: Sergey Dorodnicov 

Adding new fourcc CNF4 for 4 bit-per-pixel packed depth confidence
information provided by Intel RealSense cameras. Every two consecutive
pixels are packed into a single byte.

Signed-off-by: Sergey Dorodnicov 
Signed-off-by: Evgeni Raikhel 
---
 Documentation/media/uapi/v4l/depth-formats.rst |  1 +
 Documentation/media/uapi/v4l/pixfmt-cnf4.rst   | 31 ++
 drivers/media/v4l2-core/v4l2-ioctl.c   |  1 +
 include/uapi/linux/videodev2.h |  1 +
 4 files changed, 34 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst

diff --git a/Documentation/media/uapi/v4l/depth-formats.rst 
b/Documentation/media/uapi/v4l/depth-formats.rst
index d1641e9..9533348 100644
--- a/Documentation/media/uapi/v4l/depth-formats.rst
+++ b/Documentation/media/uapi/v4l/depth-formats.rst
@@ -14,3 +14,4 @@ Depth data provides distance to points, mapped onto the image 
plane
 
 pixfmt-inzi
 pixfmt-z16
+pixfmt-cnf4
diff --git a/Documentation/media/uapi/v4l/pixfmt-cnf4.rst 
b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst
new file mode 100644
index 000..8f46929
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst
@@ -0,0 +1,31 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _V4L2-PIX-FMT-CNF4:
+
+**
+V4L2_PIX_FMT_CNF4 ('CNF4')
+**
+
+Depth sensor confidence information as a 4 bits per pixel packed array
+
+Description
+===
+
+Proprietary format used by Intel RealSense Depth cameras containing depth
+confidence information in range 0-15 with 0 indicating that the sensor was
+unable to resolve any signal and 15 indicating maximum level of confidence for
+the specific sensor (actual error margins might change from sensor to sensor).
+
+Every two consecutive pixels are packed into a single byte.
+Bits 0-3 of byte n refer to confidence value of depth pixel 2*n,
+bits 4-7 to confidence value of depth pixel 2*n+1.
+
+**Bit-packed representation.**
+
+.. flat-table::
+:header-rows:  0
+:stub-columns: 0
+:widths: 64 64
+
+* - Y'\ :sub:`01[3:0]`\ (bits 7--4) Y'\ :sub:`00[3:0]`\ (bits 3--0)
+  - Y'\ :sub:`03[3:0]`\ (bits 7--4) Y'\ :sub:`02[3:0]`\ (bits 3--0)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 54afc9c..f9aa8bd 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1189,6 +1189,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; 
break;
case V4L2_PIX_FMT_Z16:  descr = "16-bit Depth"; break;
case V4L2_PIX_FMT_INZI: descr = "Planar 10:16 Greyscale Depth"; 
break;
+   case V4L2_PIX_FMT_CNF4: descr = "4-bit Depth Confidence 
(Packed)"; break;
case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break;
case V4L2_PIX_FMT_UV8:  descr = "8-bit Chrominance UV 4-4"; 
break;
case V4L2_PIX_FMT_YVU410:   descr = "Planar YVU 4:1:0"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 622f047..2837c93 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -676,6 +676,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_Z16  v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
16-bit */
 #define V4L2_PIX_FMT_MT21Cv4l2_fourcc('M', 'T', '2', '1') /* Mediatek 
compressed block mode  */
 #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar 
Greyscale 10-bit and Depth 16-bit */
+#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit 
packed depth confidence information */
 
 /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits 
unused */
 #define V4L2_PIX_FMT_IPU3_SBGGR10  v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 
packed 10-bit BGGR bayer */
-- 
2.7.4



[PATCH 0/2] [media] Confidence pixel-format for Intel RealSense cameras

2018-09-06 Thread dorodnic
From: Sergey Dorodnicov 

Define new fourcc describing depth sensor confidence data used in Intel 
RealSense cameras.
Confidence information is stored as packed 4 bits per pixel single-plane image.
The patches were tested on 4.18-rc2 and merged with media_tree/master.

Sergey Dorodnicov (2):
  CNF4 fourcc for 4 bit-per-pixel packed confidence information
  CNF4 pixel format for media subsystem

 Documentation/media/uapi/v4l/depth-formats.rst |  1 +
 Documentation/media/uapi/v4l/pixfmt-cnf4.rst   | 30 ++
 drivers/media/usb/uvc/uvc_driver.c |  5 +
 drivers/media/usb/uvc/uvcvideo.h   |  3 +++
 drivers/media/v4l2-core/v4l2-ioctl.c   |  1 +
 include/uapi/linux/videodev2.h |  1 +
 6 files changed, 41 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst

-- 
2.7.4



[PATCH 1/2] CNF4 fourcc for 4 bit-per-pixel packed confidence information

2018-09-06 Thread dorodnic
From: Sergey Dorodnicov 

Adding new fourcc CNF4 for 4 bit-per-pixel packed confidence information
provided by Intel RealSense depth cameras. Every two consecutive pixels
are packed into a single byte (little-endian).

Signed-off-by: Sergey Dorodnicov 
Signed-off-by: Evgeni Raikhel 
---
 Documentation/media/uapi/v4l/depth-formats.rst |  1 +
 Documentation/media/uapi/v4l/pixfmt-cnf4.rst   | 30 ++
 drivers/media/v4l2-core/v4l2-ioctl.c   |  1 +
 include/uapi/linux/videodev2.h |  1 +
 4 files changed, 33 insertions(+)
 create mode 100644 Documentation/media/uapi/v4l/pixfmt-cnf4.rst

diff --git a/Documentation/media/uapi/v4l/depth-formats.rst 
b/Documentation/media/uapi/v4l/depth-formats.rst
index d1641e9..9533348 100644
--- a/Documentation/media/uapi/v4l/depth-formats.rst
+++ b/Documentation/media/uapi/v4l/depth-formats.rst
@@ -14,3 +14,4 @@ Depth data provides distance to points, mapped onto the image 
plane
 
 pixfmt-inzi
 pixfmt-z16
+pixfmt-cnf4
diff --git a/Documentation/media/uapi/v4l/pixfmt-cnf4.rst 
b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst
new file mode 100644
index 000..d24fc1a
--- /dev/null
+++ b/Documentation/media/uapi/v4l/pixfmt-cnf4.rst
@@ -0,0 +1,30 @@
+.. -*- coding: utf-8; mode: rst -*-
+
+.. _V4L2-PIX-FMT-CNF4:
+
+**
+V4L2_PIX_FMT_CNF4 ('CNF4')
+**
+
+Sensor confidence information as a 4 bits per pixel packed array
+
+Description
+===
+
+Proprietary format used by Intel RealSense Depth cameras containing sensor
+confidence information in range 0-15 with 0 indicating that the sensor was
+unable to resolve any signal and 15 indicating maximum level of confidence for
+the specific sensor (actual error margins might change from sensor to sensor).
+
+Every two consecutive pixels are packed into a single byte (bit order is
+little-endian).
+
+**Bit-packed representation.**
+
+.. flat-table::
+:header-rows:  0
+:stub-columns: 0
+:widths: 64 64
+
+* - Y'\ :sub:`01[3:0]`\ (bits 3--0) Y'\ :sub:`00[3:0]`\ (bits 7--4)
+  - Y'\ :sub:`03[3:0]`\ (bits 3--0) Y'\ :sub:`02[3:0]`\ (bits 7--4)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
b/drivers/media/v4l2-core/v4l2-ioctl.c
index 54afc9c..eff296d 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1189,6 +1189,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
case V4L2_PIX_FMT_Y12I: descr = "Interleaved 12-bit Greyscale"; 
break;
case V4L2_PIX_FMT_Z16:  descr = "16-bit Depth"; break;
case V4L2_PIX_FMT_INZI: descr = "Planar 10:16 Greyscale Depth"; 
break;
+   case V4L2_PIX_FMT_CNF4: descr = "4-bit Confidence (Packed)"; 
break;
case V4L2_PIX_FMT_PAL8: descr = "8-bit Palette"; break;
case V4L2_PIX_FMT_UV8:  descr = "8-bit Chrominance UV 4-4"; 
break;
case V4L2_PIX_FMT_YVU410:   descr = "Planar YVU 4:1:0"; break;
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 5d1a368..a47f603 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -676,6 +676,7 @@ struct v4l2_pix_format {
 #define V4L2_PIX_FMT_Z16  v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 
16-bit */
 #define V4L2_PIX_FMT_MT21Cv4l2_fourcc('M', 'T', '2', '1') /* Mediatek 
compressed block mode  */
 #define V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar 
Greyscale 10-bit and Depth 16-bit */
+#define V4L2_PIX_FMT_CNF4 v4l2_fourcc('C', 'N', 'F', '4') /* Intel 4-bit 
packed confidence information */
 
 /* 10bit raw bayer packed, 32 bytes for every 25 pixels, last LSB 6 bits 
unused */
 #define V4L2_PIX_FMT_IPU3_SBGGR10  v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 
packed 10-bit BGGR bayer */
-- 
2.7.4



[PATCH 2/2] CNF4 pixel format for media subsystem

2018-09-06 Thread dorodnic
From: Sergey Dorodnicov 

Registering new GUID used by Intel RealSense depth cameras with fourcc
CNF4, encoding sensor confidence information for every pixel.

Signed-off-by: Sergey Dorodnicov 
Signed-off-by: Evgeni Raikhel 
---
 drivers/media/usb/uvc/uvc_driver.c | 5 +
 drivers/media/usb/uvc/uvcvideo.h   | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c 
b/drivers/media/usb/uvc/uvc_driver.c
index d46dc43..c8d40a4 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -214,6 +214,11 @@ static struct uvc_format_desc uvc_fmts[] = {
.guid   = UVC_GUID_FORMAT_INZI,
.fcc= V4L2_PIX_FMT_INZI,
},
+   {
+   .name   = "Confidence 4-bit Packed (CNF4)",
+   .guid   = UVC_GUID_FORMAT_CNF4,
+   .fcc= V4L2_PIX_FMT_CNF4,
+   },
 };
 
 /* 
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index e5f5d84..779bab2 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -154,6 +154,9 @@
 #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_CNF4 \
+   { 'C',  ' ',  ' ',  ' ', 0x00, 0x00, 0x10, 0x00, \
+0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 
 #define UVC_GUID_FORMAT_D3DFMT_L8 \
{0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
-- 
2.7.4