aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-queue.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-11-27 22:04:21 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:28 -0500
commitb80e1074c734416987486b7b76b6479faa73f1e2 (patch)
tree4f1432c4755b9aa686dd8764a24e404eaa3a550e /drivers/media/video/cx18/cx18-queue.c
parentbe2c6db122467c6b6b55d93dd08d89cb2ee7821c (diff)
V4L/DVB (9800): cx18: Eliminate q_io from stream buffer handling
Eliminate q_io from stream buffer handling in anticipation of upcoming changes in buffer handling. q_io was a holdover from ivtv and it's function in cx18 was trivial and not necessary. We just push things back onto the front of q_full now, instead of maintaining a 1 buffer q_io queue. Signed-off-by: Andy Walls <awalls@radix.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-queue.c')
-rw-r--r--drivers/media/video/cx18/cx18-queue.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c
index 7b09c9a3ee8f..fdfc83ee3d4e 100644
--- a/drivers/media/video/cx18/cx18-queue.c
+++ b/drivers/media/video/cx18/cx18-queue.c
@@ -42,8 +42,8 @@ void cx18_queue_init(struct cx18_queue *q)
42 q->bytesused = 0; 42 q->bytesused = 0;
43} 43}
44 44
45void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, 45void _cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
46 struct cx18_queue *q) 46 struct cx18_queue *q, int to_front)
47{ 47{
48 /* clear the buffer if it is going to be enqueued to the free queue */ 48 /* clear the buffer if it is going to be enqueued to the free queue */
49 if (q == &s->q_free) { 49 if (q == &s->q_free) {
@@ -53,7 +53,10 @@ void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
53 buf->skipped = 0; 53 buf->skipped = 0;
54 } 54 }
55 mutex_lock(&s->qlock); 55 mutex_lock(&s->qlock);
56 list_add_tail(&buf->list, &q->list); 56 if (to_front)
57 list_add(&buf->list, &q->list); /* LIFO */
58 else
59 list_add_tail(&buf->list, &q->list); /* FIFO */
57 atomic_inc(&q->buffers); 60 atomic_inc(&q->buffers);
58 q->bytesused += buf->bytesused - buf->readpos; 61 q->bytesused += buf->bytesused - buf->readpos;
59 mutex_unlock(&s->qlock); 62 mutex_unlock(&s->qlock);
@@ -159,7 +162,6 @@ static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q)
159 162
160void cx18_flush_queues(struct cx18_stream *s) 163void cx18_flush_queues(struct cx18_stream *s)
161{ 164{
162 cx18_queue_flush(s, &s->q_io);
163 cx18_queue_flush(s, &s->q_full); 165 cx18_queue_flush(s, &s->q_full);
164} 166}
165 167