Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4927403rdb; Fri, 15 Sep 2023 17:41:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEQ/xPRpUKxaxZ1jH0ARTAkzmB+dG8V/W4ePEGJ7w/8Dl3NYWdcZmmzHynNK+08jUo2u2P5 X-Received: by 2002:a05:6808:21aa:b0:3a3:ed69:331 with SMTP id be42-20020a05680821aa00b003a3ed690331mr4387229oib.6.1694824891157; Fri, 15 Sep 2023 17:41:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694824891; cv=none; d=google.com; s=arc-20160816; b=WTPwjVPS5qg+v4LKBsFCPbuL3bck+1aOxI9/iKw+v7k+X3y+DqEGLDlWIl0S9yELsG L5X2JUBhueRjunWUV7PCv5P5NDip6ZqwD39e91V211iFdQCnsPLc9pIQHloGXIca8sOu sewtTg9R4xV3nnHCXhvKPuj5T7VnMzr2QaFLJ3J2uZYiiS97ly3EemMNz9A2glXL77TJ WV/36kjfWutIOGnpSH/spHuoQVoNXziEDmSziv0X3fwvCOXxr6Bkd7hwz4MVkrLjaRI4 4hhGXj27rxF34ao3UX3Biet4wtoY5MtAJg9Q0cByW+0lzEU37uHjWIb2kEyPVOnygCKv 9Sfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=n2g7YeMYJK58hsfZpFCAGcAtPciIKJ59GUPCj3rpIxg=; fh=BvlueBPQoVTVSHCOx+9ro6MNKmiFC/Zq54JPxFlSqo0=; b=w4cxyZIgINHH8iGNLupCHDFaz9WMkcSpsUYy1+nnm0957oLW3rWGP8M+KOJ1bGFLzC tCuMAUtNcG0A6Hd6eu0wAITmYfw/7O7xz8Zpx8l1xGaCMZGGsxKIfRNlSsRXqJ/2LNH7 MzgnMX9rhF23i9EqMithPSu99blxtydF+M+GGLou0KSLtoBUPOwnV4iMZHeiRPzNcytu 4DLSz7lOeMBHhYpMNtBmGPZtppkqrpm/F8Mvq/x+paTDMdvTyg7/0oN+MR50aWksbW2p sE/2ME1BaaEfb+vXXEbLsu7/nDWaTTIhdu4+q7Hfc4LmgYlsCPRDFmCV2jSYPd3bjVCh +oUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BNrhrDp8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y123-20020a636481000000b00565dd91aa06si3946510pgb.244.2023.09.15.17.41.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 17:41:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BNrhrDp8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 692B28539E07; Fri, 15 Sep 2023 14:12:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237966AbjIOVMH (ORCPT + 99 others); Fri, 15 Sep 2023 17:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237936AbjIOVL7 (ORCPT ); Fri, 15 Sep 2023 17:11:59 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBF0EA1; Fri, 15 Sep 2023 14:11:53 -0700 (PDT) Received: from localhost (89-26-75-29.dyn.cablelink.at [89.26.75.29]) (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 A149466072F6; Fri, 15 Sep 2023 22:11:52 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1694812312; bh=bfjXNTEUGOV/V9xi2T+58cboEq+YPmOFqHLsOLFZbPw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BNrhrDp8xDg1sOY0ZzZSw0/z+hUHhX32F5Km6n2Q/2J8jTNIBATFr0RqgBYO3Kf5/ j/FQ88xSWFyYi637zcWtKz/0I7s0ibi8H/6yy+bEbX61pR5Q9FYmU0SsP73lTs0mAI zjDojvchHDN1c+t3vz3bZfP8VHHLsRtX99U/uRqrCLuZ1NaXy7EHnJAGZ9VYtAeDbt L6s1bF7aoN4N4Qqwmi02QbgIpAZb8RZ5M61mQ8NEPioykwX9jU7NJ6XXryitmfdzp8 BtfAjGoJgNUQog0/x/R3T8tqPziDTsA5MUK1qxZdiZIJAwRObvPN8Cppxh1MRLzBlf 7tUXYngQxluhQ== From: Sebastian Fricke Date: Fri, 15 Sep 2023 23:11:30 +0200 Subject: [PATCH v12 1/7] media: v4l2: Add ignore_streaming flag MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230915-wave5_v12_on_media_master-v12-1-92fc66cd685d@collabora.com> References: <20230915-wave5_v12_on_media_master-v12-0-92fc66cd685d@collabora.com> In-Reply-To: <20230915-wave5_v12_on_media_master-v12-0-92fc66cd685d@collabora.com> To: Mauro Carvalho Chehab , Nas Chung , Sascha Hauer , Fabio Estevam , Rob Herring , Shawn Guo , Philipp Zabel , Jackson Lee , Krzysztof Kozlowski , NXP Linux Team , Hans Verkuil , Conor Dooley , Pengutronix Kernel Team Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sebastian Fricke , Robert Beckett , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Nicolas Dufresne X-Mailer: b4 0.11.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694812307; l=2295; i=sebastian.fricke@collabora.com; s=linux-media; h=from:subject:message-id; bh=bfjXNTEUGOV/V9xi2T+58cboEq+YPmOFqHLsOLFZbPw=; b=VbAFE35JG3ToaRlhTlsQQfjMPC3TontsrKvcvUyDnHfCVp53Y08nftaFNUIlpaVT9Q2ZOn9XQpjG DO/9V4kyAbx025A/fEK2RLlocnBrmDQV2PBOE3EtYKX8h/TamVMl X-Developer-Key: i=sebastian.fricke@collabora.com; a=ed25519; pk=pYXedPwrTtErcj7ERYeo/IpTrpe4QbJuEzSB52fslBg= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 14:12:32 -0700 (PDT) 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index d6c8eb2b5201..97a48e61e358 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h @@ -57,6 +57,16 @@ struct v4l2_m2m_dev; * @rdy_spinlock: spin lock to protect the struct usage * @num_rdy: number of buffers ready to be processed * @buffered: is the queue buffered? + * @ignore_streaming: Dictates whether the queue must be streaming for a job to + * be queued. + * This is useful, for example, when the driver requires to + * initialize the sequence with a firmware, where only a + * queued OUTPUT queue buffer and STREAMON on the OUTPUT + * queue is required to perform the anlysis of the bitstream + * header. + * This means the driver is responsible for implementing the + * job_ready callback correctly to make sure that requirements + * for actual decoding are met. * * Queue for buffers ready to be processed as soon as this * instance receives access to the device. @@ -69,6 +79,7 @@ struct v4l2_m2m_queue_ctx { spinlock_t rdy_spinlock; u8 num_rdy; bool buffered; + bool ignore_streaming; }; /** @@ -564,6 +575,12 @@ static inline void v4l2_m2m_set_dst_buffered(struct v4l2_m2m_ctx *m2m_ctx, m2m_ctx->cap_q_ctx.buffered = buffered; } +static inline void v4l2_m2m_set_dst_ignore_streaming(struct v4l2_m2m_ctx *m2m_ctx, + bool ignore_streaming) +{ + m2m_ctx->cap_q_ctx.ignore_streaming = ignore_streaming; +} + /** * v4l2_m2m_ctx_release() - release m2m context * -- 2.25.1