From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sebastian Fricke <sebastian.fricke@collabora.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Nas Chung <nas.chung@chipsnmedia.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>,
Rob Herring <robh+dt@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Jackson Lee <jackson.lee@chipsnmedia.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
NXP Linux Team <linux-imx@nxp.com>,
Conor Dooley <conor+dt@kernel.org>,
Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Robert Beckett <bob.beckett@collabora.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@collabora.com,
Nicolas Dufresne <nicolas.dufresne@collabora.com>
Subject: Re: [PATCH v12 1/7] media: v4l2: Add ignore_streaming flag
Date: Wed, 20 Sep 2023 14:59:05 +0200 [thread overview]
Message-ID: <a3c61e5a-e5cb-43d5-a3dc-80806f8da672@xs4all.nl> (raw)
In-Reply-To: <20230915-wave5_v12_on_media_master-v12-1-92fc66cd685d@collabora.com>
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 <sebastian.fricke@collabora.com>
> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
> 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.
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.
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.
> *
> * 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
> *
>
next prev parent reply other threads:[~2023-09-20 12:59 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-15 21:11 [PATCH v12 0/7] Wave5 codec driver Sebastian Fricke
2023-09-15 21:11 ` [PATCH v12 1/7] media: v4l2: Add ignore_streaming flag Sebastian Fricke
2023-09-20 12:59 ` Hans Verkuil [this message]
2023-09-20 14:08 ` Nicolas Dufresne
2023-09-20 14:49 ` Hans Verkuil
2023-09-21 18:39 ` Nicolas Dufresne
2023-09-22 8:28 ` Hans Verkuil
2023-09-22 20:20 ` Nicolas Dufresne
2023-09-25 9:03 ` Hans Verkuil
2023-09-15 21:11 ` [PATCH v12 2/7] media: v4l2: Allow M2M job queuing w/o streaming CAP queue Sebastian Fricke
2023-09-15 21:11 ` [PATCH v12 3/7] media: platform: chips-media: Move Coda to separate folder Sebastian Fricke
2023-09-15 21:11 ` [PATCH v12 4/7] media: chips-media: wave5: Add vpuapi layer Sebastian Fricke
2023-09-25 11:35 ` Benjamin Gaignard
2023-09-15 21:11 ` [PATCH v12 5/7] media: chips-media: wave5: Add the v4l2 layer Sebastian Fricke
2023-09-15 21:22 ` Sebastian Fricke
2023-09-16 20:55 ` Ivan Bornyakov
2023-09-20 15:13 ` Hans Verkuil
2023-09-21 19:11 ` Nicolas Dufresne
2023-09-22 7:33 ` Hans Verkuil
2023-09-26 23:29 ` Nicolas Dufresne
2023-09-27 7:19 ` Hans Verkuil
2023-10-02 23:51 ` Deborah Brouwer
2023-10-03 6:54 ` Hans Verkuil
2023-09-15 21:11 ` [PATCH v12 6/7] dt-bindings: media: wave5: add yaml devicetree bindings Sebastian Fricke
2023-09-15 22:16 ` Rob Herring
2023-09-17 7:56 ` Krzysztof Kozlowski
2023-09-18 6:49 ` Sebastian Fricke
2023-09-18 12:02 ` Krzysztof Kozlowski
2023-09-18 19:16 ` Nicolas Dufresne
2023-09-18 20:14 ` Krzysztof Kozlowski
2023-09-15 21:11 ` [PATCH v12 7/7] media: chips-media: wave5: Add wave5 driver to maintainers file Sebastian Fricke
2023-09-20 13:02 ` Hans Verkuil
2023-09-20 15:32 ` Sebastian Fricke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a3c61e5a-e5cb-43d5-a3dc-80806f8da672@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=bob.beckett@collabora.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=jackson.lee@chipsnmedia.com \
--cc=kernel@collabora.com \
--cc=kernel@pengutronix.de \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nas.chung@chipsnmedia.com \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sebastian.fricke@collabora.com \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®