diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-13 13:04:56 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-03-13 13:04:56 -0300 |
commit | 29dbbb60b1b22bd956e7fc25a2b2d1a9ea577f79 (patch) | |
tree | 3049a3bbf0ba48fd24b62aaff07ab2925dcb3743 /linux/drivers/media/video/cx88/cx88-mpeg.c | |
parent | f9533819a70608d97d03abd7766ffc3f1e3ea655 (diff) | |
parent | 3d611f80a1b8888b9001e1738f24194c694a8bf4 (diff) | |
download | mediapointer-dvb-s2-29dbbb60b1b22bd956e7fc25a2b2d1a9ea577f79.tar.gz mediapointer-dvb-s2-29dbbb60b1b22bd956e7fc25a2b2d1a9ea577f79.tar.bz2 |
Merging mkrufky pvrusb2 tree
From: Mauro Carvalho Chehab <mchehab@infradead.org>
merge:
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/cx88/cx88-mpeg.c')
-rw-r--r-- | linux/drivers/media/video/cx88/cx88-mpeg.c | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/linux/drivers/media/video/cx88/cx88-mpeg.c b/linux/drivers/media/video/cx88/cx88-mpeg.c index a40d1bcd0..7d811004d 100644 --- a/linux/drivers/media/video/cx88/cx88-mpeg.c +++ b/linux/drivers/media/video/cx88/cx88-mpeg.c @@ -162,10 +162,43 @@ static int cx8802_restart_queue(struct cx8802_dev *dev, struct cx88_buffer *buf; struct list_head *item; - dprintk( 0, "cx8802_restart_queue\n" ); + dprintk( 1, "cx8802_restart_queue\n" ); if (list_empty(&q->active)) { - dprintk( 0, "cx8802_restart_queue: queue is empty\n" ); + struct cx88_buffer *prev; + prev = NULL; + + dprintk(1, "cx8802_restart_queue: queue is empty\n" ); + + for (;;) { + if (list_empty(&q->queued)) + return 0; + buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); + if (NULL == prev) { + list_del(&buf->vb.queue); + list_add_tail(&buf->vb.queue,&q->active); + cx8802_start_dma(dev, q, buf); + buf->vb.state = STATE_ACTIVE; + buf->count = q->count++; + mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); + dprintk(1,"[%p/%d] restart_queue - first active\n", + buf,buf->vb.i); + + } else if (prev->vb.width == buf->vb.width && + prev->vb.height == buf->vb.height && + prev->fmt == buf->fmt) { + list_del(&buf->vb.queue); + list_add_tail(&buf->vb.queue,&q->active); + buf->vb.state = STATE_ACTIVE; + buf->count = q->count++; + prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); + dprintk(1,"[%p/%d] restart_queue - move to active\n", + buf,buf->vb.i); + } else { + return 0; + } + prev = buf; + } return 0; } |