From patchwork Wed Nov 8 19:29:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Fricke X-Patchwork-Id: 13450495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B9D44C4167B for ; Wed, 8 Nov 2023 19:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+rJ6kDUFQn7vOyQRlfDWHqmeZrVHtKsqdQIm7oMqDac=; b=hnA2Ru3t8/3Klg CtAHmjaeALbXoa4KYmvRI6ydWwdz+PY2VisvRMnvqdR1Xut/NoqeU5TZoT44qRTcWQinbQtUHuMMD nHQAO1wh1D1eNlqGTQ/dWo6M6RvTcacIqNASIn4+xCaF2UKjlE0HZ1mNgSMkiuAonZ6BlC57I7usJ bIp3p+9N5jgMuTcTQvbG3X7/OXeFoI12o8rgk9EXxxkxq5sLhMkADrv1refvqfnXoDRqIUXPESD7a 0Hqofw0/tyE6tu0J16xCw8M6Mu7XwOYCVsu1mm6gPb4czsDj2TSYhX91X0EXLiEDZ5xkKeIzbW3qt 0qBTXoo4pHX91RN+H8/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1r0oF3-004cAT-0V; Wed, 08 Nov 2023 19:29:33 +0000 Received: from madras.collabora.co.uk ([46.235.227.172]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1r0oF0-004c9c-14 for linux-arm-kernel@lists.infradead.org; Wed, 08 Nov 2023 19:29:31 +0000 Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sebastianfricke) by madras.collabora.co.uk (Postfix) with ESMTPSA id 0395766076A1; Wed, 8 Nov 2023 19:29:29 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1699471769; bh=cGOweYfxq9nnkhXXEN78c1BIl1bT21hvfnRwjm5+EWU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=DkWc+2wOl7TZr2lgzNV6wvD1baeXaP+7a2MQtnyY7RkAjS66BmF0RGet8nD95mY7k CMvvshro9kPfebcqEQF6PRQG6Mv14soIbTckCkY7ToR8nVsIwn+KtIh1L48ck6pptV tMyI2Qin62vf2UBq9g7+O/JBx0/nvhG8QxAhzgc+L3TzTMpibZMV3BjdNsJchPo4qJ o5q5L5+x2qCNPYNlAQtQy31yoJHBHwEds/xV6CT3BJ1b+weBiF1FL3G/2cX5L5SCKE 3bmL++iwFunrL3jJx+oszoBN7w93sUBWOnezhZeXajwYZrDqtQFQ62nDOzAkdVcA8O CI9wGMnE8mdIQ== From: Sebastian Fricke Date: Wed, 08 Nov 2023 20:29:20 +0100 Subject: [PATCH v14 1/8] media: v4l2: Add ignore_streaming flag MIME-Version: 1.0 Message-Id: <20231108-wave5-v14-rebased-v14-1-0b4af1258656@collabora.com> References: <20231108-wave5-v14-rebased-v14-0-0b4af1258656@collabora.com> In-Reply-To: <20231108-wave5-v14-rebased-v14-0-0b4af1258656@collabora.com> To: Mauro Carvalho Chehab , NXP Linux Team , Pengutronix Kernel Team , Conor Dooley , Nas Chung , Fabio Estevam , Krzysztof Kozlowski , Jackson Lee , Shawn Guo , Sascha Hauer , Hans Verkuil , Philipp Zabel , Rob Herring Cc: Ivan Bornyakov , Deborah Brouwer , Nicolas Dufresne , devicetree@vger.kernel.org, Robert Beckett , Sebastian Fricke , linux-arm-kernel@lists.infradead.org, kernel@collabora.com, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1699471762; l=1867; i=sebastian.fricke@collabora.com; s=linux-media; h=from:subject:message-id; bh=cGOweYfxq9nnkhXXEN78c1BIl1bT21hvfnRwjm5+EWU=; b=qgoFR5YHyrLgwpt94fHa9DUFnBayF/kmFDx+LRoPS5xqxCdaFN6NO1gti2cm/txGrv3xgLoczPYB LllqukNzBCqB96usyV4kBDMfCLGsu27V0cezxEpX4ETRSeA5xuFB X-Developer-Key: i=sebastian.fricke@collabora.com; a=ed25519; pk=pYXedPwrTtErcj7ERYeo/IpTrpe4QbJuEzSB52fslBg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231108_112930_493334_CC787CEA X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add a new flag to the `struct v4l2_m2m_dev` to toggle whether a queue must be streaming in order to allow queuing jobs to the ready queue. Currently, both queues (CAPTURE & OUTPUT) must be streaming in order to allow adding new jobs. This behavior limits the usability of M2M for some drivers, as these have to be able, to perform analysis of the sequence to ensure, that userspace prepares the CAPTURE queue correctly. Signed-off-by: Sebastian Fricke Signed-off-by: Nicolas Dufresne --- include/media/v4l2-mem2mem.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index d6c8eb2b5201..1288fe364fab 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h @@ -84,6 +84,12 @@ struct v4l2_m2m_queue_ctx { * @last_src_buf: indicate the last source buffer for draining * @next_buf_last: next capture queud buffer will be tagged as last * @has_stopped: indicate the device has been stopped + * @ignore_cap_streaming: If true, job_ready can be called even if the CAPTURE + * queue is not streaming. This allows firmware to + * analyze the bitstream header which arrives on the + * OUTPUT queue. The driver must implement the job_ready + * callback correctly to make sure that the requirements + * for actual decoding are met. * @m2m_dev: opaque pointer to the internal data to handle M2M context * @cap_q_ctx: Capture (output to memory) queue context * @out_q_ctx: Output (input from memory) queue context @@ -106,6 +112,7 @@ struct v4l2_m2m_ctx { struct vb2_v4l2_buffer *last_src_buf; bool next_buf_last; bool has_stopped; + bool ignore_cap_streaming; /* internal use only */ struct v4l2_m2m_dev *m2m_dev;