summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc/uvcvideo.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-02-06 11:27:48 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2018-02-06 11:27:48 -0800
commit68c5735eaa5e680e701c9a2d1e3c7880bdf5ab66 (patch)
tree4f584693638bf257b66a1646cc30d823cacc0a58 /drivers/media/usb/uvc/uvcvideo.h
parent2246edfaf88dc368e8671b04afd54412625df60a (diff)
parent273caa260035c03d89ad63d72d8cd3d9e5c5e3f1 (diff)
Merge tag 'media/v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media
Pull media updates from Mauro Carvalho Chehab: - videobuf2 was moved to a media/common dir, as it is now used by the DVB subsystem too - Digital TV core memory mapped support interface - new sensor driver: ov7740 - several improvements at ddbridge driver - new V4L2 driver: IPU3 CIO2 CSI-2 receiver unit, found on some Intel SoCs - new tuner driver: tda18250 - finally got rid of all LIRC staging drivers - as we don't have old lirc drivers anymore, restruct the lirc device code - add support for UVC metadata - add a new staging driver for NVIDIA Tegra Video Decoder Engine - DVB kAPI headers moved to include/media - synchronize the kAPI and uAPI for the DVB subsystem, removing the gap for non-legacy APIs - reduce the kAPI gap for V4L2 - lots of other driver enhancements, cleanups, etc. * tag 'media/v4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (407 commits) media: v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs media: v4l2-compat-ioctl32.c: refactor compat ioctl32 logic media: v4l2-compat-ioctl32.c: don't copy back the result for certain errors media: v4l2-compat-ioctl32.c: drop pr_info for unknown buffer type media: v4l2-compat-ioctl32.c: copy clip list in put_v4l2_window32 media: v4l2-compat-ioctl32.c: fix ctrl_is_pointer media: v4l2-compat-ioctl32.c: copy m.userptr in put_v4l2_plane32 media: v4l2-compat-ioctl32.c: avoid sizeof(type) media: v4l2-compat-ioctl32.c: move 'helper' functions to __get/put_v4l2_format32 media: v4l2-compat-ioctl32.c: fix the indentation media: v4l2-compat-ioctl32.c: add missing VIDIOC_PREPARE_BUF media: v4l2-ioctl.c: don't copy back the result for -ENOTTY media: v4l2-ioctl.c: use check_fmt for enum/g/s/try_fmt media: vivid: fix module load error when enabling fb and no_error_inj=1 media: dvb_demux: improve debug messages media: dvb_demux: Better handle discontinuity errors media: cxusb, dib0700: ignore XC2028_I2C_FLUSH media: ts2020: avoid integer overflows on 32 bit machines media: i2c: ov7740: use gpio/consumer.h instead of gpio.h media: entity: Add a nop variant of media_entity_cleanup ...
Diffstat (limited to 'drivers/media/usb/uvc/uvcvideo.h')
-rw-r--r--drivers/media/usb/uvc/uvcvideo.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 9b44a7cd5ec1..d9e7c70788d0 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -154,6 +154,11 @@
{ 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \
0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f}
+#define UVC_GUID_FORMAT_D3DFMT_L8 \
+ {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \
+ 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+
+
/* ------------------------------------------------------------------------
* Driver specific constants.
*/
@@ -452,8 +457,8 @@ struct uvc_stats_frame {
};
struct uvc_stats_stream {
- struct timespec start_ts; /* Stream start timestamp */
- struct timespec stop_ts; /* Stream stop timestamp */
+ ktime_t start_ts; /* Stream start timestamp */
+ ktime_t stop_ts; /* Stream stop timestamp */
unsigned int nb_frames; /* Number of frames */
@@ -474,6 +479,8 @@ struct uvc_stats_stream {
unsigned int max_sof; /* Maximum STC.SOF value */
};
+#define UVC_METATADA_BUF_SIZE 1024
+
struct uvc_streaming {
struct list_head list;
struct uvc_device *dev;
@@ -505,7 +512,13 @@ struct uvc_streaming {
unsigned int frozen : 1;
struct uvc_video_queue queue;
void (*decode) (struct urb *urb, struct uvc_streaming *video,
- struct uvc_buffer *buf);
+ struct uvc_buffer *buf, struct uvc_buffer *meta_buf);
+
+ struct {
+ struct video_device vdev;
+ struct uvc_video_queue queue;
+ __u32 format;
+ } meta;
/* Context data used by the bulk completion handler. */
struct {
@@ -536,8 +549,8 @@ struct uvc_streaming {
struct uvc_clock_sample {
u32 dev_stc;
u16 dev_sof;
- struct timespec host_ts;
u16 host_sof;
+ ktime_t host_time;
} *samples;
unsigned int head;
@@ -547,6 +560,8 @@ struct uvc_streaming {
u16 last_sof;
u16 sof_offset;
+ u8 last_scr[6];
+
spinlock_t lock;
} clock;
};
@@ -556,6 +571,7 @@ struct uvc_device {
struct usb_interface *intf;
unsigned long warnings;
__u32 quirks;
+ __u32 meta_format;
int intfnum;
char name[32];
@@ -710,6 +726,15 @@ extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit,
void uvc_video_clock_update(struct uvc_streaming *stream,
struct vb2_v4l2_buffer *vbuf,
struct uvc_buffer *buf);
+int uvc_meta_register(struct uvc_streaming *stream);
+
+int uvc_register_video_device(struct uvc_device *dev,
+ struct uvc_streaming *stream,
+ struct video_device *vdev,
+ struct uvc_video_queue *queue,
+ enum v4l2_buf_type type,
+ const struct v4l2_file_operations *fops,
+ const struct v4l2_ioctl_ops *ioctl_ops);
/* Status */
extern int uvc_status_init(struct uvc_device *dev);
@@ -764,7 +789,7 @@ extern struct usb_host_endpoint *uvc_find_endpoint(
/* Quirks support */
void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
- struct uvc_buffer *buf);
+ struct uvc_buffer *buf, struct uvc_buffer *meta_buf);
/* debugfs and statistics */
void uvc_debugfs_init(void);