public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jackie Liu <liu.yun@linux.dev>
To: Ai Chao <aichao@kylinos.cn>,
	laurent.pinchart@ideasonboard.com, mchehab@kernel.org,
	ribalda@chromium.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] media: uvcvideo: Fix bandwidth error for Alcor camera
Date: Wed, 23 Nov 2022 16:56:01 +0800	[thread overview]
Message-ID: <ff604843-f4d6-df33-c7d0-c613014e4b53@linux.dev> (raw)
In-Reply-To: <20221122084833.1241078-1-aichao@kylinos.cn>

Hi, Chao.

在 2022/11/22 16:48, Ai Chao 写道:
> For Alcor Corp. Slave camera(1b17:6684/2017:0011), it support to output
>   compressed video data, and it return a wrong dwMaxPayloadTransferSize
Instead of starting with a space, please start with a letter.
>   fields. This is a fireware issue, but the manufacturer cannot provide
>   a const return fieldsby the fireware. For some device, it requested

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.

Until here.

>
> Signed-off-by: Ai Chao <aichao@kylinos.cn>
>
> ---
> 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)

Others, LGTM.

Reviewed-by: Jackie Liu <liuyun01@kylinos.cn>

-- 
Jackie Liu

  parent reply	other threads:[~2022-11-23  8:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22  8:48 [PATCH v4] media: uvcvideo: Fix bandwidth error for Alcor camera Ai Chao
2022-11-23  8:19 ` Ricardo Ribalda
2022-11-23  8:56 ` Jackie Liu [this message]
2022-12-30 17:47 ` Laurent Pinchart
2023-01-07  0:11 ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ff604843-f4d6-df33-c7d0-c613014e4b53@linux.dev \
    --to=liu.yun@linux.dev \
    --cc=aichao@kylinos.cn \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox