Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1092984rdh; Mon, 25 Sep 2023 03:07:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdp1SaCaGv3oX4eirh0ECfJr0+qE53I70dN/Bpxi55NCl2nrgBFVwsUqrku6YZX2pZeg5z X-Received: by 2002:a05:6870:1715:b0:1dc:a055:8587 with SMTP id h21-20020a056870171500b001dca0558587mr9190874oae.6.1695636424819; Mon, 25 Sep 2023 03:07:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695636424; cv=none; d=google.com; s=arc-20160816; b=zV6CreMo8F6gTB1p8kRZ4b7toy4yUC3TpG6WVhBMA3GKmUB+tXEWjv6CQu+FZNSgTv tXHHyWdC5Im8q0GBfwTlcYdm+Gvxc72GjlFt5sFR4sC4BCRONYpfOIe1abcQczPdzHsp C31MbNHYw15VHXegj9Z6D7Tw9aLUIxvAbc4KV/MEVp96FqinHyjjTLXW766sxp5/ElRG MbaDmSJAUBNQhChY1OX8jGLAVR0VNSgvUiZqSl043EycKWdxJtaZtEwlvB+mG/d+1AHu RaT7+heaOy36F4/3zmPPjt9GFM2TXA6a5+I9e4seG5pEyAxMQoSfXtLyW2UPkceZRC7/ LdEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=POzXFbVvUvkIFlmHbTH1eCZng1IhAVoIOQ5lfEptOcQ=; fh=nJQBAU5/iZPN7Og1gGbI+wig8XcY4LJPI8AfKwpv5zE=; b=ep0sGF5bBQe7Gfp7xGMzqjHQOSSOWL3N5eafKY9hmIl3/5FqQrjoo7FUdEaIdU6zJU oq6W3j9u3UOLjw8PSLyh2N5NjL/7wKqj90Ak8/9FFBQsS/TrC19n01bhcjYO+3taFt0X gvelizOXpZQE7fJw8qPhBlwUNa3q2dXOcOA8noZ4p9PZt3YYdU35utAy6PSyrL/QwfEj /WGb758yrf/rCl3w5sQY7RDfjA+2m1LttGVXS3kg5mH0fX8Ngd4+fvIt4erngG9z9eNK 9rV9wTn1HBoMOqJVAJwr4ph2fKTO5wK5M7DdGn+EH1JJ7FSF2wSldPq3HMw4VvrCe+Ak EZsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id s20-20020a632c14000000b00578dff7fccbsi9505247pgs.137.2023.09.25.03.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 03:07:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 884BD80293D1; Mon, 25 Sep 2023 02:03:29 -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 S233163AbjIYJDY (ORCPT + 99 others); Mon, 25 Sep 2023 05:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232970AbjIYJDX (ORCPT ); Mon, 25 Sep 2023 05:03:23 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 808C6DA; Mon, 25 Sep 2023 02:03:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D32FC433BA; Mon, 25 Sep 2023 09:03:11 +0000 (UTC) Message-ID: Date: Mon, 25 Sep 2023 11:03:09 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v12 1/7] media: v4l2: Add ignore_streaming flag Content-Language: en-US, nl To: Nicolas Dufresne , Sebastian Fricke , Mauro Carvalho Chehab , Nas Chung , Sascha Hauer , Fabio Estevam , Rob Herring , Shawn Guo , Philipp Zabel , Jackson Lee , Krzysztof Kozlowski , NXP Linux Team , Conor Dooley , Pengutronix Kernel Team Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Robert Beckett , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com, Tomasz Figa References: <20230915-wave5_v12_on_media_master-v12-0-92fc66cd685d@collabora.com> <20230915-wave5_v12_on_media_master-v12-1-92fc66cd685d@collabora.com> <179e88f04257f21b6b723e935231de70415b3301.camel@collabora.com> <522e5f3bd4f43a5718ae88133b8d5d187c470f74.camel@collabora.com> <2ada3256-2aa0-41e0-bac6-989a20131309@xs4all.nl> <27bcd2cf21688b1120fcc75c38981f8585e8f9bd.camel@collabora.com> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BO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6xuYbGxXDrpN7dXCOH92fscLodZqZtK5FtbLvO572EPfxneY UT7JzDc/5LT9cFFugTMOhq1BG62vUm/F6V91+unyp4dRlyryAeqEuISykhvjZCVHk/woaMZv c1Dm4Uvkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== In-Reply-To: <27bcd2cf21688b1120fcc75c38981f8585e8f9bd.camel@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,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]); Mon, 25 Sep 2023 02:03:31 -0700 (PDT) On 22/09/2023 22:20, Nicolas Dufresne wrote: > Le vendredi 22 septembre 2023 à 10:28 +0200, Hans Verkuil a écrit : >> On 21/09/2023 20:39, Nicolas Dufresne wrote: >>> Le mercredi 20 septembre 2023 à 16:49 +0200, Hans Verkuil a écrit : >>>> On 20/09/2023 16:08, Nicolas Dufresne wrote: >>>>> cc Tomasz Figa >>>>> >>>>> Le mercredi 20 septembre 2023 à 14:59 +0200, Hans Verkuil a écrit : >>>>>> On 15/09/2023 23:11, Sebastian Fricke wrote: >>>>>>> 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 >>>>>> >>>>>> able, to -> able to >>>>>> >>>>>>> sequence to ensure, that userspace prepares the CAPTURE queue correctly. >>>>>> >>>>>> ensure, that -> ensure that >>>>>> >>>>>>> >>>>>>> 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. >>>>>> >>>>>> This is a bad description and field name. >>>>> >>>>> I wonder what's your opinion about the buffered one then :-D >>>> >>>> Even worse :-) >>>> >>>> I still don't really understand what that does. Patches welcome. >>>> >>>>> >>>>>> >>>>>> Basically what this field does is that, if true, the streaming state of the >>>>>> capture queue is ignored. So just call it that: ignore_cap_streaming. >>>>>> >>>>>> And explain that, if true, job_ready() will be called even if the capture >>>>>> queue is not streaming, and that that can be used to allow hardware to >>>>>> analyze the bitstream header that arrives on the OUTPUT queue. >>>>> >>>>> Ack. >>>>> >>>>>> >>>>>> Also, doesn't this field belong to struct v4l2_m2m_ctx? It makes no sense >>>>>> for the output queue, this is really a configuration for the m2m context as >>>>>> a whole. >>>>> >>>>> Unless we come up with a completely new type of M2M that can behave like a gap >>>>> filler (like a video rate m2m), it indeed makes no sense for output. I'm just >>>>> illustrating that this is true "now" but someone can come up with valid >>>>> expectation. So I agree with you, we can move it up in the hierarchy. >>>>> >>>>> Recently over IRC and other threads, Tomasz raised a concern that CODECs where >>>>> introducing too much complexity into M2M. And I believe buffered (which is >>>>> barely documented) and this mechanism was being pointed. >>>>> >>>>> My take on that is that adding boolean configuration is what introduce >>>>> complexity, and we can fix it by doing less in the m2m. After this discussion, I >>>>> came with the idea that we should remove buffered and ignore_streaming. For >>>>> drivers that don't implement job_ready, this logic would be moved inside the >>>>> default implementation. We can then add a helper to check the common conditions. >>>>> >>>>> The alternative suggested by Tomasz, was to layer two ops. We'd have a >>>>> device_ready() ops and its default implementation would include the check we >>>>> have and would call job_ready(). Personally, I'd rather remove then add, but I >>>>> understadt the reasoning and would be fine committing to that instead. >>>>> >>>>> I'd like your feedback on this proposal. If this is something we want, I'll do >>>>> this prior to V13, otherwise we will address your comments and fix the added >>>>> mechanism. I think though that we agree that for decoders, this is nice addition >>>>> to not have to trigger work manually from vb2 ops. >>>> >>>> It comes down to a matter of taste, I guess. I personally think that using bools >>>> to tweak the behavior of a framework does not necessarily increase complexity, >>>> provided it is clearly documented what it does and why it is needed. >>>> >>>> I think an ignore_cap_streaming bool is pretty straightforward and has minimal >>>> impact in the code. As long as there are good comments. >>> >>> So for wave5 we will opt for this and apply your suggested changes. And I may >>> come back later on the subject. >>> >>>> >>>> The 'buffered' flag is were this clearly failed completely, since I couldn't figure >>>> out what it is supposed to do. But that is not because it makes the code more >>>> complex, it is just because of shoddy documentation and naming. >>>> >>>> Quite often implementing tweaks like that are quite easy in a framework, since >>>> you have all the information readily available. In a driver it can quickly become >>>> messy. >>> >>> In this case, "buffered" is used to disable the checks for having at least one >>> buffer in the ready queues. In most cases, if you don't have at least 1 pending >>> capture and 1 pending output buffer, there is no point in calling device_run. >> >> So it is really similar to ignore_cap_streaming: that relaxes the streaming test, >> and 'buffered' relaxes the 'must have at least one capture and output buffer ready' >> test. >> >> So this should be renamed to: allow_empty_queues >> >> Although I would prefer to split this into two bools: allow_empty_capture_queue and >> allow_empty_output_queue. It is more flexible that way and I actually think it is >> easier to understand. > > Its on the queue ctx, so it does not have to be typed. It would have to be typed > if moved to m2m ctx. Oops, I missed that. I'm not actually sure that's where it should be. If you support flags that tweak the behavior, then put them together in a single place, and not all over. Regards, Hans > >> >> I see also see in the v4l2-mem2mem.c source that the debug messages are very poorly >> worded: >> src = v4l2_m2m_next_src_buf(m2m_ctx); >> >> if (!src && !m2m_ctx->out_q_ctx.buffered) { >> dprintk("No input buffers available\n"); >> goto job_unlock; >> } >> >> This should be either "source buffers" or "output buffers", but definitely not >> "input buffers". >> >> Ditto for the dst part. > > Indeed, I'll store this node somewhere for future work on the framework, this is > not strictly related to wave5 anymore. > >> >>> >>> In reality, drivers will add use case specific checks in their job_ready() >>> implementation. For decoders, the cases I can think of are: >>> >>> - On capture if you haven't parsed the stream header >>> - On capture if the driver removes them from ready queue as a way to track which >>> one are considered free and may be used at any time by the firmware >>> - On output queue, if you need device_run() to be called to complete the drain >>> the reorder queue >>> >>> Yet, you want this check after stream headers are parsed, or whenever a new >>> bitstream decode operation is to be queued in the firmware. So this check gets >>> re-implemented, but dynamically, in all decoders. >>> >>> Deinterlacers may needs this too with some algorithms (the one that introduce >>> delays at least). Its not clear to me why it was called buffered, >>> ignore_rdy_queue might have been an option, though I'm not fully confident. Note >>> that M2M can be confusing, since whenever you ask for last something, its always >>> relative to the ready queue, and may not make a lot of sense in the context it >>> is used. >>> >>>> >>>> For codec support there are a number of issues that increase complexity: >>>> implementing support for the LAST flag and events, and supporting buffers >>>> that can be held. Especially since driver implementations tend to vary. >>>> >>>> I've been experimenting with some cleanups and changes in v4l2-mem2mem.c >>>> (https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=enc-dec-cmd), mainly >>>> surrounding the handling of the LAST flag. Note: this is failing the compliance >>>> tests, I haven't had the time to pursue this further. >>>> >>>> I'm not sure whether the best approach is to move things out of the m2m framework, >>>> or move things into the m2m framework, or add a more codec-specific layer on top >>>> of the m2m framework, or a combination of all of these. >>>> >>>> It is something that needs experimentation, just see what works. >>> >>> I can see you have omitted mark_stopped() calles when refactoring, which makes >>> these patches change the behaviour. Could be related. >> >> Could be. I hope to be able to spend a bit of time on this today. >> >>> >>> This is no longer strictly related to this patch, but I think cmd_stop() >>> implementation (even after your changes) are miss-fit for driver that speaks to >>> firmware. As the firmware is being made aware of the free buffers, you can't >>> just cherry-pick from the capture queue, you have to synchronise your state with >>> the firmware while draining. The helper should be split in two parts I suppose, >>> but cutting the line isn't easy. >>> >>> Thread safe usage of the numerous boolean implicated in the draining state is >>> also difficult. There is no other option then introduce a mutex or spinlock (if >>> the state is needed in job_ready() implementation) to make this thread safe and >>> reliable. >> >> Regards, >> >> Hans >> >>> >>>> >>>> But for this specific flag: I think it is fine to put that in the m2m framework, >>>> just document and name it well. >>> >>> Ack. >>> >>>> >>>> Regards, >>>> >>>> Hans >>>> >>>>> >>>>> regards, >>>>> Nicolas >>>>> >>>>>> >>>>>>> * >>>>>>> * 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; >>>>>>> +} >>>>>>> + >>>>>> >>>>>> I think this is overkill, esp. when the field is moved to m2m_ctx. Just clearly >>>>>> document that drivers can set this. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Hans >>>>>> >>>>>>> /** >>>>>>> * v4l2_m2m_ctx_release() - release m2m context >>>>>>> * >>>>>>> >>>>>> >>>>> >>>> >>> >> >