summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvcvideo.h
AgeCommit message (Collapse)Author
2016-11-23[media] uvcvideo: Add bayer 16-bit format patternsEdgar Thier
Those formats are implemented by The DFK 23UP1300, DFK 23UX249 and DFK 23UX250 USB 3.0 industrial cameras from The Imaging Source. Signed-off-by: Edgar Thier <info@edgarthier.net> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-03-03[media] UVC: Add support for R200 depth cameraAviv Greenberg
Add support for Intel R200 depth camera in uvc driver. This includes adding new uvc GUIDs for the new pixel formats, adding new V4L pixel format definition to user api headers, and updating the uvc driver GUID-to-4cc tables with the new formats. Tested-by: Greenberg, Aviv D <aviv.d.greenberg@intel.com> Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-12Revert "[media] UVC: Add support for ds4 depth camera"Mauro Carvalho Chehab
This reverts commit 120c41d3477a23c6941059401db63677736f1935. The patch doesn't add the corresponding documentation bits to the media infrastructure uAPI DocBook. Also, they're for 3D formats, with requre further discussions. Requested-by: Hans Verkuil <hverkuil@xs4all.nl> Requested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2015-12-03[media] UVC: Add support for ds4 depth cameraAviv Greenberg
Add support for Intel DS4 depth camera in uvc driver. This includes adding new uvc GUIDs for the new pixel formats, adding new V4L pixel format definition to user api headers, and updating the uvc driver GUID-to-4cc tables with the new formats. Change-Id: If240d95a7d4edc8dcc3e02d58cd8267a6bbf6fcb Tested-by: Greenberg, Aviv D <aviv.d.greenberg@intel.com> Signed-off-by: Aviv Greenberg <aviv.d.greenberg@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01[media] media: videobuf2: Restructure vb2_bufferJunghak Sung
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer. Add new member variables - bytesused, length, offset, userptr, fd, data_offset - to struct vb2_plane in order to cover all information of v4l2_plane. struct vb2_plane { <snip> unsigned int bytesused; unsigned int length; union { unsigned int offset; unsigned long userptr; int fd; } m; unsigned int data_offset; } Replace v4l2_buf with new member variables - index, type, memory - which are common fields for buffer management. struct vb2_buffer { <snip> unsigned int index; unsigned int type; unsigned int memory; unsigned int num_planes; struct vb2_plane planes[VIDEO_MAX_PLANES]; <snip> }; v4l2 specific fields - flags, field, timestamp, timecode, sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c struct vb2_v4l2_buffer { struct vb2_buffer vb2_buf; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; }; Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01[media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2Junghak Sung
Make videobuf2-v4l2 as a wrapper of videobuf2-core for v4l2-use. And replace videobuf2-core.h with videobuf2-v4l2.h. This renaming change should be accompanied by the modifications of all device drivers that include videobuf2-core.h. It can be done with just running this shell script. replace() { str1=$1 str2=$2 dir=$3 for file in $(find $dir -name *.h -o -name *.c -o -name Makefile) do echo $file sed "s/$str1/$str2/g" $file > $file.out mv $file.out $file done } replace "videobuf2-core" "videobuf2-v4l2" "include/media/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/media/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/usb/gadget/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/staging/media/" Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-09-25[media] uvcvideo: Disable hardware timestamps by defaultLaurent Pinchart
The hardware timestamping implementation has been reported as not working correctly on at least the Logitech C920. Until this can be fixed, disable it by default. Reported-by: Peter Rabbitson <rabbit@rabbit.us> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-30[media] uvcvideo: Remove unneeded device disconnected flagLaurent Pinchart
The UVC_DEV_DISCONNECTED flag is set when the USB device is disconnected, and checked in the open() handler to refuse opening a device that has been disconnected. This is inherently racy, but the race condition is taken care of in the V4L2 core, which also fails open() calls when the V4L2 device node has been unregistered. As the uvcvideo USB disconnect handler unregisters all its video device nodes, the UVC_DEV_DISCONNECTED flag doesn't serve any purpose anymore and can be removed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-05-30[media] uvcvideo: Implement DMABUF exporter roleLaurent Pinchart
Now that videobuf2-vmalloc supports exporting buffers, add support for the DMABUF exporter role by plugging in the videobuf2 ioctl helper. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-08[media] uvc: embed video_deviceHans Verkuil
Embed the video_device struct to simplify the error handling and in order to (eventually) get rid of video_device_alloc/release. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-12-23[media] uvcvideo: Add GUID for BGR 8:8:8William Manley
The Magewell XI100DUSB-HDMI[1] video capture device reports the pixel format "e436eb7d-524f-11ce-9f53-0020af0ba770". This is its GUID for BGR 8:8:8. The UVC 1.5 spec[2] only defines GUIDs for YUY2, NV12, M420 and I420. This seems to be an extension documented in the Microsoft Windows Media Format SDK[3] - or at least the Media Format SDK was the only hit that Google gave when searching for the GUID. This Media Format SDK defines this GUID as corresponding to `MEDIASUBTYPE_RGB24`. Note though, the XI100DUSB outputs BGR e.g. byte-reversed. I don't know if its the capture device in error or Microsoft mean BGR when they say RGB. [1]: http://www.magewell.com/hardware/dongles/xi100dusb-hdmi/xi100dusb-hdmi_features.html?lang=en [2]: http://www.usb.org/developers/docs/devclass_docs/USB_Video_Class_1_5.zip [3]: http://msdn.microsoft.com/en-gb/library/windows/desktop/dd757532(v=vs.85).aspx Signed-off-by: William Manley <will@williammanley.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] uvcvideo: Rename and split uvc_queue_enable to uvc_queue_stream(on|off)Laurent Pinchart
This brings the function name in line with the V4L2 API terminology and allows removing the duplicate queue type check. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] uvcvideo: Rename uvc_alloc_buffers to uvc_request_buffersLaurent Pinchart
This brings the function name in line with the V4L2 API terminology. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] uvcvideo: Don't stop the stream twice at file handle releaseLaurent Pinchart
When releasing the file handle the driver calls the vb2_queue_release which turns the stream off. There's thus no need to turn the stream off explicitly beforehand. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] uvcvideo: Move to video_ioctl2Laurent Pinchart
Simplify ioctl handling by using video_ioctl2. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-11-25[media] uvcvideo: Add quirk to force the Oculus DK2 IR tracker to grayscalePhilipp Zabel
This patch adds a quirk to force Y8 pixel format even if the camera reports half-width YUYV. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-10-21[media] v4l: uvcvideo: Fix buffer completion size checkLaurent Pinchart
Commit e93e7fd9f5a3fffec7792dbcc4c3574653effda7 ("v4l2: uvcvideo: Allow using larger buffers") reworked the buffer size sanity check at buffer completion time to use the frame size instead of the allocated buffer size. However, it introduced two bugs in doing so: - it assigned the allocated buffer size to the frame_size field, instead of assigning the correct frame size - it performed the assignment in the S_FMT handler, resulting in the frame_size field being uninitialized if the userspace application doesn't call S_FMT. Fix both issues by removing the frame_size field and validating the buffer size against the UVC video control dwMaxFrameSize. Fixes: e93e7fd9f5a3 ("v4l2: uvcvideo: Allow using larger buffers") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] v4l2: uvcvideo: Allow using larger buffersGuennadi Liakhovetski
A test in uvc_video_decode_isoc() checks whether an image has been received from the camera completely. For this the data amount is compared to the buffer length, which, however, doesn't have to be equal to the image size. Switch to using formats .sizeimage field for an exact expected image size. [Renamed image_size to frame_size] Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-09-21[media] uvcvideo: Work around buggy Logitech C920 firmwareWilliam Manley
The uvcvideo webcam driver exposes the v4l2 control "Exposure (Absolute)" which allows the user to control the exposure time of the webcam, essentially controlling the brightness of the received image. By default the webcam automatically adjusts the exposure time automatically but the if you set the control "Exposure, Auto"="Manual Mode" the user can fix the exposure time. Unfortunately it seems that the Logitech C920 has a firmware bug where it will forget that it's in manual mode temporarily during initialisation. This means that the camera doesn't respect the exposure time that the user requested if they request it before starting to stream video. They end up with a video stream which is either too bright or too dark and must reset the controls after video starts streaming. This patch introduces the quirk UVC_QUIRK_RESTORE_CTRLS_ON_INIT which causes the cached controls to be re-uploaded to the camera immediately after initialising the camera. This quirk is applied to the C920 to work around this camera bug. Signed-off-by: William Manley <will@williammanley.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2014-03-05[media] uvcvideo: Add bayer 8-bit patterns to uvcvideoEdgar Thier
Add bayer 8-bit GUIDs to uvcvideo and associated them with the corresponding V4L2 pixel formats. Signed-off-by: Edgar Thier <info@edgarthier.net> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-28[media] uvcvideo: Enable VIDIOC_CREATE_BUFSPhilipp Zabel
This patch enables the ioctl to create additional buffers on the videobuf2 capture queue. [laurent.pinchart@ideasonboard.com: Acquire privileges instead of just checking them in VIDIOC_CREATE_BUFS implementation] Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-02-28[media] uvcvideo: Remove duplicate check for number of buffers in queue_setupLaurent Pinchart
videobuf2 already ensures that the number of buffers will not exceed VIDEO_MAX_FRAME, which is equal to our arbitraty limit of UVC_MAX_VIDEO_BUFFERS. Remove the duplicate check. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-06-08[media] uvcvideo: Fix open/close race conditionLaurent Pinchart
Maintaining the users count using an atomic variable makes sure that access to the counter won't be racy, but doesn't serialize access to the operations protected by the counter. This creates a race condition that could result in the status URB being submitted multiple times. Use a mutex to protect the users count and serialize access to the status start and stop operations. Reported-by: Shawn Nematbakhsh <shawnn@chromium.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-28[media] uvcvideo: Mark first output terminal as default video nodeLaurent Pinchart
The MEDIA_ENT_FL_DEFAULT identifies entities that are considered as default for their group and type. For video nodes, it identifies the node that application should use by default. UVC devices don't report which output terminal should be considered as the default, use the first one. Most devices have a single output terminal anyway. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-28[media] uvcvideo: Add VIDIOC_[GS]_PRIORITY supportLaurent Pinchart
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-28[media] uvcvideo: Set device_caps in VIDIOC_QUERYCAPLaurent Pinchart
Set the capabilities field to global capabilities, and the device_caps field to the video node capabilities. This issue was found by the v4l2-compliance tool. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-11-28[media] uvcvideo: Don't fail when an unsupported format is requestedLaurent Pinchart
Return the default format in that case. This issue was found by the v4l2-compliance tool. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-10-06[media] uvc: Add return code check at vb2_queue_init()Ezequiel Garcia
This function returns an integer and it's mandatory to check the return code. Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-08-15[media] rename most media/video usb drivers to media/usbMauro Carvalho Chehab
Rename all USB drivers with their own directory under drivers/media/video into drivers/media/usb and update the building system. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>