lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230915-wave5_v12_on_media_master-v12-1-92fc66cd685d@collabora.com>
Date:   Fri, 15 Sep 2023 23:11:30 +0200
From:   Sebastian Fricke <sebastian.fricke@...labora.com>
To:     Mauro Carvalho Chehab <mchehab@...nel.org>,
        Nas Chung <nas.chung@...psnmedia.com>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Fabio Estevam <festevam@...il.com>,
        Rob Herring <robh+dt@...nel.org>,
        Shawn Guo <shawnguo@...nel.org>,
        Philipp Zabel <p.zabel@...gutronix.de>,
        Jackson Lee <jackson.lee@...psnmedia.com>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        NXP Linux Team <linux-imx@....com>,
        Hans Verkuil <hverkuil@...all.nl>,
        Conor Dooley <conor+dt@...nel.org>,
        Pengutronix Kernel Team <kernel@...gutronix.de>
Cc:     devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        Sebastian Fricke <sebastian.fricke@...labora.com>,
        Robert Beckett <bob.beckett@...labora.com>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
        kernel@...labora.com,
        Nicolas Dufresne <nicolas.dufresne@...labora.com>
Subject: [PATCH v12 1/7] media: v4l2: Add ignore_streaming flag

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 <sebastian.fricke@...labora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@...labora.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.
  *
  * 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ