lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Nov 2022 09:19:51 +0100
From:   Ricardo Ribalda <ribalda@...omium.org>
To:     Ai Chao <aichao@...inos.cn>
Cc:     laurent.pinchart@...asonboard.com, mchehab@...nel.org,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] media: uvcvideo: Fix bandwidth error for Alcor camera

Hi Ai

On Tue, 22 Nov 2022 at 09:49, Ai Chao <aichao@...inos.cn> wrote:
>
> For Alcor Corp. Slave camera(1b17:6684/2017:0011), it support to output
>  compressed video data, and it return a wrong dwMaxPayloadTransferSize
>  fields. This is a fireware issue, but the manufacturer cannot provide
>  a const return fieldsby the fireware. For some device, it requested
nit:s/fireware/firmware/
>  2752512 B/frame bandwidth. For normally device, it requested 3072 or 1024
>  B/frame bandwidth. so we check the dwMaxPayloadTransferSize fields,if it
>  large than 0x1000, reset dwMaxPayloadTransferSize to 1024, and the camera
>  preview normally.
>
> Signed-off-by: Ai Chao <aichao@...inos.cn>
Reviewed-by: Ricardo Ribalda <ribalda@...omium.org>
>
> ---
> change for v4
> - Change usb_match_one_id to usb_match_id
> - Modify the discription
>
> change for v3
> - Add VID/PID 2017:0011
>
> change for v2
> - Used usb_match_one_id to check VID and PID
> ---
> ---
>  drivers/media/usb/uvc/uvc_video.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
> index d2eb9066e4dc..75bdd71d0e5a 100644
> --- a/drivers/media/usb/uvc/uvc_video.c
> +++ b/drivers/media/usb/uvc/uvc_video.c
> @@ -135,6 +135,11 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
>         static const struct usb_device_id elgato_cam_link_4k = {
>                 USB_DEVICE(0x0fd9, 0x0066)
>         };
> +       static const struct usb_device_id alcor_corp_slave_cam[] = {
> +               { USB_DEVICE(0x2017, 0x0011) },
> +               { USB_DEVICE(0x1b17, 0x6684) },
> +               { }
> +       };
>         struct uvc_format *format = NULL;
>         struct uvc_frame *frame = NULL;
>         unsigned int i;
> @@ -234,6 +239,13 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
>
>                 ctrl->dwMaxPayloadTransferSize = bandwidth;
>         }
> +
> +       /* Alcor Corp. Slave camera return wrong dwMaxPayloadTransferSize */
> +       if ((format->flags & UVC_FMT_FLAG_COMPRESSED) &&
> +           (ctrl->dwMaxPayloadTransferSize > 0x1000) &&
> +           usb_match_id(stream->dev->intf, alcor_corp_slave_cam)) {
> +               ctrl->dwMaxPayloadTransferSize = 1024;
> +       }
>  }
>
>  static size_t uvc_video_ctrl_size(struct uvc_streaming *stream)
> --
> 2.25.1
>


-- 
Ricardo Ribalda

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ