Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp38090826rwd; Wed, 12 Jul 2023 02:59:01 -0700 (PDT) X-Google-Smtp-Source: APBJJlGGeRmz3SnlusgAZt3DqnvhsWdtE3jS3FknNLzMfN2rILTR+FhF32J0st32Iru41z25DsUm X-Received: by 2002:a05:6a20:160b:b0:132:cef1:bd33 with SMTP id l11-20020a056a20160b00b00132cef1bd33mr1408467pzj.0.1689155941393; Wed, 12 Jul 2023 02:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689155941; cv=none; d=google.com; s=arc-20160816; b=mLllfW+irPglKc8qw1N1yoVZz1lkuuiUVIihbknYlKXSNucKWa5I3V0C4YflkPsDo8 mqRekCVsjPZv9rIvDtuvuoPkho2IWg2nYkV6uuC67W+XJmZ/ZYYVoe07+MyYzwy+pxOx ZRN/hR0rF+EDN3wasnNSn0rdx+zOX8tC+vfVxIhO6x/7F0h/Vw43ZLkByYA0gC9GUyiE gzzQyx9pzGUpdmlfd9Wlarn+AURHTXDLRpkPQt209R2kzRwjO2T09si+zPDzlnu+oidT mXOHKPeR8kMvWNmNV1rNlQEAPzgxOtmaHM50r9HPAuoPC9RlaQuYz8QzzZY/UaGdlfXd etOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=bQnl72R0spsZYcBoI4wCFzcXmEugK/BYxGs2uCdUKEk=; fh=04UiLLMU0ByaDpwd2LtT3+kGLriJNhuUJt/60oZdS4E=; b=MWQYzWcTe+1qDpKOKUmNTqMwbMDC8+4hzHsSd35A25UrkQ3LLpKKdt68wn6Esmhijq AFTx6QHQFF9UHH+W1IaMRirUvIhQR9cY7gpm96/MXfhCyZdPolJKGrDGN6sXRiV6FDUq 9kcie1daHafiKMR0/PJFyh9Sr2//lrF7Bc5bsYMA1tx2qglUyJXJRwUKIdBDKbLS2EWP CArG6nNMu4hne2pFg8YZLaW3nXB8bgmZzoOIeS76420/tjz++AXnpdX3YDGEy1J/hPTW ebg88mvR7sBXAEGvRmz7xyWUF/+puQTw32PIXXGQm3QPSv/XhdANGuCFODp9MzDXLdzk x0gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jmuQENJe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020aa78805000000b0068050054196si2882992pfo.299.2023.07.12.02.58.49; Wed, 12 Jul 2023 02:59:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jmuQENJe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233122AbjGLJbg (ORCPT + 99 others); Wed, 12 Jul 2023 05:31:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233159AbjGLJbe (ORCPT ); Wed, 12 Jul 2023 05:31:34 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79B3310CF for ; Wed, 12 Jul 2023 02:31:33 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-1b8ad8383faso49646685ad.0 for ; Wed, 12 Jul 2023 02:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689154293; x=1691746293; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=bQnl72R0spsZYcBoI4wCFzcXmEugK/BYxGs2uCdUKEk=; b=jmuQENJe+eL4GRUs6ocxCP5//2NiNoeXLcpRr+rdANFE3W/FMFVXeGBj/mQUViFiut NpH6Km2WNEowdr78Y3Fq0hFNAjlxdjlbZFhnU2sRxjqKg5oSNJkzJ/PtptCHubDfCEor gh4gPqiYmD/B/Pn/qnnIfAfwjSyFYYYdjMpSY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689154293; x=1691746293; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bQnl72R0spsZYcBoI4wCFzcXmEugK/BYxGs2uCdUKEk=; b=SFqrACz1vBfkL4x5eJN/DWG00/KD5PIhJ6HBaIiHi5xyVSQKZU8LCROmeOZfIGOAAl yZQ2FYkjJPxcyLGtkW1+zQ42/c/wVE9Omm3BIG2Ax2leWBTdSmJHxqEY57VS05n2oG1t CsNq1HZFWMilKhvhKdSroly5MwLYtotjBgkVmouMG+JMxZcuZ88j32geZmQz3zC9TYJz QquCczS7+RFE4xUVBIFaO/8b8i0c5/NBmNykN9ipeDYN8uPenr8TkDKUQ4BJyfbpMXlL ix4W4UFHYeKWGJEK+Lny0BRRamO/Vx2gUixk6Y9jPg0pWgOOwGJXwrQPHZsHfY+HrXcy 5hDQ== X-Gm-Message-State: ABy/qLbJBXv6NhQ1BYD6czpp1E1gUSFgm9GTrtzTraMK1ETMi1UAEPBo NIzQ/3YfCxDBcZLg/LooWAtTFA== X-Received: by 2002:a17:902:b110:b0:1b6:76ee:190b with SMTP id q16-20020a170902b11000b001b676ee190bmr16031494plr.35.1689154292849; Wed, 12 Jul 2023 02:31:32 -0700 (PDT) Received: from chromium.org (0.223.81.34.bc.googleusercontent.com. [34.81.223.0]) by smtp.gmail.com with ESMTPSA id b14-20020a170902b60e00b001ac591b0500sm3478696pls.134.2023.07.12.02.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 02:31:32 -0700 (PDT) Date: Wed, 12 Jul 2023 09:31:29 +0000 From: Tomasz Figa To: Nicolas Dufresne Cc: Hsia-Jun Li , linux-media@vger.kernel.org, ayaka@soulik.info, hans.verkuil@cisco.com, mchehab@kernel.org, laurent.pinchart@ideasonboard.com, hiroh@chromium.org, hverkuil@xs4all.nl, linux-kernel@vger.kernel.org, Sebastian Fricke Subject: Re: [PATCH 1/2] [RESEND] media: v4l2-mem2mem: allow device run without buf Message-ID: <20230712093129.pdcbvlxd5zphwr5m@chromium.org> References: <20230704040044.681850-1-randy.li@synaptics.com> <20230704040044.681850-2-randy.li@synaptics.com> <20452e233a9a4b39b58139081d818d3b1454105a.camel@ndufresne.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20452e233a9a4b39b58139081d818d3b1454105a.camel@ndufresne.ca> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Fri, Jul 07, 2023 at 03:14:23PM -0400, Nicolas Dufresne wrote: > Hi Randy, > > Le mardi 04 juillet 2023 ? 12:00 +0800, Hsia-Jun Li a ?crit?: > > From: Randy Li > > > > For the decoder supports Dynamic Resolution Change, > > we don't need to allocate any CAPTURE or graphics buffer > > for them at inital CAPTURE setup step. > > > > We need to make the device run or we can't get those > > metadata. > > > > Signed-off-by: Randy Li > > --- > > drivers/media/v4l2-core/v4l2-mem2mem.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c > > index 0cc30397fbad..c771aba42015 100644 > > --- a/drivers/media/v4l2-core/v4l2-mem2mem.c > > +++ b/drivers/media/v4l2-core/v4l2-mem2mem.c > > @@ -301,8 +301,9 @@ static void __v4l2_m2m_try_queue(struct v4l2_m2m_dev *m2m_dev, > > > > dprintk("Trying to schedule a job for m2m_ctx: %p\n", m2m_ctx); > > > > - if (!m2m_ctx->out_q_ctx.q.streaming > > - || !m2m_ctx->cap_q_ctx.q.streaming) { > > + if (!(m2m_ctx->out_q_ctx.q.streaming || m2m_ctx->out_q_ctx.buffered) > > + || !(m2m_ctx->cap_q_ctx.q.streaming > > + || m2m_ctx->cap_q_ctx.buffered)) { > > I have a two atches with similar goals in my wave5 tree. It will be easier to > upstream with an actual user, though, I'm probably a month or two away from > submitting this driver again. > > https://gitlab.collabora.com/chipsnmedia/kernel/-/commit/ac59eafd5076c4deb3bfe1fb85b3b776586ef3eb > https://gitlab.collabora.com/chipsnmedia/kernel/-/commit/5de4fbe0abb20b8e8d862b654f93e3efeb1ef251 > While I'm not going to NAK this series or those 2 patches if you send them, I'm not really convinced that adding more and more complexity to the mem2mem helpers is a good idea, especially since all of those seem to be only needed by stateful video decoders. The mem2mem framework started as a set of helpers to eliminate boiler plate from simple drivers that always get 1 CAPTURE and 1 OUTPUT buffer, run 1 processing job on them and then return both of the to the userspace and I think it should stay like this. I think we're strongly in need of a stateful video decoder framework that would actually address the exact problems that those have rather than bending something that wasn't designed with them in mind to work around the differences. Best regards, Tomasz > Sebastien and I authored this without giving it much thought, but we believe > this massively simplify our handling of DRC (dynamic resolution change). > > The main difference, is that we added ignore_streaming to the ctx, so that > drivers can opt-in the mode of operation. Thinking it would avoid any potential > side effects in drivers that aren't prepared to that. We didn't want to tied it > up to buffered, this is open to discussion of course, we do use buffered on both > queues and use a slightly more advance job_ready function, that take into > account our driver state. > > In short, Sebastien and I agree this small change is the right direction, we > simply have a different implementation. I can send it as RFC if one believe its > would be useful now (even without a user). > > > dprintk("Streaming needs to be on for both queues\n"); > > return; > > } >