summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uvideo.c
AgeCommit message (Collapse)Author
2011-07-03Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingMatthew Dempsky
that's ever used it, and it's long since been changed to use DVACT_{QUIESCE,SUSPEND,RESUME} instead. ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it up a few weeks ago
2011-06-23Don't leak the ctrl_data in uvideo_queryctrl, uvideo_s_ctrl and uvideo_g_ctrl.Owain Ainsworth
If one of the usb calls we did here failed we'd return immediately and not free our buffer. ok miod@
2011-06-17M_WAITOK cleanup of two cases:Michael Knudsen
1) Allocating with M_WAITOK, checking for NULL, and calling panic() is pointless (malloc() will panic if it can't allocate) so remove the check and the call. 2) Allocating with M_WAITOK, checking for NULL, and then gracefully handling failure to allocate is pointless. Instead also pass M_CANFAIL so malloc() doesn't panic so we can actually handle it gracefully. 1) was done using Coccinelle. Input from oga. ok miod.
2011-04-11uncompressed video formats have a fixed per-pixel bit depth, whichJacob Meuser
means the data size of a frame can be calculated if the dimensions are known. * calculate frame data sizes for uncompressed formats instead of believing what the hardware says. the UVC spec changed between 1.0 and 1.1, and as a result, some devices return bogus information. * skip under-sized as well as over-sized uncompressed frames; there is only one correct size for uncompressed frames. * remove quirk to fix uncompressed frame sizes on certain devices, since that now always happens. * check that the device is actually using the parameters we think it's using.
2011-04-04the v4l2 spec says that setting time per frame to zero should reset timeJacob Meuser
per frame to the default, so do that instead of returning EINVAL
2011-03-31just report the frame interval in the same terms the device gives us.Jacob Meuser
previously, this was returning the wrong value (frame rate instead of time per frame, d'oh!).
2011-03-26oops. the frame rate is the inverse of the frame interval. fixesJacob Meuser
setting the frame rate with luvcview.
2011-03-26use 'sizeof(struct usb_video_frame_desc)' instead of a hardcodedJacob Meuser
number
2011-03-26fill in the timestamp when copying a frame into the mmap bufferJacob Meuser
2011-03-26fill in support for VIDIOC_ENUM_FRAMEINTERVALSJacob Meuser
2011-03-26support VIDIOC_S_PARM and VIDIOC_G_PARM. these ioctls are used forJacob Meuser
setting and and getting the frame interval.
2011-03-26print the supported frame intervals when printing the frame descriptorJacob Meuser
2011-03-25* don't try to align our array of frame descriptors with theJacob Meuser
frame descriptor's bFrameIndex field. the first valid frame in the array is at index 0, not 1. * don't change the format group's default frame when configuring the device, and don't use the default frame as the current frame: these are what the format group's 'frame_cur' is for. tested by several as part of larger diff
2011-03-25* the mjpeg and uncompressed video frame descriptor structures areJacob Meuser
equivilent. only define one structure, struct usb_video_frame_desc, and handle both types of frame descriptors in the same code. * replace hardcoded numbers with 'sizeof(struct usb_video_frame_desc)' where the numbers represent the size of a frame descriptor tested by several
2011-03-25* empty the queue of frames in the mmap frame buffer and set theJacob Meuser
index of the current frame to -1 when the mmap frame buffer is free'd * set the index of the current frame to 0 when allocating the mmap frame buffer * paranoia: panic if a) the mmap frame buffer is already allocated when we try to allocate it, or b) the mmap frame buffer is not allocated when we try to add frames to it tested by several
2011-01-25garbage collect "usb events". without /dev/usb there is no way to accessJacob Meuser
them from userland, and nothing in the kernel uses them. ok krw@, miod@
2011-01-16* instead of NULLing pointers to interface descriptors in the uaa, markJacob Meuser
interfaces as being claimed in the usbd_device's copy of the interface descriptors * allow ugen(4) to be attached if there are unused interfaces in a configuration that has had drivers attached * make ugen(4) aware that it may be sharing a device with (an)other driver(s), and if so: * do not let ugen(4) change the configuration * do not let ugen(4) access the already claimed interfaces discussed with deraadt and miod
2010-11-24- use *un*signed byte array for control dataJacob Meuser
- use UGETW/USETW instead of letoh16/htole16 fixes controls that use two-byte signed data (e.g. brighness and hue) on sparc64
2010-10-23create another kthread to run xfer abort tasks. xfer abort tasks cannotJacob Meuser
be run from the generic task kthread, because xfers that need to be aborted block newly queued tasks from running (i.e. the xfer to be aborted blocks the abort of that task). as there are now three types of usb tasks, add an argument to usb_init_task() and another member to struct usb_task to specify the task type. fixes boot hangs that are showing up because we now use usb tasks to attach/detach usb devices.
2010-10-18bFrameIntervalType affects frame rates, not frame sizesJacob Meuser
2010-10-18when configuring the streaming interface with the video probe andJacob Meuser
commit controls, use the hardware frame idenfitier instead of the software identifier since they can differ, and the hardware only knows about it's own identifiers
2010-10-18use setting with closest matching bandwidth for the current configurationJacob Meuser
instead of the first one that has enough bandwidth as it may be too much
2010-10-09* define structure that represents USB descriptor with variable sizedJacob Meuser
member the way uaudio does, make the variable sized member as large as it can be and don't define the following members. * reenable control support for devices where bControlSize != 2 in the processing unit descriptor. tested on alpha, amd64, i386, sparc64 and zaurus, as well as the machine where previous support for variable bControlSize caused a hang.
2010-10-09control values can be 1 or 2 bytes, signed or unsigned. fixes hueJacob Meuser
control.
2010-10-08don't trust that bFrameIndex in frame descriptors is unique. fixesJacob Meuser
a crash with Kodak S100 webcam.
2010-09-29back out support for variable sized processing unit controls untilJacob Meuser
I can figure out why it causes boot hangs with some Sonix camera
2010-09-26support variable sized (bControlSize != 2) processing unit bmControls,Jacob Meuser
and add support for more processing unit controls. from Martin Pieuchot, thanks!
2010-09-12anonymous unions aren't standard C and don't work with gcc2. name theJacob Meuser
anonymous unions "un". delete some obsolete mpeg/jpeg compression methods that have never been supported, and will not need to be supported.
2010-07-26Microsoft LifeCam needs the framesize quirk as well.Michael Knudsen
ok mglocker
2010-07-26Fix some spacing / comment.Marcus Glocker
2010-07-26Make one more Sonix chipset cam work with 640x480 by a) adding it to theMarcus Glocker
UVIDEO_FLAG_FIX_MAX_VIDEO_FRAME_SIZE quirk list and b) cranking the manually calculated frame size by pixels * 4 bytes (discussed with jakemsr@).
2010-07-15* Comment poll support in conf.hMarcus Glocker
* Comment why we call the video interrupt in the mmap interface now in uvideo.c
2010-07-14implement poll() for video(4)Jacob Meuser
ok mglocker
2010-04-27spacingMarco Peereboom
2009-11-24at close() get rid of the usb task before we start tearing down; ok mglockerTheo de Raadt
2009-10-26better test for if the parent is ohci; ok mglockerTheo de Raadt
2009-10-13Get rid of devact enum, substitute it with an int and coresponding defines.Paul Irofti
This is needed for the addition of further suspend/resume actions. Okay deraadt@, marco@.
2009-09-07sizeof ptr vs sizeof *ptr bug; ok mglocker@Miod Vallat
2009-06-28Better wording for the not-supported-video-control message.Marcus Glocker
Requested by and OK deraadt@
2009-04-18Fix tyop.Michael Knudsen
ok mglocker
2009-03-29Finally fix kernel crash (page fault) when closing bulk devices.Marcus Glocker
Help from kettenis@
2009-03-28Add quirk to support "Chen-Source CM12402 Eagle IR Cam" device, byMarcus Glocker
fixing wrong dwMaxVideoFrameSize value. As a side effect, broken devices which report dwMaxVideoFrameSize=0 today could be fixed as well. No regressions reported so far. Discussed with fgsch@. Diff from Kenji Aoyama
2009-03-25Revert 1.119 bulk crash workaround, because it breaks Logitech QuickCamMarcus Glocker
9000 devices. Add a XXX comment that we need to fix the bulk issue properly instead.
2009-02-270x3 is not really a good number for bit flags. Should fix the LogitechMarcus Glocker
QuickCam OEM attachment finally. OK deraadt@
2009-02-21Fix a kernel crash for bulk devices when closing the video stream;Marcus Glocker
We give the kthread loop a moment to recognize that bulk_running=0 before we close the USB pipes. Otherwise it can happen that we close the USB pipes before the kthread loop stopped.
2009-02-20Add Sony VGP-VCC9 Camera (Ricoh chipset) to the quirk list.Marcus Glocker
2009-02-20Add more Ricoh chipsets to the quirk list which could work.Marcus Glocker
2009-02-20Don't attach non-UISUBCLASS_VIDEOCONTROL interfaces from some quirkMarcus Glocker
devices. Problem reported by Jerome Pinot (QuickCam OEM). Also tested by deraadt@ with ricoh chipset.
2009-02-19the uaa structure (and things it points, for instance ifaces) is onlyTheo de Raadt
alive during match and attach. do not attempt to reuse this pointer or ifaces during a deferred attach routine, since it will contain junk, but instead make copies. tested on all 3 kinds of uvideo's (ricoh fw load, apple fw load, and the rest) ok robert mglocker
2009-02-06Fix kernel crash (page fault) for devices with unsorted frame index.Marcus Glocker
Problem reported by Kenji Aoyama