From 4d8582967a124a215baac71664035b0d6d4a346f Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 25 Nov 2008 22:26:38 +0100 Subject: uvcvideo: Prevent compat.h from being included in userspace code. From: Laurent Pinchart When used in userspace code, the uvcvideo.h header shouldn't pull compat.h. Make sure this won't happen by moving the #include to a __KERNEL__ protected section. Priority: normal Signed-off-by: Laurent Pinchart --- linux/drivers/media/video/uvc/uvcvideo.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index f95040380..09b169b69 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -4,8 +4,6 @@ #include #include -#include "compat.h" - /* * Dynamic controls */ @@ -69,6 +67,7 @@ struct uvc_xu_control { #ifdef __KERNEL__ #include +#include "compat.h" /* -------------------------------------------------------------------------- * UVC constants -- cgit v1.2.3 From 3ccc9245fe4ae35845a4d5ed89581bf56165ae78 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 6 Dec 2008 20:25:14 +0100 Subject: uvcvideo: Add nodrop module parameter to turn incomplete frame drop off. From: Laurent Pinchart 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 --- linux/drivers/media/video/uvc/uvcvideo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index 09b169b69..4533e34ef 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -683,6 +683,7 @@ struct uvc_driver { #define UVC_WARN_MINMAX 0 #define UVC_WARN_PROBE_DEF 1 +extern unsigned int uvc_no_drop_param; extern unsigned int uvc_trace_param; #define uvc_trace(flag, msg...) \ -- cgit v1.2.3 From ed31b2b95aaeb2d32f11053cc521b798b3280195 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 6 Dec 2008 21:43:40 +0100 Subject: uvcvideo: Add a device quirk to prune bogus controls. From: Laurent Pinchart Bogus controls currently include processing unit auto controls for which no corresponding manual control is available. Such auto controls make little sense if any, and are known to crash at least the SiGma Micro webcam. Priority: normal Signed-off-by: Laurent Pinchart --- linux/drivers/media/video/uvc/uvcvideo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index 4533e34ef..a699c0bb1 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -316,6 +316,7 @@ struct uvc_xu_control { #define UVC_QUIRK_BUILTIN_ISIGHT 0x00000008 #define UVC_QUIRK_STREAM_NO_FID 0x00000010 #define UVC_QUIRK_IGNORE_SELECTOR_UNIT 0x00000020 +#define UVC_QUIRK_PRUNE_CONTROLS 0x00000040 /* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001 -- cgit v1.2.3 From 7dee6796e962e12a9ee483b99bd808b2a3218c13 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 16 Dec 2008 10:46:32 +0100 Subject: uvcvideo: V4L2 zoom controls support From: Laurent Pinchart Add support for absolute and continuous zoom controls (mapped to absolute and relative UVC zoom controls). Priority: normal Signed-off-by: Laurent Pinchart --- linux/drivers/media/video/uvc/uvcvideo.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index a699c0bb1..549d09fd3 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -384,6 +384,11 @@ struct uvc_control_mapping { struct uvc_menu_info *menu_info; __u32 menu_count; + + __s32 (*get) (struct uvc_control_mapping *mapping, __u8 query, + const __u8 *data); + void (*set) (struct uvc_control_mapping *mapping, __s32 value, + __u8 *data); }; struct uvc_control { -- cgit v1.2.3 From 081fc36b5da81564c839d81f79dbe2e75b05c2b7 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 29 Dec 2008 02:32:29 +0100 Subject: uvcvideo: Add support for video output devices From: Laurent Pinchart 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 --- linux/drivers/media/video/uvc/uvcvideo.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index 549d09fd3..a045fa40d 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -529,6 +529,7 @@ struct uvc_streaming { __u16 maxpsize; struct uvc_streaming_header header; + enum v4l2_buf_type type; unsigned int nformats; struct uvc_format *format; @@ -564,12 +565,15 @@ struct uvc_buffer { #define UVC_QUEUE_DROP_INCOMPLETE (1 << 2) struct uvc_video_queue { + enum v4l2_buf_type type; + void *mem; unsigned int flags; __u32 sequence; unsigned int count; unsigned int buf_size; + unsigned int buf_used; struct uvc_buffer buffer[UVC_MAX_VIDEO_BUFFERS]; struct mutex mutex; /* protects buffers and mainqueue */ spinlock_t irqlock; /* protects irqqueue */ @@ -584,8 +588,9 @@ struct uvc_video_device { atomic_t active; unsigned int frozen : 1; - struct list_head iterms; - struct uvc_entity *oterm; + struct list_head iterms; /* Input terminals */ + struct uvc_entity *oterm; /* Output terminal */ + struct uvc_entity *sterm; /* USB streaming terminal */ struct uvc_entity *processing; struct uvc_entity *selector; struct list_head extensions; @@ -726,7 +731,8 @@ extern struct uvc_driver uvc_driver; extern void uvc_delete(struct kref *kref); /* Video buffers queue management. */ -extern void uvc_queue_init(struct uvc_video_queue *queue); +extern void uvc_queue_init(struct uvc_video_queue *queue, + enum v4l2_buf_type type); extern int uvc_alloc_buffers(struct uvc_video_queue *queue, unsigned int nbuffers, unsigned int buflength); extern int uvc_free_buffers(struct uvc_video_queue *queue); -- cgit v1.2.3 From c91fcc9b460397a85a6bd1d8f441d8da5abac415 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 30 Dec 2008 10:58:20 +0100 Subject: v4l2: introduce v4l2_file_operations. From: Hans Verkuil Introduce a struct v4l2_file_operations for v4l2 drivers. Remove the unnecessary inode argument. Move compat32 handling (and llseek) into the v4l2-dev core: this is now handled in the v4l2 core and no longer in the drivers themselves. Note that this changeset reverts an earlier patch that changed the return type of__video_ioctl2 from int to long. This change will be reinstated later in a much improved version. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/video/uvc/uvcvideo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/drivers/media/video/uvc/uvcvideo.h') diff --git a/linux/drivers/media/video/uvc/uvcvideo.h b/linux/drivers/media/video/uvc/uvcvideo.h index a045fa40d..7936d39c9 100644 --- a/linux/drivers/media/video/uvc/uvcvideo.h +++ b/linux/drivers/media/video/uvc/uvcvideo.h @@ -754,7 +754,7 @@ static inline int uvc_queue_streaming(struct uvc_video_queue *queue) } /* V4L2 interface */ -extern struct file_operations uvc_fops; +extern const struct v4l2_file_operations uvc_fops; /* Video */ extern int uvc_video_init(struct uvc_video_device *video); -- cgit v1.2.3