From 24bc976365b2b74550a4f81f8f02bc5e57076697 Mon Sep 17 00:00:00 2001 From: Jelle Foks Date: Thu, 9 Mar 2006 17:44:07 -0300 Subject: [PATCH] --- yaml --- r: 29999 b: refs/heads/master c: f14ac0bc455a255c48f9110080e8889c6d65cec2 h: refs/heads/master i: 29997: 8c81deb0c0a4908e9ffd8f8d1775381924c18d2b 29995: 545ecdbcbf7599a61e447a5eb67336049dcd9967 29991: c0228550db80118e07accbd603c5093131bc5a13 29983: dcb55dbfe4ad943a31a2fd6577e4a8cea0b1e767 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/cx88/cx88-mpeg.c | 37 ++++++++++++++++++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b489f7bd8659..56d3418b1751 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 774dd5d9bdcbfe2efb3425e8a0be0b4d01a65c26 +refs/heads/master: f14ac0bc455a255c48f9110080e8889c6d65cec2 diff --git a/trunk/drivers/media/video/cx88/cx88-mpeg.c b/trunk/drivers/media/video/cx88/cx88-mpeg.c index e1b38ff0c8a3..a9d7795a8e14 100644 --- a/trunk/drivers/media/video/cx88/cx88-mpeg.c +++ b/trunk/drivers/media/video/cx88/cx88-mpeg.c @@ -143,10 +143,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; }