]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[media] atmel-isc: start dma in some scenario
authorSongjun Wu <songjun.wu@microchip.com>
Wed, 28 Sep 2016 05:28:57 +0000 (02:28 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 24 Oct 2016 20:22:46 +0000 (18:22 -0200)
If a new vb buf is added to vb queue, the queue is
empty and steaming, dma should be started.

Signed-off-by: Songjun Wu <songjun.wu@microchip.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/atmel/atmel-isc.c

index ccfe13b7d3f819b9f36880f5dbd461be9e76a878..8e25d3f56438ab925021c34a49cfc58ebdae7674 100644 (file)
@@ -617,7 +617,13 @@ static void isc_buffer_queue(struct vb2_buffer *vb)
        unsigned long flags;
 
        spin_lock_irqsave(&isc->dma_queue_lock, flags);
-       list_add_tail(&buf->list, &isc->dma_queue);
+       if (!isc->cur_frm && list_empty(&isc->dma_queue) &&
+               vb2_is_streaming(vb->vb2_queue)) {
+               isc->cur_frm = buf;
+               isc_start_dma(isc->regmap, isc->cur_frm,
+                       isc->current_fmt->reg_dctrl_dview);
+       } else
+               list_add_tail(&buf->list, &isc->dma_queue);
        spin_unlock_irqrestore(&isc->dma_queue_lock, flags);
 }