aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-fileops.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-12-08 21:02:45 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-30 06:38:29 -0500
commit66c2a6b0bc0b394d215768610d96f44cf97052ac (patch)
treea88946e764eb5a829a920c5027b4d92922cc54ee /drivers/media/video/cx18/cx18-fileops.c
parentb80e1074c734416987486b7b76b6479faa73f1e2 (diff)
V4L/DVB (9801): cx18: Allow more than 63 capture buffers in rotation per stream
cx18: Allow more than 63 capture buffers in rotation per stream. Implement q_busy to hold buffers the firmware has for use. q_free holds truly unused buffers in a pool. New buffers are given to the firmware as soon as the firmware returns one, if there are any to give to the firmware. 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-fileops.c')
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 504a1f9edec6..61192e62a80f 100644
--- a/drivers/media/video/cx18/cx18-fileops.c
+++ b/drivers/media/video/cx18/cx18-fileops.c
@@ -187,7 +187,7 @@ static struct cx18_buffer *cx18_get_buffer(struct cx18_stream *s, int non_block,
187 while ((buf = cx18_dequeue(s_vbi, &s_vbi->q_full))) { 187 while ((buf = cx18_dequeue(s_vbi, &s_vbi->q_full))) {
188 /* byteswap and process VBI data */ 188 /* byteswap and process VBI data */
189/* cx18_process_vbi_data(cx, buf, s_vbi->dma_pts, s_vbi->type); */ 189/* cx18_process_vbi_data(cx, buf, s_vbi->dma_pts, s_vbi->type); */
190 cx18_enqueue(s_vbi, buf, &s_vbi->q_free); 190 cx18_stream_put_buf_fw(s_vbi, buf);
191 } 191 }
192 } 192 }
193 buf = &cx->vbi.sliced_mpeg_buf; 193 buf = &cx->vbi.sliced_mpeg_buf;
@@ -361,15 +361,9 @@ static ssize_t cx18_read(struct cx18_stream *s, char __user *ubuf,
361 tot_count - tot_written); 361 tot_count - tot_written);
362 362
363 if (buf != &cx->vbi.sliced_mpeg_buf) { 363 if (buf != &cx->vbi.sliced_mpeg_buf) {
364 if (buf->readpos == buf->bytesused) { 364 if (buf->readpos == buf->bytesused)
365 cx18_buf_sync_for_device(s, buf); 365 cx18_stream_put_buf_fw(s, buf);
366 cx18_enqueue(s, buf, &s->q_free); 366 else
367 cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5,
368 s->handle,
369 (void __iomem *)&cx->scb->cpu_mdl[buf->id] -
370 cx->enc_mem,
371 1, buf->id, s->buf_size);
372 } else
373 cx18_push(s, buf, &s->q_full); 367 cx18_push(s, buf, &s->q_full);
374 } else if (buf->readpos == buf->bytesused) { 368 } else if (buf->readpos == buf->bytesused) {
375 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES; 369 int idx = cx->vbi.inserted_frame % CX18_VBI_FRAMES;