|
@@ -175,8 +175,6 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
|
|
|
unsigned long addr, flags;
|
|
|
int ret;
|
|
|
|
|
|
- spin_lock_irqsave(&common->irqlock, flags);
|
|
|
-
|
|
|
/* Initialize field_id */
|
|
|
ch->field_id = 0;
|
|
|
|
|
@@ -207,6 +205,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
|
|
|
vpif_config_addr(ch, ret);
|
|
|
|
|
|
/* Get the next frame from the buffer queue */
|
|
|
+ spin_lock_irqsave(&common->irqlock, flags);
|
|
|
common->cur_frm = common->next_frm = list_entry(common->dma_queue.next,
|
|
|
struct vpif_cap_buffer, list);
|
|
|
/* Remove buffer from the buffer queue */
|
|
@@ -240,6 +239,7 @@ static int vpif_start_streaming(struct vb2_queue *vq, unsigned int count)
|
|
|
return 0;
|
|
|
|
|
|
err:
|
|
|
+ spin_lock_irqsave(&common->irqlock, flags);
|
|
|
list_for_each_entry_safe(buf, tmp, &common->dma_queue, list) {
|
|
|
list_del(&buf->list);
|
|
|
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
|
|
@@ -283,7 +283,6 @@ static void vpif_stop_streaming(struct vb2_queue *vq)
|
|
|
vpif_dbg(1, debug, "stream off failed in subdev\n");
|
|
|
|
|
|
/* release all active buffers */
|
|
|
- spin_lock_irqsave(&common->irqlock, flags);
|
|
|
if (common->cur_frm == common->next_frm) {
|
|
|
vb2_buffer_done(&common->cur_frm->vb.vb2_buf,
|
|
|
VB2_BUF_STATE_ERROR);
|
|
@@ -296,6 +295,7 @@ static void vpif_stop_streaming(struct vb2_queue *vq)
|
|
|
VB2_BUF_STATE_ERROR);
|
|
|
}
|
|
|
|
|
|
+ spin_lock_irqsave(&common->irqlock, flags);
|
|
|
while (!list_empty(&common->dma_queue)) {
|
|
|
common->next_frm = list_entry(common->dma_queue.next,
|
|
|
struct vpif_cap_buffer, list);
|