From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil@xs4all.nl>,
Tiffany Lin <tiffany.lin@mediatek.com>,
Andrew-CT Chen <andrew-ct.chen@mediatek.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, kernel@collabora.com,
linux-media@vger.kernel.org,
Sebastian Fricke <sebastian.fricke@collabora.com>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Hans Verkuil <hverkuil@xs4all.nl>
Subject: [PATCH v3 2/5] media: vicodec: add support for manual completion
Date: Wed, 04 Jun 2025 16:09:36 -0400 [thread overview]
Message-ID: <20250604-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v3-2-603db4749d90@collabora.com> (raw)
In-Reply-To: <20250604-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v3-0-603db4749d90@collabora.com>
From: Hans Verkuil <hverkuil@xs4all.nl>
Manually complete the requests: this tests the manual completion
code.
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
drivers/media/test-drivers/vicodec/vicodec-core.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/media/test-drivers/vicodec/vicodec-core.c b/drivers/media/test-drivers/vicodec/vicodec-core.c
index c45f5cf12ded3c8b57483b148bf7bbffb8a458c5..88cb6e6a713f08bd4f412ca2940b1309bb87513b 100644
--- a/drivers/media/test-drivers/vicodec/vicodec-core.c
+++ b/drivers/media/test-drivers/vicodec/vicodec-core.c
@@ -448,8 +448,10 @@ static void device_run(void *priv)
ctx->comp_magic_cnt = 0;
ctx->comp_has_frame = false;
spin_unlock(ctx->lock);
- if (ctx->is_stateless && src_req)
+ if (ctx->is_stateless && src_req) {
v4l2_ctrl_request_complete(src_req, &ctx->hdl);
+ media_request_manual_complete(src_req);
+ }
if (ctx->is_enc)
v4l2_m2m_job_finish(dev->stateful_enc.m2m_dev, ctx->fh.m2m_ctx);
@@ -1525,8 +1527,12 @@ static void vicodec_return_bufs(struct vb2_queue *q, u32 state)
vbuf = v4l2_m2m_dst_buf_remove(ctx->fh.m2m_ctx);
if (vbuf == NULL)
return;
- v4l2_ctrl_request_complete(vbuf->vb2_buf.req_obj.req,
- &ctx->hdl);
+ if (ctx->is_stateless && V4L2_TYPE_IS_OUTPUT(q->type)) {
+ struct media_request *req = vbuf->vb2_buf.req_obj.req;
+
+ v4l2_ctrl_request_complete(req, &ctx->hdl);
+ media_request_manual_complete(req);
+ }
spin_lock(ctx->lock);
v4l2_m2m_buf_done(vbuf, state);
spin_unlock(ctx->lock);
@@ -1679,6 +1685,7 @@ static void vicodec_buf_request_complete(struct vb2_buffer *vb)
struct vicodec_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
v4l2_ctrl_request_complete(vb->req_obj.req, &ctx->hdl);
+ media_request_manual_complete(vb->req_obj.req);
}
@@ -2010,6 +2017,12 @@ static int vicodec_request_validate(struct media_request *req)
return vb2_request_validate(req);
}
+static void vicodec_request_queue(struct media_request *req)
+{
+ media_request_mark_manual_completion(req);
+ v4l2_m2m_request_queue(req);
+}
+
static const struct v4l2_file_operations vicodec_fops = {
.owner = THIS_MODULE,
.open = vicodec_open,
@@ -2030,7 +2043,7 @@ static const struct video_device vicodec_videodev = {
static const struct media_device_ops vicodec_m2m_media_ops = {
.req_validate = vicodec_request_validate,
- .req_queue = v4l2_m2m_request_queue,
+ .req_queue = vicodec_request_queue,
};
static const struct v4l2_m2m_ops m2m_ops = {
--
2.49.0
next prev parent reply other threads:[~2025-06-04 20:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-04 20:09 [PATCH v3 0/5] Add manual request completion to the MediaTek VCodec driver Nicolas Dufresne
2025-06-04 20:09 ` [PATCH v3 1/5] media: mc: add manual request completion Nicolas Dufresne
2025-06-04 21:04 ` Sakari Ailus
2025-06-04 23:19 ` Nicolas Dufresne
2025-06-05 6:51 ` Sakari Ailus
2025-06-05 9:37 ` Hans Verkuil
2025-06-05 9:48 ` Sakari Ailus
2025-06-05 12:41 ` Nicolas Dufresne
2025-06-09 9:42 ` Sakari Ailus
2025-06-09 9:49 ` Hans Verkuil
2025-06-04 20:09 ` Nicolas Dufresne [this message]
2025-06-04 20:09 ` [PATCH v3 3/5] media: mc: add debugfs node to keep track of requests Nicolas Dufresne
2025-06-04 21:33 ` Sakari Ailus
2025-06-04 23:08 ` Nicolas Dufresne
2025-06-09 10:28 ` Sakari Ailus
2025-06-09 10:46 ` Hans Verkuil
2025-06-04 20:09 ` [PATCH v3 4/5] media: vcodec: Implement manual request completion Nicolas Dufresne
2025-06-11 8:33 ` AngeloGioacchino Del Regno
2025-06-04 20:09 ` [PATCH v3 5/5] media: mtk-vcodec: Don't try to decode 422/444 VP9 Nicolas Dufresne
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=20250604-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v3-2-603db4749d90@collabora.com \
--to=nicolas.dufresne@collabora.com \
--cc=andrew-ct.chen@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=hverkuil@xs4all.nl \
--cc=kernel@collabora.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=sebastian.fricke@collabora.com \
--cc=tiffany.lin@mediatek.com \
--cc=yunfei.dong@mediatek.com \
/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;
as well as URLs for NNTP newsgroup(s).