[media] cx88: drop the bogus 'queue' list in dmaqueue
authorHans Verkuil <hans.verkuil@cisco.com>
Sun, 10 Aug 2014 14:56:14 +0000 (11:56 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 3 Nov 2014 10:21:24 +0000 (08:21 -0200)
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>
drivers/media/pci/cx88/cx88-mpeg.c
drivers/media/pci/cx88/cx88-video.c
drivers/media/pci/cx88/cx88.h

index 2803b6f17646f11f44f908f1b96869b57512a200..5f59901b246056ccbe5cff655cb2d08bdf613e19 100644 (file)
@@ -210,37 +210,7 @@ static int cx8802_restart_queue(struct cx8802_dev    *dev,
 
        dprintk( 1, "cx8802_restart_queue\n" );
        if (list_empty(&q->active))
-       {
-               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_move_tail(&buf->vb.queue, &q->active);
-                               cx8802_start_dma(dev, q, buf);
-                               buf->vb.state = VIDEOBUF_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 {
-                               list_move_tail(&buf->vb.queue, &q->active);
-                               buf->vb.state = VIDEOBUF_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);
-                       }
-                       prev = buf;
-               }
                return 0;
-       }
 
        buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
        dprintk(2,"restart_queue [%p/%d]: restart dma\n",
@@ -486,7 +456,6 @@ static int cx8802_init_common(struct cx8802_dev *dev)
 
        /* init dma queue */
        INIT_LIST_HEAD(&dev->mpegq.active);
-       INIT_LIST_HEAD(&dev->mpegq.queued);
        dev->mpegq.timeout.function = cx8802_timeout;
        dev->mpegq.timeout.data     = (unsigned long)dev;
        init_timer(&dev->mpegq.timeout);
index 095542316917ad23e208ae336ceecd9f4ea59df5..a1d7042354780498675e972b11cb11e4786be186 100644 (file)
@@ -470,7 +470,7 @@ static int restart_video_queue(struct cx8800_dev    *dev,
                               struct cx88_dmaqueue *q)
 {
        struct cx88_core *core = dev->core;
-       struct cx88_buffer *buf, *prev;
+       struct cx88_buffer *buf;
 
        if (!list_empty(&q->active)) {
                buf = list_entry(q->active.next, struct cx88_buffer, vb.queue);
@@ -480,33 +480,8 @@ static int restart_video_queue(struct cx8800_dev    *dev,
                list_for_each_entry(buf, &q->active, vb.queue)
                        buf->count = q->count++;
                mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
-               return 0;
-       }
-
-       prev = NULL;
-       for (;;) {
-               if (list_empty(&q->queued))
-                       return 0;
-               buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue);
-               if (NULL == prev) {
-                       list_move_tail(&buf->vb.queue, &q->active);
-                       start_video_dma(dev, q, buf);
-                       buf->vb.state = VIDEOBUF_ACTIVE;
-                       buf->count    = q->count++;
-                       mod_timer(&q->timeout, jiffies+BUFFER_TIMEOUT);
-                       dprintk(2,"[%p/%d] restart_queue - first active\n",
-                               buf,buf->vb.i);
-
-               } else {
-                       list_move_tail(&buf->vb.queue, &q->active);
-                       buf->vb.state = VIDEOBUF_ACTIVE;
-                       buf->count    = q->count++;
-                       prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);
-                       dprintk(2,"[%p/%d] restart_queue - move to active\n",
-                               buf,buf->vb.i);
-               }
-               prev = buf;
        }
+       return 0;
 }
 
 /* ------------------------------------------------------------------ */
@@ -613,13 +588,7 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
        buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC);
        buf->risc.jmp[1] = cpu_to_le32(q->stopper.dma);
 
-       if (!list_empty(&q->queued)) {
-               list_add_tail(&buf->vb.queue,&q->queued);
-               buf->vb.state = VIDEOBUF_QUEUED;
-               dprintk(2,"[%p/%d] buffer_queue - append to queued\n",
-                       buf, buf->vb.i);
-
-       } else if (list_empty(&q->active)) {
+       if (list_empty(&q->active)) {
                list_add_tail(&buf->vb.queue,&q->active);
                start_video_dma(dev, q, buf);
                buf->vb.state = VIDEOBUF_ACTIVE;
@@ -1691,7 +1660,6 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 
        /* init video dma queues */
        INIT_LIST_HEAD(&dev->vidq.active);
-       INIT_LIST_HEAD(&dev->vidq.queued);
        dev->vidq.timeout.function = cx8800_vid_timeout;
        dev->vidq.timeout.data     = (unsigned long)dev;
        init_timer(&dev->vidq.timeout);
@@ -1700,7 +1668,6 @@ static int cx8800_initdev(struct pci_dev *pci_dev,
 
        /* init vbi dma queues */
        INIT_LIST_HEAD(&dev->vbiq.active);
-       INIT_LIST_HEAD(&dev->vbiq.queued);
        dev->vbiq.timeout.function = cx8800_vbi_timeout;
        dev->vbiq.timeout.data     = (unsigned long)dev;
        init_timer(&dev->vbiq.timeout);
index ddc7991723ebdec837bd76defff60d474dd40187..77ec5427a98619e6b2168773b3c2e82edad9ce39 100644 (file)
@@ -324,7 +324,6 @@ struct cx88_buffer {
 
 struct cx88_dmaqueue {
        struct list_head       active;
-       struct list_head       queued;
        struct timer_list      timeout;
        struct btcx_riscmem    stopper;
        u32                    count;