diff mbox series

[2/2] CNF4 pixel format for media subsystem

Message ID 1536220267-22347-3-git-send-email-sergey.dorodnicov@intel.com (mailing list archive)
State New, archived
Headers show
Series Confidence pixel-format for Intel RealSense cameras | expand

Commit Message

Sergey Dorodnic Sept. 6, 2018, 7:51 a.m. UTC
From: Sergey Dorodnicov <sergey.dorodnicov@intel.com>

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

Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com>
Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 5 +++++
 drivers/media/usb/uvc/uvcvideo.h   | 3 +++
 2 files changed, 8 insertions(+)

Comments

Hans Verkuil Sept. 6, 2018, 9:37 a.m. UTC | #1
On 09/06/18 09:51, dorodnic@gmail.com wrote:
> From: Sergey Dorodnicov <sergey.dorodnicov@intel.com>
> 
> Registering new GUID used by Intel RealSense depth cameras with fourcc
> CNF4, encoding sensor confidence information for every pixel.
> 
> Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com>
> Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>
> ---
>  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)",

The name should correspond to what is set in v4l2-ioctl.c.

Regards,

	Hans

> +		.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, \
>
Laurent Pinchart Sept. 6, 2018, 10:05 a.m. UTC | #2
Hello Sergey,

On Thursday, 6 September 2018 12:37:36 EEST Hans Verkuil wrote:
> On 09/06/18 09:51, dorodnic@gmail.com wrote:
> > From: Sergey Dorodnicov <sergey.dorodnicov@intel.com>
> > 
> > Registering new GUID used by Intel RealSense depth cameras with fourcc
> > CNF4, encoding sensor confidence information for every pixel.

s/confidence/depth confidence/

> > 
> > Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com>
> > Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com>

Could you please send me the output of lsusb -v (ideally run as root, or 
through sudo) for a camera that uses this format ?

> > ---
> > 
> >  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)",
> 
> The name should correspond to what is set in v4l2-ioctl.c.

And should even be removed as it duplicates the names in v4l2-ioctl.c. I have 
a half-baked patch to do so, I'll try to resurrect it. This isn't a blocking 
issue, I'll rebase my patch on top of this one.

> > +		.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, \
diff mbox series

Patch

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, \