summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/atmel
diff options
context:
space:
mode:
authorSongjun Wu <songjun.wu@microchip.com>2016-09-28 02:28:57 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-24 18:22:46 -0200
commitfa8bbe0a8567bf4eb87e82739465360a6797c91b (patch)
treeae0010f24a95c00630229f7035af29e7112f22e6 /drivers/media/platform/atmel
parent37e90a220abc4c5dee1fc42382cbca595a0e95bd (diff)
downloadlinux-fa8bbe0a8567bf4eb87e82739465360a6797c91b.tar.bz2
[media] atmel-isc: start dma in some scenario
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>
Diffstat (limited to 'drivers/media/platform/atmel')
-rw-r--r--drivers/media/platform/atmel/atmel-isc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/media/platform/atmel/atmel-isc.c b/drivers/media/platform/atmel/atmel-isc.c
index ccfe13b7d3f8..8e25d3f56438 100644
--- a/drivers/media/platform/atmel/atmel-isc.c
+++ b/drivers/media/platform/atmel/atmel-isc.c
@@ -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);
}