summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uvideo.c
AgeCommit message (Collapse)Author
2008-08-24Get VIDIOC_G_FMT working (makes ekiga happy).Marcus Glocker
2008-08-24Use consistent variable names; curr -> cur, err -> error.Marcus Glocker
2008-08-24Add support for processing unit (e.g. brightness) controls. New V4L2Marcus Glocker
ioctls therefore are VIDIOC_QUERYCTRL, VIDIOC_G_CTRL, and VIDIOC_S_CTRL.
2008-08-16If dwMaxPayloadTransferSize doesn't exactly match to an existingMarcus Glocker
endpoint, pick the next higher endpoint bandwidth.
2008-08-13Add VIDIOC_ENUM_FRAMESIZES ioctl. This permits applications to query theMarcus Glocker
available formats and resolutions of a device (e.g. "luvcview -L").
2008-08-12Don't process xfers which have the stream error bit set in the streamMarcus Glocker
header.
2008-08-11Since we have ehci(4) isoc support now, don't demote USB2 uvideo(4)Marcus Glocker
devices to USB1, instead let them attach to ehci(4). This may break a couple of the devices for the moment, but it's the way we have to go finally.
2008-08-10Prepare for ehci:Marcus Glocker
- Remove GET_DEF request for negotation. It doesn't help, instead keep breaking devices. - On device close first switch back to default interface 0 before abort/close the isoc pipe. This fixes IOERRORs on device re-open.
2008-08-09Revert last commit, it doesn't always help, we need to find anotherMarcus Glocker
solution.
2008-08-09Prepare for ehci: If GET_DEF request has failed, wait a moment beforeMarcus Glocker
issuing GET_CUR. Makes my NX6000 attach on ehci.
2008-08-02Use correct terms as in the specs;Marcus Glocker
"fragment" gets replaced by "sample". "sample" gets replaced by "frame". A sample is a peace of a frame (final image). No functional changes. OK deraadt@
2008-08-02Better wording for a comment.Marcus Glocker
2008-08-02Spacing, sorting, and remove an unused prototype.Marcus Glocker
2008-08-02Woops, remove #undef which was committed by mistake.Marcus Glocker
2008-08-02Don't print error message if GET_DEF request fails, since this is commonMarcus Glocker
for some devices and we will fail back to GET_CUR then.
2008-08-02If a format descriptor doesn't contain any frame descriptors even if itMarcus Glocker
claims to (as seen on the M$ LifeCam NX6000), abort further processing. Safes us from potential NULL pointer derefs.
2008-08-02Fix typo. Reported by Maxim Belooussov.Marcus Glocker
2008-08-01- Use defined return values wherever possible instead inventingMarcus Glocker
custom ones. - Define functions which use USB return values with usbd_status instead int. - Define functions which always return 0 with void instead int. - (void) function calls which don't check the return code.
2008-08-01If no format descriptors have been found, abort attachment. Adjust someMarcus Glocker
DPRINTF and printf messages while here.
2008-07-31- Don't relay on bFormatIndex as an internal array index, since thisMarcus Glocker
field is unreliable and can start with any number. Use an own internal array index instead. - If the read buffer is too small, return a propper error to the calling functions. Just check the buffer size if we use the read(2) method since it doesn't affect mmap(2). Fixes kernel crashes seen with the M$ LifeCam NX-6000 and internal (laptop) Sonix chipsets. Tested by jcs@ (Sonix) and myself (NX-6000). OK deraadt@
2008-07-29The stream header length and flags field are uint8_t not int.Marcus Glocker
2008-07-26Since we are able to change the device image resolution on the fly in theMarcus Glocker
meantime, the memory allocation for the read(2) method for video(4) is not right anymore, and can cause a buffer overflow. We fix this by queuering the maximum available image size for a device at attach time. If the image size should exceed our video(4) buffer after a video format change (which shouldn't happen), uvideo(4) will gracefully fail. Also tested by kettenis@
2008-07-25After our recent changes, VIDIOC_S_FMT didn't always return the correctMarcus Glocker
maximum image size. Fix it. Makes read(2) method work again.
2008-07-25Not all devices support GET_DEF, fall back on GET_CUR if so.Marcus Glocker
Reported and tested kettenis@
2008-07-24Simplify uvideo_enum_fmt(), no functional changes.Marcus Glocker
2008-07-23- Fix potential uvm_fault crash inMarcus Glocker
uvideo_vs_parse_desc_frame_uncompressed(). - If a VS alternate interface isn't valid (e.g. doesn't contain a UE_ISOCHRONOUS endpoint), abort attachment with a corresponding error message instead crashing the kernel. Tested and OK maja@
2008-07-22There are devices out there which are UVC compatible, but do not showMarcus Glocker
up as this (we love standards). To make those devices attach anyway we add an explicit quirk device list. Of course this list still needs to be extended. Thanks to Jerome Pinot for reporting about this issue and testing this diff with his cam, which is such a device. OK yuo@
2008-07-22Spelling, negotation -> negotiation.Marcus Glocker
2008-07-22Fix uvm_fault crash in uvideo_vs_negotation() which was reported by someMarcus Glocker
users. Thanks to mpf@ for his help to debug this bug down.
2008-07-19If a resolution which has been requested over VIDEO_TRY_FMT orMarcus Glocker
VIDEO_S_FMT doesn't exactly match the devices available resolutions, return the next best matching resolution which we have. Makes some V4L2 apps happy when running them with the default resolution (no options).
2008-07-18For negotation first get the devices default values (GET_DEF) insteadMarcus Glocker
asking for (GET_CUR) directly. This gets us better negotation values.
2008-07-18Implement VIDIOC_S_FMT and VIDIOC_TRY_FMT. Now V4L2 applications canMarcus Glocker
set their desired image size, and therefore users can manipulate the image size, too via the application. Also tested by brad@
2008-07-14Make VIDIOC_ENUM_FMT list all available formats for the attached device.Marcus Glocker
2008-07-14Finish support for uncompressed payloads (UDESCSUB_VS_FORMAT_UNCOMPRESSED).Marcus Glocker
2008-07-13Spacing.Marcus Glocker
2008-07-13Save format and frame descriptors to a format group structure so weMarcus Glocker
can use them later for stuff like VIDIOC_S_FMT (e.g. set custom resolution).
2008-07-10Make cams with Sonix chipset work by avoiding excessive alternateMarcus Glocker
interface switching, which kind of crashed the device.
2008-07-07- Improve negotation and fix some more DPRINTFs.Marcus Glocker
2008-07-06When the device gets close switch back from alternate interface toMarcus Glocker
default interface. Nice side effect; Turns off the cams LED again.
2008-07-03Add struct for VC_EXTENSION_UNIT and dump it in debug mode.Marcus Glocker
2008-07-02Add first bits to support uncompressed format.Marcus Glocker
2008-07-01Spacing.Marcus Glocker
2008-06-30- Free mmap buffer on close/detach.Marcus Glocker
- Fix DPRINTF while here.
2008-06-26Make video stream work properly on uhci and ohci by adding an ohciMarcus Glocker
isoc xfer workaround. Improved and OK deraadt@
2008-06-23Don't bzero() the USB buffer before every xfer. This was just for debugMarcus Glocker
purposes.
2008-06-22If no frame gets queue for a certain time, return EINVAL to the userlandMarcus Glocker
application which will cause it to exit instead let it stuck forever.
2008-06-15One more printf -> DPRINTF in the USB xfer callback.Marcus Glocker
2008-06-15Make frame queueing reliable by setting tsleep() priorities to 0.Marcus Glocker
2008-06-15Move noisy frame queueing debug messages up to debug level 2.Marcus Glocker
2008-06-15if we are trying to attach to ehci(4) notify the user to disable itRobert Nagy
because it does not support isochronous transfers yet. we hope that we can remove this as soon as possible. discussed with deraadt@