From patchwork Thu Oct 12 11:00:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Fricke X-Patchwork-Id: 13418867 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 54E59CDB47E for ; Thu, 12 Oct 2023 11:03:01 +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=8x0wEUIXw/5nVwk/Tz7RRBD2tgHpdD6IMYtP5EYmcEA=; b=xlzsx3+NRXZiOA 6EiLoaKl2t97w9kQEhsI5214N9Fgk/UIVeortb/G7HnIXDg/t6jdiRyoTOD1ovmDgQk/MznZyyc3q LQPVPZpzslld7h+yW9fPwJhF1heNXXwjBhXoTNtJLIIlqDJUf/CTMeNpwBpwYvtU9j4v3hIx5M0Vd nun1z4NX7Esz0f53liVSR2PKyIBdBdWPpl7k0mwjqVwINhSFNDEoSWk76c7StJVqw2hvjcaURnKRC QWFxBukbCfXlm4vGqSgXkgzXhEamOt+IPOqhBkB0Y+jTrokSwaSR0dijeNXQ2+5fdVlH47Ueb8Ah8 9xMj68X3PQJHVdTbdyNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qqtSd-000jBR-0V; Thu, 12 Oct 2023 11:02:35 +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 1qqtSY-000j6H-38 for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2023 11:02:33 +0000 Received: from localhost (dynamic-002-247-255-251.2.247.pool.telefonica.de [2.247.255.251]) (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 AD7F36607346; Thu, 12 Oct 2023 12:02:26 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1697108547; bh=w/t+w6u/U3/SZ6HLVnBYGZYlIolHNvHDKuIuLzH9UCw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=df8FTbunD4FTinyxuAZxdLlgKcjWiVlxu9YmQISA9uqgNoXDGcOtkf4J0Qww59Tc8 9PZPh8wfTiGrJBn9DXgiwGIZoklGxTwulvrLWGsOj9+LTiym/KfPXCdIW8QP5wYwIR tmONUUXqDzmRAz+TJweCiAfStu/DhRC1t+KdOV/9Qx7A9jCuAQbbDqbPg5H6KC8r8W qAmFxFOwGYeqiYM/yTwoE6GOHkmoua+7Kasf0YSGlwjudvjK7F2BrqVZjSMDl/gG34 x9gxVtoVz/EmOxZPuNCVVUqjUpgPSreDK+W3/xazNh5V2FT36FRbm7JegWgnAR8UDy kpAWReYfOBRqA== From: Sebastian Fricke Date: Thu, 12 Oct 2023 13:00:59 +0200 Subject: [PATCH v13 1/8] media: v4l2: Add ignore_cap_streaming flag MIME-Version: 1.0 Message-Id: <20230929-wave5_v13_media_master-v13-1-5ac60ccbf2ce@collabora.com> References: <20230929-wave5_v13_media_master-v13-0-5ac60ccbf2ce@collabora.com> In-Reply-To: <20230929-wave5_v13_media_master-v13-0-5ac60ccbf2ce@collabora.com> To: Krzysztof Kozlowski , NXP Linux Team , Conor Dooley , Mauro Carvalho Chehab , Jackson Lee , Hans Verkuil , Sascha Hauer , Rob Herring , Pengutronix Kernel Team , Shawn Guo , Philipp Zabel , Nas Chung , Fabio Estevam Cc: linux-media@vger.kernel.org, Tomasz Figa , linux-kernel@vger.kernel.org, Sebastian Fricke , Nicolas Dufresne , kernel@collabora.com, Robert Beckett , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Darren Etheridge X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1697108536; l=1946; i=sebastian.fricke@collabora.com; s=linux-media; h=from:subject:message-id; bh=w/t+w6u/U3/SZ6HLVnBYGZYlIolHNvHDKuIuLzH9UCw=; b=D16V6519WF+94iLyTvlYo1i/smkP78HVY7aLAnOuUvwA9KhjwGWYZfGuLdScNK8ajJMV1Zf2Cb6W mD2QZww+ANJpavyIihiNIaZX5f/YD1gkUYqpOJOVmYlO/u3AHTBF 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-20231012_040231_147725_32DDC036 X-CRM114-Status: GOOD ( 12.21 ) 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 'struct v4l2_m2m_ctx' to toggle whether a CAPTURE queue must be streaming in order to allow queuing OUTPUT jobs to the ready queue. Currently, both queues (CAPTURE & OUTPUT) must be streaming in order to add new jobs. This prevents firmware from analyzing the bitstream header which arrives on the OUTPUT queue and performing an analysis of the sequence to ensure that userspace prepares the CAPTURE queue correctly. Signed-off-by: Sebastian Fricke Signed-off-by: Nicolas Dufresne Signed-off-by: Deborah Brouwer --- 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;