All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110
@ 2021-03-08 10:27 Pawel Laszczak
  2021-03-08 10:27 ` [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor Pawel Laszczak
  2021-03-14  1:58 ` [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Peter Chen
  0 siblings, 2 replies; 7+ messages in thread
From: Pawel Laszczak @ 2021-03-08 10:27 UTC (permalink / raw)
  To: balbi, gregkh
  Cc: linux-api, laurent.pinchart, linux-usb, linux-kernel, peter.chen,
	kurahul, Pawel Laszczak

From: Pawel Laszczak <pawell@cadence.com>

Command Verifier during UVC Descriptor Tests (Class Video Control
Interface Descriptor Test Video) compleins about:

Video Control Interface Header bcdUVC is 0x0100. USB Video Class
specification 1.0 has been replaced by 1.1 specification
(UVC: 6.2.26) Class Video Control Interface Descriptor bcdUVC is not 1.1

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
---
 drivers/usb/gadget/function/uvc_configfs.c | 2 +-
 drivers/usb/gadget/legacy/webcam.c         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
index 00fb58e50a15..cd28dec837dd 100644
--- a/drivers/usb/gadget/function/uvc_configfs.c
+++ b/drivers/usb/gadget/function/uvc_configfs.c
@@ -231,7 +231,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group,
 	h->desc.bLength			= UVC_DT_HEADER_SIZE(1);
 	h->desc.bDescriptorType		= USB_DT_CS_INTERFACE;
 	h->desc.bDescriptorSubType	= UVC_VC_HEADER;
-	h->desc.bcdUVC			= cpu_to_le16(0x0100);
+	h->desc.bcdUVC			= cpu_to_le16(0x0110);
 	h->desc.dwClockFrequency	= cpu_to_le32(48000000);
 
 	config_item_init_type_name(&h->item, name, &uvcg_control_header_type);
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
index a9f8eb8e1c76..3a61de4bb2b1 100644
--- a/drivers/usb/gadget/legacy/webcam.c
+++ b/drivers/usb/gadget/legacy/webcam.c
@@ -90,7 +90,7 @@ static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
 	.bLength		= UVC_DT_HEADER_SIZE(1),
 	.bDescriptorType	= USB_DT_CS_INTERFACE,
 	.bDescriptorSubType	= UVC_VC_HEADER,
-	.bcdUVC			= cpu_to_le16(0x0100),
+	.bcdUVC			= cpu_to_le16(0x0110),
 	.wTotalLength		= 0, /* dynamic */
 	.dwClockFrequency	= cpu_to_le32(48000000),
 	.bInCollection		= 0, /* dynamic */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor
  2021-03-08 10:27 [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Pawel Laszczak
@ 2021-03-08 10:27 ` Pawel Laszczak
  2021-03-14  1:46   ` Peter Chen
  2021-03-14  2:30   ` Laurent Pinchart
  2021-03-14  1:58 ` [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Peter Chen
  1 sibling, 2 replies; 7+ messages in thread
From: Pawel Laszczak @ 2021-03-08 10:27 UTC (permalink / raw)
  To: balbi, gregkh
  Cc: linux-api, laurent.pinchart, linux-usb, linux-kernel, peter.chen,
	kurahul, Pawel Laszczak

From: Pawel Laszczak <pawell@cadence.com>

According with USB Device Class Definition for Video Device the
Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
but it has 11.

Invalid length caused that Processing Unit Descriptor Test Video form
CV tool failed. To fix this issue patch adds bmVideoStandards into
uvc_processing_unit_descriptor structure.

Signed-off-by: Pawel Laszczak <pawell@cadence.com>
---
 include/uapi/linux/usb/video.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
index d854cb19c42c..2a54e8fdd341 100644
--- a/include/uapi/linux/usb/video.h
+++ b/include/uapi/linux/usb/video.h
@@ -302,6 +302,7 @@ struct uvc_processing_unit_descriptor {
 	__u8   bControlSize;
 	__u8   bmControls[2];
 	__u8   iProcessing;
+	__u8   bmVideoStandards;
 } __attribute__((__packed__));
 
 #define UVC_DT_PROCESSING_UNIT_SIZE(n)			(9+(n))
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor
  2021-03-08 10:27 ` [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor Pawel Laszczak
@ 2021-03-14  1:46   ` Peter Chen
  2021-03-14  2:30   ` Laurent Pinchart
  1 sibling, 0 replies; 7+ messages in thread
From: Peter Chen @ 2021-03-14  1:46 UTC (permalink / raw)
  To: Pawel Laszczak
  Cc: balbi, gregkh, linux-api, laurent.pinchart, linux-usb,
	linux-kernel, kurahul

On 21-03-08 11:27:35, Pawel Laszczak wrote:
> From: Pawel Laszczak <pawell@cadence.com>
> 
> According with USB Device Class Definition for Video Device the
> Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
> but it has 11.

Does the reason forget filling bmVideoStandards entry?

Peter
> 
> Invalid length caused that Processing Unit Descriptor Test Video form
> CV tool failed. To fix this issue patch adds bmVideoStandards into
> uvc_processing_unit_descriptor structure.
> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  include/uapi/linux/usb/video.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
> index d854cb19c42c..2a54e8fdd341 100644
> --- a/include/uapi/linux/usb/video.h
> +++ b/include/uapi/linux/usb/video.h
> @@ -302,6 +302,7 @@ struct uvc_processing_unit_descriptor {
>  	__u8   bControlSize;
>  	__u8   bmControls[2];
>  	__u8   iProcessing;
> +	__u8   bmVideoStandards;
>  } __attribute__((__packed__));
>  
>  #define UVC_DT_PROCESSING_UNIT_SIZE(n)			(9+(n))
> -- 
> 2.25.1
> 

-- 

Thanks,
Peter Chen


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110
  2021-03-08 10:27 [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Pawel Laszczak
  2021-03-08 10:27 ` [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor Pawel Laszczak
@ 2021-03-14  1:58 ` Peter Chen
  2021-03-14  2:18   ` Laurent Pinchart
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Chen @ 2021-03-14  1:58 UTC (permalink / raw)
  To: Pawel Laszczak
  Cc: balbi, gregkh, linux-api, laurent.pinchart, linux-usb,
	linux-kernel, kurahul

On 21-03-08 11:27:34, Pawel Laszczak wrote:
> From: Pawel Laszczak <pawell@cadence.com>
> 
> Command Verifier during UVC Descriptor Tests (Class Video Control
> Interface Descriptor Test Video) compleins about:

%s/compleins/complains

> 
> Video Control Interface Header bcdUVC is 0x0100. USB Video Class
> specification 1.0 has been replaced by 1.1 specification
> (UVC: 6.2.26) Class Video Control Interface Descriptor bcdUVC is not 1.1

What does this (UVC: 6.2.26) mean? There are only 4 chapters for this
spec, Am I something wrong?

> 
> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  drivers/usb/gadget/function/uvc_configfs.c | 2 +-
>  drivers/usb/gadget/legacy/webcam.c         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
> index 00fb58e50a15..cd28dec837dd 100644
> --- a/drivers/usb/gadget/function/uvc_configfs.c
> +++ b/drivers/usb/gadget/function/uvc_configfs.c
> @@ -231,7 +231,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group,
>  	h->desc.bLength			= UVC_DT_HEADER_SIZE(1);
>  	h->desc.bDescriptorType		= USB_DT_CS_INTERFACE;
>  	h->desc.bDescriptorSubType	= UVC_VC_HEADER;
> -	h->desc.bcdUVC			= cpu_to_le16(0x0100);
> +	h->desc.bcdUVC			= cpu_to_le16(0x0110);
>  	h->desc.dwClockFrequency	= cpu_to_le32(48000000);
>  
>  	config_item_init_type_name(&h->item, name, &uvcg_control_header_type);
> diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
> index a9f8eb8e1c76..3a61de4bb2b1 100644
> --- a/drivers/usb/gadget/legacy/webcam.c
> +++ b/drivers/usb/gadget/legacy/webcam.c
> @@ -90,7 +90,7 @@ static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
>  	.bLength		= UVC_DT_HEADER_SIZE(1),
>  	.bDescriptorType	= USB_DT_CS_INTERFACE,
>  	.bDescriptorSubType	= UVC_VC_HEADER,
> -	.bcdUVC			= cpu_to_le16(0x0100),
> +	.bcdUVC			= cpu_to_le16(0x0110),
>  	.wTotalLength		= 0, /* dynamic */
>  	.dwClockFrequency	= cpu_to_le32(48000000),
>  	.bInCollection		= 0, /* dynamic */
> -- 
> 2.25.1
> 

-- 

Thanks,
Peter Chen


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110
  2021-03-14  1:58 ` [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Peter Chen
@ 2021-03-14  2:18   ` Laurent Pinchart
  2021-03-15  5:10     ` Pawel Laszczak
  0 siblings, 1 reply; 7+ messages in thread
From: Laurent Pinchart @ 2021-03-14  2:18 UTC (permalink / raw)
  To: Pawel Laszczak
  Cc: Peter Chen, balbi, gregkh, linux-api, linux-usb, linux-kernel, kurahul

Hello Pawel,

Thank you for the patch.

On Sun, Mar 14, 2021 at 09:58:46AM +0800, Peter Chen wrote:
> On 21-03-08 11:27:34, Pawel Laszczak wrote:
> > From: Pawel Laszczak <pawell@cadence.com>
> > 
> > Command Verifier during UVC Descriptor Tests (Class Video Control
> > Interface Descriptor Test Video) compleins about:
> 
> %s/compleins/complains
> 
> > Video Control Interface Header bcdUVC is 0x0100. USB Video Class
> > specification 1.0 has been replaced by 1.1 specification
> > (UVC: 6.2.26) Class Video Control Interface Descriptor bcdUVC is not 1.1
> 
> What does this (UVC: 6.2.26) mean? There are only 4 chapters for this
> spec, Am I something wrong?

I assume this is a reference to a test case in the test suite.

> > Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> > ---
> >  drivers/usb/gadget/function/uvc_configfs.c | 2 +-
> >  drivers/usb/gadget/legacy/webcam.c         | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
> > index 00fb58e50a15..cd28dec837dd 100644
> > --- a/drivers/usb/gadget/function/uvc_configfs.c
> > +++ b/drivers/usb/gadget/function/uvc_configfs.c
> > @@ -231,7 +231,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group,
> >  	h->desc.bLength			= UVC_DT_HEADER_SIZE(1);
> >  	h->desc.bDescriptorType		= USB_DT_CS_INTERFACE;
> >  	h->desc.bDescriptorSubType	= UVC_VC_HEADER;
> > -	h->desc.bcdUVC			= cpu_to_le16(0x0100);
> > +	h->desc.bcdUVC			= cpu_to_le16(0x0110);
> >  	h->desc.dwClockFrequency	= cpu_to_le32(48000000);
> >  
> >  	config_item_init_type_name(&h->item, name, &uvcg_control_header_type);
> > diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
> > index a9f8eb8e1c76..3a61de4bb2b1 100644
> > --- a/drivers/usb/gadget/legacy/webcam.c
> > +++ b/drivers/usb/gadget/legacy/webcam.c
> > @@ -90,7 +90,7 @@ static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
> >  	.bLength		= UVC_DT_HEADER_SIZE(1),
> >  	.bDescriptorType	= USB_DT_CS_INTERFACE,
> >  	.bDescriptorSubType	= UVC_VC_HEADER,
> > -	.bcdUVC			= cpu_to_le16(0x0100),
> > +	.bcdUVC			= cpu_to_le16(0x0110),
> >  	.wTotalLength		= 0, /* dynamic */
> >  	.dwClockFrequency	= cpu_to_le32(48000000),
> >  	.bInCollection		= 0, /* dynamic */

The change looks good to me. With the typo in the commit message fixed,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor
  2021-03-08 10:27 ` [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor Pawel Laszczak
  2021-03-14  1:46   ` Peter Chen
@ 2021-03-14  2:30   ` Laurent Pinchart
  1 sibling, 0 replies; 7+ messages in thread
From: Laurent Pinchart @ 2021-03-14  2:30 UTC (permalink / raw)
  To: Pawel Laszczak
  Cc: balbi, gregkh, linux-api, linux-usb, linux-kernel, peter.chen, kurahul

Hi Pawel,

Thank you for the patch.

On Mon, Mar 08, 2021 at 11:27:35AM +0100, Pawel Laszczak wrote:
> From: Pawel Laszczak <pawell@cadence.com>
> 
> According with USB Device Class Definition for Video Device the
> Processing Unit Descriptor bLength should be 12 (10 + bmControlSize),
> but it has 11.
> 
> Invalid length caused that Processing Unit Descriptor Test Video form
> CV tool failed. To fix this issue patch adds bmVideoStandards into
> uvc_processing_unit_descriptor structure.

The bmVideoStandards field was added in UVC 1.1, it wasn't part of UVC
1.0a. The commit message should explain this.

This change looks good to me, but could you also update
drivers/usb/gadget/legacy/webcam.c and
drivers/usb/gadget/function/f_uvc.c to explicitly set this field to 0 ?

With that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Signed-off-by: Pawel Laszczak <pawell@cadence.com>
> ---
>  include/uapi/linux/usb/video.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
> index d854cb19c42c..2a54e8fdd341 100644
> --- a/include/uapi/linux/usb/video.h
> +++ b/include/uapi/linux/usb/video.h
> @@ -302,6 +302,7 @@ struct uvc_processing_unit_descriptor {
>  	__u8   bControlSize;
>  	__u8   bmControls[2];
>  	__u8   iProcessing;
> +	__u8   bmVideoStandards;
>  } __attribute__((__packed__));
>  
>  #define UVC_DT_PROCESSING_UNIT_SIZE(n)			(9+(n))

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110
  2021-03-14  2:18   ` Laurent Pinchart
@ 2021-03-15  5:10     ` Pawel Laszczak
  0 siblings, 0 replies; 7+ messages in thread
From: Pawel Laszczak @ 2021-03-15  5:10 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Peter Chen, balbi, gregkh, linux-api, linux-usb, linux-kernel,
	Rahul Kumar

Hi Laurent
>
>Hello Pawel,
>
>Thank you for the patch.
>
>On Sun, Mar 14, 2021 at 09:58:46AM +0800, Peter Chen wrote:
>> On 21-03-08 11:27:34, Pawel Laszczak wrote:
>> > From: Pawel Laszczak <pawell@cadence.com>
>> >
>> > Command Verifier during UVC Descriptor Tests (Class Video Control
>> > Interface Descriptor Test Video) compleins about:
>>
>> %s/compleins/complains
>>
>> > Video Control Interface Header bcdUVC is 0x0100. USB Video Class
>> > specification 1.0 has been replaced by 1.1 specification
>> > (UVC: 6.2.26) Class Video Control Interface Descriptor bcdUVC is not 1.1
>>
>> What does this (UVC: 6.2.26) mean? There are only 4 chapters for this
>> spec, Am I something wrong?
>
>I assume this is a reference to a test case in the test suite.

It's a reference to UVC Compliance Test Spec.pdf. 
This document is part of Command Verifier tester.

I will resend the patch without typo. 

Thanks

>
>> > Signed-off-by: Pawel Laszczak <pawell@cadence.com>
>> > ---
>> >  drivers/usb/gadget/function/uvc_configfs.c | 2 +-
>> >  drivers/usb/gadget/legacy/webcam.c         | 2 +-
>> >  2 files changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/drivers/usb/gadget/function/uvc_configfs.c b/drivers/usb/gadget/function/uvc_configfs.c
>> > index 00fb58e50a15..cd28dec837dd 100644
>> > --- a/drivers/usb/gadget/function/uvc_configfs.c
>> > +++ b/drivers/usb/gadget/function/uvc_configfs.c
>> > @@ -231,7 +231,7 @@ static struct config_item *uvcg_control_header_make(struct config_group *group,
>> >  	h->desc.bLength			= UVC_DT_HEADER_SIZE(1);
>> >  	h->desc.bDescriptorType		= USB_DT_CS_INTERFACE;
>> >  	h->desc.bDescriptorSubType	= UVC_VC_HEADER;
>> > -	h->desc.bcdUVC			= cpu_to_le16(0x0100);
>> > +	h->desc.bcdUVC			= cpu_to_le16(0x0110);
>> >  	h->desc.dwClockFrequency	= cpu_to_le32(48000000);
>> >
>> >  	config_item_init_type_name(&h->item, name, &uvcg_control_header_type);
>> > diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c
>> > index a9f8eb8e1c76..3a61de4bb2b1 100644
>> > --- a/drivers/usb/gadget/legacy/webcam.c
>> > +++ b/drivers/usb/gadget/legacy/webcam.c
>> > @@ -90,7 +90,7 @@ static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = {
>> >  	.bLength		= UVC_DT_HEADER_SIZE(1),
>> >  	.bDescriptorType	= USB_DT_CS_INTERFACE,
>> >  	.bDescriptorSubType	= UVC_VC_HEADER,
>> > -	.bcdUVC			= cpu_to_le16(0x0100),
>> > +	.bcdUVC			= cpu_to_le16(0x0110),
>> >  	.wTotalLength		= 0, /* dynamic */
>> >  	.dwClockFrequency	= cpu_to_le32(48000000),
>> >  	.bInCollection		= 0, /* dynamic */
>
>The change looks good to me. With the typo in the commit message fixed,
>
>Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
--

Regards
Pawel Laszczak

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-15  5:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-08 10:27 [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Pawel Laszczak
2021-03-08 10:27 ` [PATCH 2/2] usb: webcam: Invalid size of Processing Unit Descriptor Pawel Laszczak
2021-03-14  1:46   ` Peter Chen
2021-03-14  2:30   ` Laurent Pinchart
2021-03-14  1:58 ` [PATCH 1/2] usb: gadget: uvc: Updating bcdUVC field to 0x0110 Peter Chen
2021-03-14  2:18   ` Laurent Pinchart
2021-03-15  5:10     ` Pawel Laszczak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.