summaryrefslogtreecommitdiff
path: root/drivers/media/pci/intel
diff options
context:
space:
mode:
authorYong Zhi <yong.zhi@intel.com>2018-01-03 21:57:17 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-01-05 12:44:10 -0500
commitdcd80955a0a13d6da3d4954c92801fb52cd950b4 (patch)
tree8dff95bebe4b9745002ed0b50e5e4fd2acd85a92 /drivers/media/pci/intel
parentc7cbef1fdb5480e9f39e8db64ac32ed8e1984adf (diff)
media: intel-ipu3: cio2: fix for wrong vb2buf state warnings
cio2 driver should release buffer with QUEUED state when start_stream op failed, wrong buffer state will cause vb2 core throw a warning. Signed-off-by: Yong Zhi <yong.zhi@intel.com> Signed-off-by: Cao Bing Bu <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/pci/intel')
-rw-r--r--drivers/media/pci/intel/ipu3/ipu3-cio2.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 9377f880b8f6..9db752a7f363 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -785,7 +785,8 @@ static irqreturn_t cio2_irq(int irq, void *cio2_ptr)
/**************** Videobuf2 interface ****************/
-static void cio2_vb2_return_all_buffers(struct cio2_queue *q)
+static void cio2_vb2_return_all_buffers(struct cio2_queue *q,
+ enum vb2_buffer_state state)
{
unsigned int i;
@@ -793,7 +794,7 @@ static void cio2_vb2_return_all_buffers(struct cio2_queue *q)
if (q->bufs[i]) {
atomic_dec(&q->bufs_queued);
vb2_buffer_done(&q->bufs[i]->vbb.vb2_buf,
- VB2_BUF_STATE_ERROR);
+ state);
}
}
}
@@ -1019,7 +1020,7 @@ fail_hw:
media_pipeline_stop(&q->vdev.entity);
fail_pipeline:
dev_dbg(&cio2->pci_dev->dev, "failed to start streaming (%d)\n", r);
- cio2_vb2_return_all_buffers(q);
+ cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_QUEUED);
pm_runtime_put(&cio2->pci_dev->dev);
return r;
@@ -1035,7 +1036,7 @@ static void cio2_vb2_stop_streaming(struct vb2_queue *vq)
"failed to stop sensor streaming\n");
cio2_hw_exit(cio2, q);
- cio2_vb2_return_all_buffers(q);
+ cio2_vb2_return_all_buffers(q, VB2_BUF_STATE_ERROR);
media_pipeline_stop(&q->vdev.entity);
pm_runtime_put(&cio2->pci_dev->dev);
cio2->streaming = false;