From: Detlev Casanova <detlev.casanova@collabora.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Nicolas Dufresne <nicolas.dufresne@collabora.com>,
Benjamin Gaignard <benjamin.gaignard@collabora.com>,
Philipp Zabel <p.zabel@pengutronix.de>,
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
Heiko Stuebner <heiko@sntech.de>,
linux-rockchip@lists.infradead.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rockchip@lists.infradead.org, kernel@collabora.com,
linux-arm-kernel@lists.infradead.org,
Christopher Healy <healych@amazon.com>,
Detlev Casanova <detlev.casanova@collabora.com>
Subject: Re: [PATCH v3 0/5] media: Add fdinfo support for v4l2 drivers
Date: Thu, 10 Sep 2026 10:38:15 -0400 [thread overview]
Message-ID: <xIs2E_YWS3GdsCX4z2DR3Q@collabora.com> (raw)
In-Reply-To: <20260706-v4l2-add-fdinfo-v3-0-d556568cf38e@collabora.com>
Hello !
Do you have any comment on this ?
Regards,
Detlev
On Monday, 6 July 2026 09:42:17 EDT Detlev Casanova wrote:
> fdinfo is useful to poll information from the driver.
> Unlike the ftrace interface, it lets userspace tools get a snapshot of
> the state of the driver at their own pace, instead of getting events for
> each driver status change.
>
> This works better to get information like HW usage time or clock
> frequencies, as well as memory usage.
> This patch set focuses on mem2mem drivers that are per-frame based and
> an implementation is proposed for the Verisilicon Hantro and Rockchip
> rkvdec drivers, limited to main clock frequency and HW usage time, as
> well as HW cycles counting in Hantro.
>
> Even though it is not used yet, per core fields are appended with
> `-<core_id>` to support multi-core drivers.
>
> To ease support in drivers, a v4l2_metrics struct is added.
> It stores metrics information and provides helper functions to write
> the fdinfo file in a standard way.
>
> An example of usage of this from userspace is implemented in v4l2top:
>
> https://github.com/cazou/v4l2top (Check the upstream branch)
>
> checkpatch.pl warning: The 2 arguments in the show_fdinfo callback
> definition are kept unnamed to match with the rest of the struct
> definition.
>
> Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
> ---
> Changes in v3:
> - Rename the fdinfo key prefix from "media-" to "v4l2-", and "stats" to
> "metrics"
> - Restructure the documentation to have mandatory and optional keys
> - Add core ID to fields
> - Add HW cycles count support
> - Add ABI documentation
> - Link to v2:
> https://patch.msgid.link/20260617-v4l2-add-fdinfo-v2-0-d298e98ce06a@collabo
> ra.com
>
> Changes in v2:
> - Simplify key/value pairs by removing repeated <eng> suffix
> - Add media type support
> - Add v4l2_stats helpers
> - Add support in rkvdec too
> - Link to v1:
> https://patch.msgid.link/20260612-v4l2-add-fdinfo-v1-0-723211abc861@collabo
> ra.com
>
> To: Mauro Carvalho Chehab <mchehab@kernel.org>
> To: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> To: Benjamin Gaignard <benjamin.gaignard@collabora.com>
> To: Philipp Zabel <p.zabel@pengutronix.de>
> To: Detlev Casanova <detlev.casanova@collabora.com>
> To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
> To: Heiko Stuebner <heiko@sntech.de>
> Cc: kernel@collabora.com
> Cc: linux-media@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-rockchip@lists.infradead.org
> Cc: linux-arm-kernel@lists.infradead.org
>
> ---
> Christopher Healy (2):
> docs: media: add documentation for V4L2 driver usage metrics
> media: hantro: Add per-context fdinfo usage metrics
>
> Detlev Casanova (3):
> media: v4l2: Add callback for show_fdinfo
> media: v4l2-core: Add v4l2-metrics interface
> media: rkvdec: Add per-context fdinfo usage metrics
>
> Documentation/ABI/testing/procfs-fdinfo-v4l2 | 129
> +++++++++++++++++++ .../userspace-api/media/drivers/index.rst |
> 1 +
> .../media/drivers/v4l2-usage-metrics.rst | 137
> +++++++++++++++++++++ drivers/media/platform/rockchip/rkvdec/rkvdec.c |
> 19 +++
> drivers/media/platform/rockchip/rkvdec/rkvdec.h | 1 +
> drivers/media/platform/verisilicon/hantro.h | 3 +
> drivers/media/platform/verisilicon/hantro_drv.c | 19 +++
> drivers/media/platform/verisilicon/hantro_hw.h | 1 +
> .../platform/verisilicon/rockchip_vpu981_regs.h | 1 +
> .../media/platform/verisilicon/rockchip_vpu_hw.c | 6 +
> drivers/media/v4l2-core/Makefile | 2 +-
> drivers/media/v4l2-core/v4l2-dev.c | 12 ++
> drivers/media/v4l2-core/v4l2-fh.c | 3 +
> drivers/media/v4l2-core/v4l2-metrics.c | 78 ++++++++++++
> include/media/v4l2-dev.h | 1 +
> include/media/v4l2-fh.h | 2 +
> include/media/v4l2-metrics.h | 47 +++++++
> 17 files changed, 461 insertions(+), 1 deletion(-)
> ---
> base-commit: 3c587e0b08bd3c4853a22792b9166b7457870165
> change-id: 20260610-v4l2-add-fdinfo-a790fceab329
>
> Best regards,
> --
> Detlev Casanova <detlev.casanova@collabora.com>
>
>
> _______________________________________________
> Linux-rockchip mailing list
> Linux-rockchip@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-rockchip
prev parent reply other threads:[~2026-09-10 14:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 13:42 Detlev Casanova
2026-07-06 13:42 ` [PATCH v3 1/5] media: v4l2: Add callback for show_fdinfo Detlev Casanova
2026-07-06 13:42 ` [PATCH v3 2/5] docs: media: add documentation for V4L2 driver usage metrics Detlev Casanova
2026-07-06 13:42 ` [PATCH v3 3/5] media: v4l2-core: Add v4l2-metrics interface Detlev Casanova
2026-07-06 13:42 ` [PATCH v3 4/5] media: hantro: Add per-context fdinfo usage metrics Detlev Casanova
2026-07-06 13:42 ` [PATCH v3 5/5] media: rkvdec: " Detlev Casanova
2026-09-10 14:38 ` Detlev Casanova [this message]
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=xIs2E_YWS3GdsCX4z2DR3Q@collabora.com \
--to=detlev.casanova@collabora.com \
--cc=benjamin.gaignard@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=healych@amazon.com \
--cc=heiko@sntech.de \
--cc=kernel@collabora.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=p.zabel@pengutronix.de \
/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®