summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/uvc/uvc_video.c
AgeCommit message (Collapse)Author
2009-04-18uvcvideo: fix uvc resume failedtom.leiming@gmail.com
From: Ming Lei <tom.leiming@gmail.com> Now urb buffers is not freed before suspend, so uvc_alloc_urb_buffers should return packet counts allocated originally during uvc resume, instead of zero. This version uses round down to return packet counts on Linus' suggestions, or else may lead to buffer destructed if packet size is changed before calling uvc_alloc_urb_buffers() in this kind of case. Priority: normal Signed-off-by: Ming Lei <tom.leiming@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be> --- linux/drivers/media/video/uvc/uvc_video.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
2009-02-16uvcvideo: Add quirk to override wrong bandwidth value for Vimicro devicesLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> At least 3 Vimicro cameras (0x332d, 0x3410 and 0x3420) fail to return correct bandwidth information. The first model rounds the value provided by the host to the nearest supported packet size, while the other two always request the maximum bandwidth. Introduce a device quirk to override the value returned by the device with an estimated bandwidth computed by the driver from the frame size and frame rate, and enable it for all Vimicro cameras. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2009-02-14uvcvideo: Ignore empty bulk URBsLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Devices may send a zero-length packet to signal the end of a bulk payload. If the payload size is a multiple of the URB size the zero-length packet will be received by the URB completion handler. Handle this by ignoring all empty URBs. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2009-02-14uvcvideo: Initialize streaming parameters with the probe control valueLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> The UVC specification requires SET_CUR requests on the streaming commit control to use values retrieved from a successful GET_CUR request on the probe control. Initialize streaming parameters with the probe control current value to make sure the driver always complies. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2009-01-18uvcvideo: Retry URB buffers allocation when the system is low on memory.Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> URB buffers for video transfers are sized to UVC_MAX_PACKETS bulk/isochronous packets by default. If the system is too low on memory try successively smaller numbers of packets until allocation succeeds. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Tested-by: Johannes Berg <johannes@sipsolutions.net>
2009-01-08merge: http://linuxtv.org/hg/~pinchartl/uvcvideoMauro Carvalho Chehab
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-07removed unused #include <version.h>'sMauro Carvalho Chehab
From: Huang Weiyi <weiyi.huang@gmail.com> Removed unused #include <version.h>'s in files below, drivers/media/video/cs5345.c drivers/media/video/pwc/pwc-if.c drivers/media/video/saa717x.c drivers/media/video/upd64031a.c drivers/media/video/upd64083.c drivers/media/video/uvc/uvc_ctrl.c drivers/media/video/uvc/uvc_driver.c drivers/media/video/uvc/uvc_queue.c drivers/media/video/uvc/uvc_video.c drivers/media/video/uvc/uvc_status.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-01-04uvcvideo: Fix GET_DEF failure detection.Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Commit 44f0079ec74330b457d990072c13cbe28b0f1abf erroneously considers all GET_DEF requests as unsuccessful. Fix this by checking the request return value. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2009-01-03uvcvideo: Whitespace and comments cleanup, copyright updates.Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-12-29uvcvideo: Add support for video output devicesLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Extend the range of supported UVC devices by allowing video output devices matching the following structure: TT_STREAMING -> VC_PROCESSING_UNIT -> VC_EXTENSION_UNIT{0,n} -> OTT_* Video output devices are reported with the V4L2_CAP_VIDEO_OUTPUT capability flag and are subject to the same restrictions as video input devices. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-12-16uvcvideo: Fix bulk URB processing when the header is erroneousLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> When the first bulk URB of a video payload contains an erroneous header, or when no V4L2 buffer is available, the whole payload must be dropped. Change the skip logic to drop all bulk URBs until the end of the payload instead of the first one only. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-12-06uvcvideo: Add nodrop module parameter to turn incomplete frame drop off.Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> The driver drops incomplete uncompressed video frames to avoid confusing userspace with corrupt data. Add a nodrop module parameter to turn that behaviour off and make all frames available to userspace. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-11-12uvcvideo: Commit streaming parameters when enabling the video stream.Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Sonix-based cameras seem to require the host to commit video streaming parameters before selecting the alternate endpoint. While most applications issue a VIDIOC_S_FMT ioctl before starting streaming, this is not required by the V4L2 specification. The problem has been noticed on Ubuntu 8.10 with applications using libv4l. The library blocks VIDIOC_S_FMT calls when the requested format is identical to the currently selected format. As the driver commits video streaming parameters when initialising the device, only the first run of a libv4l-enabled application would succeed. For the sake of completeness, experiment showed that the camera keeps sending 12 bytes isochronous packets (header only, no data) without toggling the FID bit if video streaming parameters haven't been committed before selecting the alternate endpoint. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-11-11uvcvideo: Use {get|set}_unaligned_le32 macrosLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Replace combination of endianess conversion and unaligned access macros with {get|set}_unaligned_*. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-11-11uvcvideo: Enable compilation on kernels older than 2.6.22Laurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> The uvcvideo driver makes use of the usb_endpoint_* functions as well as the list_first_entry and uninitialized_var macros. Add them to v4l/compat.h and update the driver with kernel version-based conditional compilation sections. Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-11-08uvcvideo: Handle failed video GET_{MIN|MAX|DEF} requests more gracefullyLaurent Pinchart
From: Laurent Pinchart <laurent.pinchart@skynet.be> Failed requests will now generate a one-time warning message instead of the usual "Failed to query..." error, which should be more user-friendly. The driver will also recover automatically from failed GET_MIN/GET_MAX requests when the device is half-broken without requiring the MINMAX quirk (fully broken devices still need the quirk). Priority: normal Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
2008-09-16uvcvideo: Fix incomplete frame drop when switching to a variable size format.Mauro Carvalho Chehab
From: Laurent Pinchart <laurent.pinchart@skynet.be> When streaming in a fixed size format the driver sets a flag in the uvc_queue structure to drop incomplete incoming frames. The flag wasn't cleared when switching to a variable size format, which resulted in a broken 'MJPEG after YUV'. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-08-29uvcvideo: Supress spurious "EOF in empty payload" trace messageMauro Carvalho Chehab
From: Laurent Pinchart <laurent.pinchart@skynet.be> Pass the payload size instead of the header size to uvc_video_decode_end() to avoid generating an extra trace message for each frame. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-08-20Use DIV_ROUND_UPMauro Carvalho Chehab
From: Julia Lawall <julia@diku.dk> The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) / (d)) but is perhaps more readable. An extract of the semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @haskernel@ @@ @depends on haskernel@ expression n,d; @@ ( - (n + d - 1) / d + DIV_ROUND_UP(n,d) | - (n + (d - 1)) / d + DIV_ROUND_UP(n,d) ) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP((n),d) + DIV_ROUND_UP(n,d) @depends on haskernel@ expression n,d; @@ - DIV_ROUND_UP(n,(d)) + DIV_ROUND_UP(n,d) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-31uvcvideo: don't use stack-based buffers for USB transfers.Mauro Carvalho Chehab
From: Laurent Pinchart <laurent.pinchart@skynet.be> Data buffers on the stack are not allowed for USB I/O. Use dynamically allocated buffers instead. Signed-off-by: Bruce Schmid <duck@freescale.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-04uvcvideo: Don't free URB buffers on suspend.Mauro Carvalho Chehab
From: Laurent Pinchart <laurent.pinchart@skynet.be> All submitted URBs must be killed at suspend time, but URB buffers don't have to be freed. Avoiding a free on suspend/reallocate on resume lowers the presure on system memory. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-07-04uvcvideo: Use GFP_NOIO when allocating memory during resumeMauro Carvalho Chehab
From: Laurent Pinchart <laurent.pinchart@skynet.be> The swap device might still be asleep, so memory allocated in the resume handler must use GFP_NOIO. Thanks to Oliver Neukum for catching and reporting this bug. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2008-06-30From: Laurent Pinchart <laurent.pinchart@skynet.be>Mauro Carvalho Chehab
USB Video Class driver This driver supports video input devices compliant with the USB Video Class specification. This means lots of currently manufactured webcams, and probably most of the future ones. Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be> Notice: Due to MAINTAINERS file that isn't at mercurial tree, I've committed it on my -git and backported to -hg. kernel-sync: Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>