Commit e112146f authored by Lucas Stach's avatar Lucas Stach Committed by Mauro Carvalho Chehab
Browse files

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: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 93924831
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -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.
	 * that videobuf2 will keep the value of bytesused intact.
	 */
	 */
	vq->allow_zero_bytesused = 1;
	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;
	vq->dev = &ctx->dev->plat_dev->dev;


	return vb2_queue_init(vq);
	return vb2_queue_init(vq);