media: uvcvideo: Fix bandwidth issue for Alcor camera.
Subsystems (2)
PATCH v8 1/1 media: uvcvideo: Fix bandwidth issue for Alcor camera.
From: chenchangcheng <[email protected]>
Some broken device return wrong dwMaxPayloadTransferSize fields as follows:
[ 218.632537] [pid:20427,cpu6,guvcview,8]uvcvideo: Device requested 2752512 B/frame bandwidth.
[ 218.632598] [pid:20427,cpu6,guvcview,9]uvcvideo: No fast enough alt setting for requested bandwidth.When dwMaxPayloadTransferSize is greater than maxpsize, it will prevent the camera from starting.
So use the bandwidth of maxpsize.
--- drivers/media/usb/uvc/uvc_video.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_video.c +9 -0
@@ -262,6 +262,15 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, ctrl->dwMaxPayloadTransferSize = bandwidth; } + +if (stream->intf->num_altsetting >1 && + ctrl->dwMaxPayloadTransferSize > stream->maxpsize) { +dev_warn_ratelimited (&stream->intf->dev, +"the max payload transmission size (%d) exceededs the size of the ep max packet (%d). Using the max size.\n" , + ctrl->dwMaxPayloadTransferSize, + stream->maxpsize); + ctrl->dwMaxPayloadTransferSize = stream->maxpsize; + } }static size_t uvc_video_ctrl_size (struct uvc_streaming *stream)
base-commit: b4432656b36e5cc1d50a1f2dc15357543add530e
Signature · 1 line
2.25.1
Hi
Could you please resend ccing linux-media? Otherwise the patch wont be processed.
Regards!
Quoted 8 lines · chenchangcheng
From: chenchangcheng <[email protected]>
Some broken device return wrong dwMaxPayloadTransferSize fields as follows:
[ 218.632537] [pid:20427,cpu6,guvcview,8]uvcvideo: Device requested 2752512 B/frame bandwidth. [ 218.632598] [pid:20427,cpu6,guvcview,9]uvcvideo: No fast enough alt setting for requested bandwidth.
Quoted 7 lines
When dwMaxPayloadTransferSize is greater than maxpsize, it will prevent the camera from starting.
So use the bandwidth of maxpsize.Signed-off-by chenchangcheng <[email protected]>Reported-by kernel test robot <[email protected]>
There is no need to add the reported-by and closes:
The patch has not landed any tree yet.
Quoted 25 lines
--- drivers/media/usb/uvc/uvc_video.c | 9 +++++++++ 1 file changed, 9 insertions(+)drivers/media/usb/uvc/uvc_video.c +9
-0@@ -262,6 +262,15 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream, ctrl->dwMaxPayloadTransferSize = bandwidth; } + +if (stream->intf->num_altsetting >1 && + ctrl->dwMaxPayloadTransferSize > stream->maxpsize) { +dev_warn_ratelimited (&stream->intf->dev, +"the max payload transmission size (%d) exceededs the size of the ep max packet (%d). Using the max size.\n" , + ctrl->dwMaxPayloadTransferSize, + stream->maxpsize); + ctrl->dwMaxPayloadTransferSize = stream->maxpsize; + } }static size_t uvc_video_ctrl_size (struct uvc_streaming *stream)
Quoted 4 lines
base-commit:
b4432656b36e5cc1d50a1f2dc15357543add530e--
2.25.1
--
Ricardo Ribalda