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 0/5] Add manual request completion to the MediaTek VCodec driver
Date: Wed, 04 Jun 2025 16:09:34 -0400 [thread overview]
Message-ID: <20250604-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v3-0-603db4749d90@collabora.com> (raw)
This set introduces the manual request completion API by the author Hans
Verkuil and implements it within the MediaTek VCodec driver.
Why is this needed?
The VCodec driver supports a hardware containing two separate cores, the
CORE and the LAT, these are working in a serial manner without this
series. This series solves two issues, the first being that the current
code runs into a problem, that occurs when the last request object is
unbound from the request, before the v4l2_ctrl_request_complete function
is called, causing an implicit transition to the COMPLETE state.
This issues has been found in applications which didn't attach the
controls for the very first request (which is supposed to enable the
driver to sniff out the correct formats, etc.).
The second issue is that the VCodec driver can not utilize the full
performance of both cores, when the LAT core has to wait for the CORE
core to finishing processing the decode. Thus by enabling the LAT core
to process the next bitstream, right after processing the last we can
increase the performance of the driver.
With the manual request completion API, we can separate the
completion of the request objects of a request and from the completion
of the request itself, which allows to send a new bitstream after the
LAT core has processed the previous and while the CORE core decodes the
previous bitstream, so both cores can work in a parallel manner, but
while keeping the request alive during both steps.
A new state machine for the VCodec driver ensures, that all necessary
processing steps are handled in the correct order depending on the
current step in the execution. This state machine has been added to each
request to ensure that new requests do not alter the state of still
ongoing requests.
Additionally, this series adds a small patch to avoid trying to handle a
scenario, which is not supported by the hardware and thus runs into a
timeout.
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
---
Changes in v3:
- Patch 1: Applied suggested documentation fixes to the manual completion API
- Patch 4: Moved MTK VCODEC request helper into the decoder driver
- Patch 4: Matched MTK driver namespaces
- Patch 4: Set MTK request to CORE_DONE state if LAT failed
- Patch 4: Dropped Angelo's Rb, its better to review again
- Link to v2: https://lore.kernel.org/r/20250410-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v2-0-5b99ec0450e6@collabora.com
Changes in v2:
- The implementation patch for V1 was using an outdated version of the
"media: vcodec: Implement manual request completion" patch, update it
to the most recent one which doesn't use the state machine globally
but instead per request, thus having no conflicts between multiple
concurrent threads
- The kernel test robot found an issue because a function which I only
use locally was defined without the static keyword
- Link to v1: https://lore.kernel.org/r/20250314-sebastianfricke-vcodec_manual_request_completion_with_state_machine-v1-0-5e277a3d695b@collabora.com
---
Hans Verkuil (3):
media: mc: add manual request completion
media: vicodec: add support for manual completion
media: mc: add debugfs node to keep track of requests
Nicolas Dufresne (1):
media: mtk-vcodec: Don't try to decode 422/444 VP9
Sebastian Fricke (1):
media: vcodec: Implement manual request completion
drivers/media/mc/mc-device.c | 30 +++++
drivers/media/mc/mc-devnode.c | 5 +
drivers/media/mc/mc-request.c | 44 ++++++-
.../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 4 +-
.../mediatek/vcodec/decoder/mtk_vcodec_dec_drv.h | 29 ++++
.../vcodec/decoder/mtk_vcodec_dec_stateless.c | 146 ++++++++++++++++-----
drivers/media/test-drivers/vicodec/vicodec-core.c | 21 ++-
include/media/media-device.h | 9 ++
include/media/media-devnode.h | 4 +
include/media/media-request.h | 40 +++++-
10 files changed, 292 insertions(+), 40 deletions(-)
---
base-commit: 5e1ff2314797bf53636468a97719a8222deca9ae
change-id: 20250312-sebastianfricke-vcodec_manual_request_completion_with_state_machine-6362c7f80a14
Best regards,
--
Nicolas Dufresne <nicolas.dufresne@collabora.com>
next 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 Nicolas Dufresne [this message]
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 ` [PATCH v3 2/5] media: vicodec: add support for manual completion Nicolas Dufresne
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-0-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).