X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Fmedia%2Fvideobuf-core.h;h=1d3835fc26be0d4a7e20408fb9b242f70f30a459;hb=925d169f5b86fe57e2f5264ea574cce9a89b719d;hp=f2c41cebf453a65abbe4fc281f20103287e5fea0;hpb=a92b166e6b8c3c0037493690b2800b0b0dd92063;p=karo-tx-linux.git diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index f2c41cebf453..1d3835fc26be 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h @@ -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);