From b80e1074c734416987486b7b76b6479faa73f1e2 Mon Sep 17 00:00:00 2001 From: Andy Walls Date: Fri, 28 Nov 2008 00:04:21 -0300 Subject: 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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx18/cx18-queue.h | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'drivers/media/video/cx18/cx18-queue.h') diff --git a/drivers/media/video/cx18/cx18-queue.h b/drivers/media/video/cx18/cx18-queue.h index ff50a2b7e5bc..d184e55ce624 100644 --- a/drivers/media/video/cx18/cx18-queue.h +++ b/drivers/media/video/cx18/cx18-queue.h @@ -43,9 +43,24 @@ static inline void cx18_buf_sync_for_device(struct cx18_stream *s, void cx18_buf_swap(struct cx18_buffer *buf); /* cx18_queue utility functions */ -void cx18_queue_init(struct cx18_queue *q); +void _cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, + struct cx18_queue *q, int to_front); + +static inline void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, - struct cx18_queue *q); + struct cx18_queue *q) +{ + _cx18_enqueue(s, buf, q, 0); /* FIFO */ +} + +static inline +void cx18_push(struct cx18_stream *s, struct cx18_buffer *buf, + struct cx18_queue *q) +{ + _cx18_enqueue(s, buf, q, 1); /* LIFO */ +} + +void cx18_queue_init(struct cx18_queue *q); struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q); struct cx18_buffer *cx18_queue_get_buf(struct cx18_stream *s, u32 id, u32 bytesused); -- cgit v1.2.3