summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uvideo.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Move the softc definition to uvideo.c so that userland can includempi2015-07-091-1/+57
| | | | | | <dev/usb/uvideo.h> to get USB video descriptor definitions. from Ludovic Coues.
* Allow uvideo_mmap_queue() to fail gracefully when the mmap queue is full;miod2015-06-241-8/+16
| | | | | | | | | found the hard way by sebastia@ four years ago, and I'd been sitting on that diff since. The initial diff was more aggressive and would free the mmap queue upon error, but jakemsr@ had objections against this behaviour; this diff only fails gracefully instead of panic'ing.
* We do not support freeing memory using reqbufs with a zero size soarmani2015-01-061-3/+9
| | | | | | | | return EINVAL in this case. Also change an easily triggerable panic by a printf and return EINVAL. Reminded by brad@, one typo spotted by sthen@ and ok mpi@
* Nuke yet more obvious #include duplications.krw2014-11-181-2/+1
| | | | ok miod@
* Now that gcc2 is gone revert the removal of anonymous unions, means not having tobrad2014-10-231-11/+11
| | | | | | | modify various third party apps using the V4L2 API to build on OpenBSD specifically. "I think this is the right thing to do" miod@ "Fine with me." sthen@
* Add VIDIOC_G_INPUT ioctl, some ports need it (at least ffmpeg)armani2014-10-181-1/+12
| | | | ok ratchov@, sthen@, mpi@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-12/+12
| | | | after discussions with beck deraadt kettenis.
* add a missing argument to a printfjsg2014-01-221-2/+2
|
* Replace sc_dying in favour of usbd_is_dying() and usbd_deactivate().pirofti2013-11-071-5/+5
| | | | Tested and okay mpi@.
* Don't use usbd_bulk_transfer() to submit a synchronous transfer here too.mpi2013-04-261-6/+8
| | | | ok mglocker@
* Rename three functions in usbdi.c to their right prefix (usb_* to usbd_*).mglocker2013-04-261-27/+27
| | | | ok mpi@
* Get rid of various 'typedef struct' definitions and use plain structuremglocker2013-04-151-13/+13
| | | | | | | | | definitions instead. We don't change usb.h for now to stay compatible with userland. Tested by mpi@ on macppc and myself on i386. ok mpi@
* proc.h is way too much header for usb to handle.tedu2013-03-281-2/+1
|
* you probably don't need to include vnode.h or reboot.h. you most definitelytedu2013-03-281-5/+6
| | | | | absolutely do not need to include vnode.h because it includes uvm_extern.h and you want the idiotic TRUE FALSE defines from uvm.
* Do not try to get the description of an unexisting video format,mpi2012-06-181-2/+2
| | | | from Gregor Best.
* Fix bogus frame selection check in uvideo_vs_negotiation().mglocker2011-10-281-6/+6
| | | | From Pedro Martelletto
* usbdivar.h needs struct timeout. But don't get it indirectly viakrw2011-09-181-1/+2
| | | | | | | sys/kthread.h, use sys/timeout.h explicitly. Noted by Michael Knudsen. ok deraadt@ kettenis@ guenther@
* Remove config_activate() and DVACT_ACTIVATE. PCMCIA's the only thingmatthew2011-07-031-3/+1
| | | | | | | | 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
* Don't leak the ctrl_data in uvideo_queryctrl, uvideo_s_ctrl and uvideo_g_ctrl.oga2011-06-231-17/+29
| | | | | | | If one of the usb calls we did here failed we'd return immediately and not free our buffer. ok miod@
* M_WAITOK cleanup of two cases:mk2011-06-171-4/+4
| | | | | | | | | | | | | | | | 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.
* uncompressed video formats have a fixed per-pixel bit depth, whichjakemsr2011-04-111-64/+99
| | | | | | | | | | | | | | | 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.
* the v4l2 spec says that setting time per frame to zero should reset timejakemsr2011-04-041-8/+9
| | | | per frame to the default, so do that instead of returning EINVAL
* just report the frame interval in the same terms the device gives us.jakemsr2011-03-311-5/+3
| | | | | previously, this was returning the wrong value (frame rate instead of time per frame, d'oh!).
* oops. the frame rate is the inverse of the frame interval. fixesjakemsr2011-03-261-4/+7
| | | | setting the frame rate with luvcview.
* use 'sizeof(struct usb_video_frame_desc)' instead of a hardcodedjakemsr2011-03-261-2/+3
| | | | number
* fill in the timestamp when copying a frame into the mmap bufferjakemsr2011-03-261-1/+4
|
* fill in support for VIDIOC_ENUM_FRAMEINTERVALSjakemsr2011-03-261-6/+47
|
* support VIDIOC_S_PARM and VIDIOC_G_PARM. these ioctls are used forjakemsr2011-03-261-6/+114
| | | | setting and and getting the frame interval.
* print the supported frame intervals when printing the frame descriptorjakemsr2011-03-261-1/+33
|
* * don't try to align our array of frame descriptors with thejakemsr2011-03-251-23/+21
| | | | | | | | | | 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
* * the mjpeg and uncompressed video frame descriptor structures arejakemsr2011-03-251-107/+27
| | | | | | | | | 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
* * empty the queue of frames in the mmap frame buffer and set thejakemsr2011-03-251-2/+18
| | | | | | | | | | | 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
* garbage collect "usb events". without /dev/usb there is no way to accessjakemsr2011-01-251-5/+1
| | | | | | them from userland, and nothing in the kernel uses them. ok krw@, miod@
* * instead of NULLing pointers to interface descriptors in the uaa, markjakemsr2011-01-161-9/+19
| | | | | | | | | | | | | 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
* - use *un*signed byte array for control datajakemsr2010-11-241-17/+14
| | | | | | | - use UGETW/USETW instead of letoh16/htole16 fixes controls that use two-byte signed data (e.g. brighness and hue) on sparc64
* create another kthread to run xfer abort tasks. xfer abort tasks cannotjakemsr2010-10-231-2/+3
| | | | | | | | | | | 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.
* bFrameIntervalType affects frame rates, not frame sizesjakemsr2010-10-181-15/+6
|
* when configuring the streaming interface with the video probe andjakemsr2010-10-181-2/+2
| | | | | | 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
* use setting with closest matching bandwidth for the current configurationjakemsr2010-10-181-7/+14
| | | | instead of the first one that has enough bandwidth as it may be too much
* * define structure that represents USB descriptor with variable sizedjakemsr2010-10-091-12/+7
| | | | | | | | | | 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.
* control values can be 1 or 2 bytes, signed or unsigned. fixes huejakemsr2010-10-091-10/+123
| | | | control.
* don't trust that bFrameIndex in frame descriptors is unique. fixesjakemsr2010-10-081-17/+16
| | | | a crash with Kodak S100 webcam.
* back out support for variable sized processing unit controls untiljakemsr2010-09-291-3/+8
| | | | I can figure out why it causes boot hangs with some Sonix camera
* support variable sized (bControlSize != 2) processing unit bmControls,jakemsr2010-09-261-11/+20
| | | | | and add support for more processing unit controls. from Martin Pieuchot, thanks!
* anonymous unions aren't standard C and don't work with gcc2. name thejakemsr2010-09-121-7/+7
| | | | | | anonymous unions "un". delete some obsolete mpeg/jpeg compression methods that have never been supported, and will not need to be supported.
* Microsoft LifeCam needs the framesize quirk as well.mk2010-07-261-1/+8
| | | | ok mglocker
* Fix some spacing / comment.mglocker2010-07-261-6/+5
|
* Make one more Sonix chipset cam work with 640x480 by a) adding it to themglocker2010-07-261-3/+10
| | | | | | UVIDEO_FLAG_FIX_MAX_VIDEO_FRAME_SIZE quirk list and b) cranking the manually calculated frame size by pixels * 4 bytes (discussed with jakemsr@).
* * Comment poll support in conf.hmglocker2010-07-151-1/+6
| | | | | * Comment why we call the video interrupt in the mmap interface now in uvideo.c
* implement poll() for video(4)jakemsr2010-07-141-1/+2
| | | | ok mglocker