summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2017-12-07 06:09:46 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 14:58:39 -0500
commite112146f3b19e47193ca78c117b86ba0c760ebe4 (patch)
treeda3ae64dfb23723181697a9365b4cf1a1a743f68
parent9392483122e8818c0bf38e82ccf01b71e0c2151e (diff)
downloadlinux-e112146f3b19e47193ca78c117b86ba0c760ebe4.tar.bz2
media: coda: set min_buffers_needed
The current driver implementation expects at least one buffer on all queues to start streaming. Properly signal this to the vb2 core, to avoid confusion when streamon is racing with qbuf. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/coda/coda-common.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 15eb5dc4dff9..46a628a548d9 100644
--- a/drivers/media/platform/coda/coda-common.c
+++ b/drivers/media/platform/coda/coda-common.c
@@ -1884,6 +1884,12 @@ static int coda_queue_init(struct coda_ctx *ctx, struct vb2_queue *vq)
* that videobuf2 will keep the value of bytesused intact.
*/
vq->allow_zero_bytesused = 1;
+ /*
+ * We might be fine with no buffers on some of the queues, but that
+ * would need to be reflected in job_ready(). Currently we expect all
+ * queues to have at least one buffer queued.
+ */
+ vq->min_buffers_needed = 1;
vq->dev = &ctx->dev->plat_dev->dev;
return vb2_queue_init(vq);