aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-10-03 16:40:29 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:18:19 -0400
commit9bb7262de9c077ccccb129f47d128edb7af5f92e (patch)
tree92cf6f0683419383b079918b206242bca9d88afe /drivers
parent11fc5baf1dab2d30f03a391cabc5fd1808cfbe29 (diff)
[media] uvcvideo: Set bandwidth to at least 1024 with the FIX_BANDWIDTH quirk
The bandwidth estimate computed with the FIX_BANDIWDTH quirk is too low for many cameras. Don't use maximum packet sizes lower than 1024 bytes to try and work around the problem. According to measurements done on two different camera models, the value is high enough to get most resolutions working while not preventing two simultaneous VGA streams at 15 fps. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/video/uvc/uvc_video.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index ee5e2338b41..5a2022c0152 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -138,6 +138,15 @@ static void uvc_fixup_video_ctrl(struct uvc_streaming *stream,
138 bandwidth /= 8; 138 bandwidth /= 8;
139 bandwidth += 12; 139 bandwidth += 12;
140 140
141 /* The bandwidth estimate is too low for many cameras. Don't use
142 * maximum packet sizes lower than 1024 bytes to try and work
143 * around the problem. According to measurements done on two
144 * different camera models, the value is high enough to get most
145 * resolutions working while not preventing two simultaneous
146 * VGA streams at 15 fps.
147 */
148 bandwidth = max_t(u32, bandwidth, 1024);
149
141 ctrl->dwMaxPayloadTransferSize = bandwidth; 150 ctrl->dwMaxPayloadTransferSize = bandwidth;
142 } 151 }
143} 152}