From 512f46cb92dd3faf12d28460bb03574ad6a867ab Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 6 Nov 2007 15:02:36 -0800 Subject: V4L: videobuf: don't chew up namespace STATE_.*, convert to VIDEOBUF_ s/STATE_NEEDS_INIT/VIDEOBUF_NEEDS_INIT/g s/STATE_PREPARED/VIDEOBUF_PREPARED/g s/STATE_QUEUED/VIDEOBUF_QUEUED/g s/STATE_ACTIVE/VIDEOBUF_ACTIVE/g s/STATE_DONE/VIDEOBUF_DONE/g s/STATE_ERROR/VIDEOBUF_ERROR/g s/STATE_IDLE/VIDEOBUF_IDLE/g Signed-off-by: Brandon Philips --- linux/include/media/videobuf-core.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h index 4359823c3..32ea6e8fb 100644 --- a/linux/include/media/videobuf-core.h +++ b/linux/include/media/videobuf-core.h @@ -56,13 +56,13 @@ struct videobuf_mapping { }; enum videobuf_state { - STATE_NEEDS_INIT = 0, - STATE_PREPARED = 1, - STATE_QUEUED = 2, - STATE_ACTIVE = 3, - STATE_DONE = 4, - STATE_ERROR = 5, - STATE_IDLE = 6, + VIDEOBUF_NEEDS_INIT = 0, + VIDEOBUF_PREPARED = 1, + VIDEOBUF_QUEUED = 2, + VIDEOBUF_ACTIVE = 3, + VIDEOBUF_DONE = 4, + VIDEOBUF_ERROR = 5, + VIDEOBUF_IDLE = 6, }; struct videobuf_buffer { -- cgit v1.2.3 From 09d082411ad4e8f87e4ee8431a920f1234ca2c8c Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 13 Nov 2007 15:05:38 -0800 Subject: V4L: videobuf-core locking fixes and comments - Add comments to functions that require that caller hold q->lock - Add __videobuf_mmap_free that doesn't hold q->lock for use within videobuf - Add locking to videobuf_mmap_free - Fix linux/drivers/media/common/saa7146_video.c which was holding lock around videobuf_read_stop - Add locking to functions that operate on a queue - Add videobuf_stop to take care of stopping in both the read and stream case TODO: bttv still has an unsafe call to videobuf_queue_is_busy Signed-off-by: Brandon Philips --- linux/include/media/videobuf-core.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h index 32ea6e8fb..7bc7d3cf0 100644 --- a/linux/include/media/videobuf-core.h +++ b/linux/include/media/videobuf-core.h @@ -212,6 +212,8 @@ int videobuf_cgmbuf(struct videobuf_queue *q, int videobuf_streamon(struct videobuf_queue *q); int videobuf_streamoff(struct videobuf_queue *q); +void videobuf_stop(struct videobuf_queue *q); + int videobuf_read_start(struct videobuf_queue *q); void videobuf_read_stop(struct videobuf_queue *q); ssize_t videobuf_read_stream(struct videobuf_queue *q, -- cgit v1.2.3 From 89a37f5497d1676d989c8c92da8866d5aaff5ee7 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Tue, 6 Nov 2007 15:23:08 -0800 Subject: V4L: videobuf: convert streaming and reading to bitfields Signed-off-by: Brandon Philips --- linux/include/media/videobuf-core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h index 7bc7d3cf0..dea9c53fe 100644 --- a/linux/include/media/videobuf-core.h +++ b/linux/include/media/videobuf-core.h @@ -166,12 +166,12 @@ struct videobuf_queue { struct videobuf_queue_ops *ops; struct videobuf_qtype_ops *int_ops; + unsigned int streaming:1; + unsigned int reading:1; /* capture via mmap() + ioctl(QBUF/DQBUF) */ - unsigned int streaming; struct list_head stream; /* capture via read() */ - unsigned int reading; unsigned int read_off; struct videobuf_buffer *read_buf; -- cgit v1.2.3