From patchwork Thu Dec 7 11:09:46 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Philipp Zabel
X-Patchwork-Id: 10098463
Return-Path:
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
[172.30.200.125])
by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id
7AC7660329 for ;
Thu, 7 Dec 2017 11:10:06 +0000 (UTC)
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7146B2A43B
for ;
Thu, 7 Dec 2017 11:10:06 +0000 (UTC)
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
id 654BF2A433; Thu, 7 Dec 2017 11:10:06 +0000 (UTC)
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
pdx-wl-mail.web.codeaurora.org
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI
autolearn=ham version=3.3.1
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7FE72A438
for ;
Thu, 7 Dec 2017 11:10:05 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1752670AbdLGLKE (ORCPT
);
Thu, 7 Dec 2017 06:10:04 -0500
Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:56213 "EHLO
metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK)
by vger.kernel.org with ESMTP id S1752561AbdLGLKE (ORCPT
);
Thu, 7 Dec 2017 06:10:04 -0500
Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]
helo=dude.pengutronix.de.)
by metis.ext.pengutronix.de with esmtp (Exim 4.84_2)
(envelope-from )
id 1eMu42-0008Rz-Kj; Thu, 07 Dec 2017 12:10:02 +0100
From: Philipp Zabel
To: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab , kernel@pengutronix.de,
Lucas Stach ,
Philipp Zabel
Subject: [PATCH] [media] coda: set min_buffers_needed
Date: Thu, 7 Dec 2017 12:09:46 +0100
Message-Id: <20171207110946.691-1-p.zabel@pengutronix.de>
X-Mailer: git-send-email 2.11.0
X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7
X-SA-Exim-Mail-From: p.zabel@pengutronix.de
X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de);
SAEximRunCond expanded to false
X-PTX-Original-Recipient: linux-media@vger.kernel.org
Sender: linux-media-owner@vger.kernel.org
Precedence: bulk
List-ID:
X-Mailing-List: linux-media@vger.kernel.org
X-Virus-Scanned: ClamAV using ClamSMTP
From: Lucas Stach
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
Signed-off-by: Philipp Zabel
---
drivers/media/platform/coda/coda-common.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/media/platform/coda/coda-common.c b/drivers/media/platform/coda/coda-common.c
index 15eb5dc4dff9a..46a628a548d9f 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);