[PATCH 0/3] media: Add fdinfo support for v4l2 drivers
Detlev Casanova
detlev.casanova at collabora.com
Fri Jun 12 07:26:21 PDT 2026
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 driver, limited
to clock frequencies and HW usage time.
An example of usage of this from userspace is implemented in v4l2top:
https://github.com/cazou/v4l2top
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 at collabora.com>
---
Christopher Healy (2):
docs: media: add documentation for media client usage stats
media: hantro: add per-context fdinfo usage stats
Detlev Casanova (1):
media: v4l2: Add callback for show_fdinfo
.../userspace-api/media/drivers/index.rst | 1 +
.../media/drivers/media-usage-stats.rst | 84 ++++++++++++++++++++++
drivers/media/platform/verisilicon/hantro.h | 5 ++
drivers/media/platform/verisilicon/hantro_drv.c | 22 ++++++
drivers/media/v4l2-core/v4l2-dev.c | 10 +++
include/media/v4l2-dev.h | 1 +
6 files changed, 123 insertions(+)
---
base-commit: acb7500801e98639f6d8c2d796ed9f64cba83d3a
change-id: 20260610-v4l2-add-fdinfo-a790fceab329
Best regards,
--
Detlev Casanova <detlev.casanova at collabora.com>
More information about the Linux-rockchip
mailing list