]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/media/videobuf-core.h
Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[net-next-2.6.git] / include / media / videobuf-core.h
index f2c41cebf453a65abbe4fc281f20103287e5fea0..1d3835fc26be0d4a7e20408fb9b242f70f30a459 100644 (file)
@@ -139,6 +139,7 @@ struct videobuf_qtype_ops {
 
 struct videobuf_queue {
        struct mutex               vb_lock;
+       struct mutex               *ext_lock;
        spinlock_t                 *irqlock;
        struct device              *dev;
 
@@ -167,7 +168,20 @@ struct videobuf_queue {
        void                       *priv_data;
 };
 
-int videobuf_waiton(struct videobuf_buffer *vb, int non_blocking, int intr);
+static inline void videobuf_queue_lock(struct videobuf_queue *q)
+{
+       if (!q->ext_lock)
+               mutex_lock(&q->vb_lock);
+}
+
+static inline void videobuf_queue_unlock(struct videobuf_queue *q)
+{
+       if (!q->ext_lock)
+               mutex_unlock(&q->vb_lock);
+}
+
+int videobuf_waiton(struct videobuf_queue *q, struct videobuf_buffer *vb,
+               int non_blocking, int intr);
 int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
                struct v4l2_framebuffer *fbuf);
 
@@ -185,7 +199,8 @@ void videobuf_queue_core_init(struct videobuf_queue *q,
                         enum v4l2_field field,
                         unsigned int msize,
                         void *priv,
-                        struct videobuf_qtype_ops *int_ops);
+                        struct videobuf_qtype_ops *int_ops,
+                        struct mutex *ext_lock);
 int  videobuf_queue_is_busy(struct videobuf_queue *q);
 void videobuf_queue_cancel(struct videobuf_queue *q);