aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorJelle Foks <jelle@foks.8m.com>2006-03-09 15:44:07 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:05:07 -0400
commitf14ac0bc455a255c48f9110080e8889c6d65cec2 (patch)
tree0f53313126882618e50182dc98444651affd2a38 /drivers/media/video
parent774dd5d9bdcbfe2efb3425e8a0be0b4d01a65c26 (diff)
V4L/DVB (3426): PATCH cx88-mpeg: cx8802_restart_queue() for blackbird
Fixes "cx8802_restart_queue: queue is empty" storm in syslog Signed-off-by: Jelle Foks <jelle@foks.8m.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-mpeg.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/drivers/media/video/cx88/cx88-mpeg.c b/drivers/media/video/cx88/cx88-mpeg.c
index e1b38ff0c8a3..a9d7795a8e14 100644
--- a/drivers/media/video/cx88/cx88-mpeg.c
+++ b/drivers/media/video/cx88/cx88-mpeg.c
@@ -143,10 +143,43 @@ static int cx8802_restart_queue(struct cx8802_dev *dev,
143 struct cx88_buffer *buf; 143 struct cx88_buffer *buf;
144 struct list_head *item; 144 struct list_head *item;
145 145
146 dprintk( 0, "cx8802_restart_queue\n" ); 146 dprintk( 1, "cx8802_restart_queue\n" );
147 if (list_empty(&q->active)) 147 if (list_empty(&q->active))
148 { 148 {
149 dprintk( 0, "cx8802_restart_queue: queue is empty\n" ); 149 struct cx88_buffer *prev;
150 prev = NULL;
151
152 dprintk(1, "cx8802_restart_queue: queue is empty\n" );
153
154 for (;;) {
155 if (list_empty(&q->queued))
156 return 0;
157 buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
158 if (NULL == prev) {
159 list_del(&buf->vb.queue);
160 list_add_tail(&buf->vb.queue,&q->active);
161 cx8802_start_dma(dev, q, buf);
162 buf->vb.state = STATE_ACTIVE;
163 buf->count = q->count++;
164 mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
165 dprintk(1,"[%p/%d] restart_queue - first active\n",
166 buf,buf->vb.i);
167
168 } else if (prev->vb.width == buf->vb.width &&
169 prev->vb.height == buf->vb.height &&
170 prev->fmt == buf->fmt) {
171 list_del(&buf->vb.queue);
172 list_add_tail(&buf->vb.queue,&q->active);
173 buf->vb.state = STATE_ACTIVE;
174 buf->count = q->count++;
175 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
176 dprintk(1,"[%p/%d] restart_queue - move to active\n",
177 buf,buf->vb.i);
178 } else {
179 return 0;
180 }
181 prev = buf;
182 }
150 return 0; 183 return 0;
151 } 184 }
152 185