diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-08-10 10:56:14 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-11-03 05:21:24 -0500 |
commit | 6f11adc6a5e3378aeb13d9a19c427cbec05805be (patch) | |
tree | 6cbfc554619eaa52c16e59cf74790e74784d45d2 /drivers/media/pci | |
parent | 637bc2079678e08476d884f02a5d5d3208b5c018 (diff) |
[media] cx88: drop the bogus 'queue' list in dmaqueue
This list is only used if the width, height and/or format of a buffer has
changed, but that can never happen. Remove it and all associated code.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/cx88/cx88-mpeg.c | 31 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-video.c | 39 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88.h | 1 |
3 files changed, 3 insertions, 68 deletions
diff --git a/drivers/media/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c index 2803b6f17646..5f59901b2460 100644 --- a/drivers/media/pci/cx88/cx88-mpeg.c +++ b/drivers/media/pci/cx88/cx88-mpeg.c | |||
@@ -210,37 +210,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev, | |||
210 | 210 | ||
211 | dprintk( 1, "cx8802_restart_queue\n" ); | 211 | dprintk( 1, "cx8802_restart_queue\n" ); |
212 | if (list_empty(&q->active)) | 212 | if (list_empty(&q->active)) |
213 | { | ||
214 | struct cx88_buffer *prev; | ||
215 | prev = NULL; | ||
216 | |||
217 | dprintk(1, "cx8802_restart_queue: queue is empty\n" ); | ||
218 | |||
219 | for (;;) { | ||
220 | if (list_empty(&q->queued)) | ||
221 | return 0; | ||
222 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); | ||
223 | if (NULL == prev) { | ||
224 | list_move_tail(&buf->vb.queue, &q->active); | ||
225 | cx8802_start_dma(dev, q, buf); | ||
226 | buf->vb.state = VIDEOBUF_ACTIVE; | ||
227 | buf->count = q->count++; | ||
228 | mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); | ||
229 | dprintk(1,"[%p/%d] restart_queue - first active\n", | ||
230 | buf,buf->vb.i); | ||
231 | |||
232 | } else { | ||
233 | list_move_tail(&buf->vb.queue, &q->active); | ||
234 | buf->vb.state = VIDEOBUF_ACTIVE; | ||
235 | buf->count = q->count++; | ||
236 | prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); | ||
237 | dprintk(1,"[%p/%d] restart_queue - move to active\n", | ||
238 | buf,buf->vb.i); | ||
239 | } | ||
240 | prev = buf; | ||
241 | } | ||
242 | return 0; | 213 | return 0; |
243 | } | ||
244 | 214 | ||
245 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); | 215 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); |
246 | dprintk(2,"restart_queue [%p/%d]: restart dma\n", | 216 | dprintk(2,"restart_queue [%p/%d]: restart dma\n", |
@@ -486,7 +456,6 @@ static int cx8802_init_common(struct cx8802_dev *dev) | |||
486 | 456 | ||
487 | /* init dma queue */ | 457 | /* init dma queue */ |
488 | INIT_LIST_HEAD(&dev->mpegq.active); | 458 | INIT_LIST_HEAD(&dev->mpegq.active); |
489 | INIT_LIST_HEAD(&dev->mpegq.queued); | ||
490 | dev->mpegq.timeout.function = cx8802_timeout; | 459 | dev->mpegq.timeout.function = cx8802_timeout; |
491 | dev->mpegq.timeout.data = (unsigned long)dev; | 460 | dev->mpegq.timeout.data = (unsigned long)dev; |
492 | init_timer(&dev->mpegq.timeout); | 461 | init_timer(&dev->mpegq.timeout); |
diff --git a/drivers/media/pci/cx88/cx88-video.c b/drivers/media/pci/cx88/cx88-video.c index 095542316917..a1d704235478 100644 --- a/drivers/media/pci/cx88/cx88-video.c +++ b/drivers/media/pci/cx88/cx88-video.c | |||
@@ -470,7 +470,7 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
470 | struct cx88_dmaqueue *q) | 470 | struct cx88_dmaqueue *q) |
471 | { | 471 | { |
472 | struct cx88_core *core = dev->core; | 472 | struct cx88_core *core = dev->core; |
473 | struct cx88_buffer *buf, *prev; | 473 | struct cx88_buffer *buf; |
474 | 474 | ||
475 | if (!list_empty(&q->active)) { | 475 | if (!list_empty(&q->active)) { |
476 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); | 476 | buf = list_entry(q->active.next, struct cx88_buffer, vb.queue); |
@@ -480,33 +480,8 @@ static int restart_video_queue(struct cx8800_dev *dev, | |||
480 | list_for_each_entry(buf, &q->active, vb.queue) | 480 | list_for_each_entry(buf, &q->active, vb.queue) |
481 | buf->count = q->count++; | 481 | buf->count = q->count++; |
482 | mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); | 482 | mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); |
483 | return 0; | ||
484 | } | ||
485 | |||
486 | prev = NULL; | ||
487 | for (;;) { | ||
488 | if (list_empty(&q->queued)) | ||
489 | return 0; | ||
490 | buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); | ||
491 | if (NULL == prev) { | ||
492 | list_move_tail(&buf->vb.queue, &q->active); | ||
493 | start_video_dma(dev, q, buf); | ||
494 | buf->vb.state = VIDEOBUF_ACTIVE; | ||
495 | buf->count = q->count++; | ||
496 | mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT); | ||
497 | dprintk(2,"[%p/%d] restart_queue - first active\n", | ||
498 | buf,buf->vb.i); | ||
499 | |||
500 | } else { | ||
501 | list_move_tail(&buf->vb.queue, &q->active); | ||
502 | buf->vb.state = VIDEOBUF_ACTIVE; | ||
503 | buf->count = q->count++; | ||
504 | prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); | ||
505 | dprintk(2,"[%p/%d] restart_queue - move to active\n", | ||
506 | buf,buf->vb.i); | ||
507 | } | ||
508 | prev = buf; | ||
509 | } | 483 | } |
484 | return 0; | ||
510 | } | 485 | } |
511 | 486 | ||
512 | /* ------------------------------------------------------------------ */ | 487 | /* ------------------------------------------------------------------ */ |
@@ -613,13 +588,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) | |||
613 | buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); | 588 | buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC); |
614 | buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); | 589 | buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma); |
615 | 590 | ||
616 | if (!list_empty(&q->queued)) { | 591 | if (list_empty(&q->active)) { |
617 | list_add_tail(&buf->vb.queue,&q->queued); | ||
618 | buf->vb.state = VIDEOBUF_QUEUED; | ||
619 | dprintk(2,"[%p/%d] buffer_queue - append to queued\n", | ||
620 | buf, buf->vb.i); | ||
621 | |||
622 | } else if (list_empty(&q->active)) { | ||
623 | list_add_tail(&buf->vb.queue,&q->active); | 592 | list_add_tail(&buf->vb.queue,&q->active); |
624 | start_video_dma(dev, q, buf); | 593 | start_video_dma(dev, q, buf); |
625 | buf->vb.state = VIDEOBUF_ACTIVE; | 594 | buf->vb.state = VIDEOBUF_ACTIVE; |
@@ -1691,7 +1660,6 @@ static int cx8800_initdev(struct pci_dev *pci_dev, | |||
1691 | 1660 | ||
1692 | /* init video dma queues */ | 1661 | /* init video dma queues */ |
1693 | INIT_LIST_HEAD(&dev->vidq.active); | 1662 | INIT_LIST_HEAD(&dev->vidq.active); |
1694 | INIT_LIST_HEAD(&dev->vidq.queued); | ||
1695 | dev->vidq.timeout.function = cx8800_vid_timeout; | 1663 | dev->vidq.timeout.function = cx8800_vid_timeout; |
1696 | dev->vidq.timeout.data = (unsigned long)dev; | 1664 | dev->vidq.timeout.data = (unsigned long)dev; |
1697 | init_timer(&dev->vidq.timeout); | 1665 | init_timer(&dev->vidq.timeout); |
@@ -1700,7 +1668,6 @@ static int cx8800_initdev(struct pci_dev *pci_dev, | |||
1700 | 1668 | ||
1701 | /* init vbi dma queues */ | 1669 | /* init vbi dma queues */ |
1702 | INIT_LIST_HEAD(&dev->vbiq.active); | 1670 | INIT_LIST_HEAD(&dev->vbiq.active); |
1703 | INIT_LIST_HEAD(&dev->vbiq.queued); | ||
1704 | dev->vbiq.timeout.function = cx8800_vbi_timeout; | 1671 | dev->vbiq.timeout.function = cx8800_vbi_timeout; |
1705 | dev->vbiq.timeout.data = (unsigned long)dev; | 1672 | dev->vbiq.timeout.data = (unsigned long)dev; |
1706 | init_timer(&dev->vbiq.timeout); | 1673 | init_timer(&dev->vbiq.timeout); |
diff --git a/drivers/media/pci/cx88/cx88.h b/drivers/media/pci/cx88/cx88.h index ddc7991723eb..77ec5427a986 100644 --- a/drivers/media/pci/cx88/cx88.h +++ b/drivers/media/pci/cx88/cx88.h | |||
@@ -324,7 +324,6 @@ struct cx88_buffer { | |||
324 | 324 | ||
325 | struct cx88_dmaqueue { | 325 | struct cx88_dmaqueue { |
326 | struct list_head active; | 326 | struct list_head active; |
327 | struct list_head queued; | ||
328 | struct timer_list timeout; | 327 | struct timer_list timeout; |
329 | struct btcx_riscmem stopper; | 328 | struct btcx_riscmem stopper; |
330 | u32 count; | 329 | u32 count; |