summaryrefslogtreecommitdiffstats
path: root/include/media/videobuf-core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/videobuf-core.h')
-rw-r--r--include/media/videobuf-core.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h
index f91a736c133d..1d3835fc26be 100644
--- a/include/media/videobuf-core.h
+++ b/include/media/videobuf-core.h
@@ -54,8 +54,6 @@ struct videobuf_queue;
struct videobuf_mapping {
unsigned int count;
- unsigned long start;
- unsigned long end;
struct videobuf_queue *q;
};
@@ -127,7 +125,7 @@ struct videobuf_queue_ops {
struct videobuf_qtype_ops {
u32 magic;
- struct videobuf_buffer *(*alloc)(size_t size);
+ struct videobuf_buffer *(*alloc_vb)(size_t size);
void *(*vaddr) (struct videobuf_buffer *buf);
int (*iolock) (struct videobuf_queue *q,
struct videobuf_buffer *vb,
@@ -141,6 +139,7 @@ struct videobuf_qtype_ops {
struct videobuf_queue {
struct mutex vb_lock;
+ struct mutex *ext_lock;
spinlock_t *irqlock;
struct device *dev;
@@ -169,11 +168,24 @@ 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);
-struct videobuf_buffer *videobuf_alloc(struct videobuf_queue *q);
+struct videobuf_buffer *videobuf_alloc_vb(struct videobuf_queue *q);
/* Used on videobuf-dvb */
void *videobuf_queue_to_vaddr(struct videobuf_queue *q,
@@ -187,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);