mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] media: Add fdinfo support for v4l2 drivers
@ 2026-06-12 14:26 Detlev Casanova
  2026-06-12 14:26 ` [PATCH 1/3] media: v4l2: Add callback for show_fdinfo Detlev Casanova
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Detlev Casanova @ 2026-06-12 14:26 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Nicolas Dufresne, Benjamin Gaignard,
	Philipp Zabel
  Cc: linux-media, linux-kernel, linux-rockchip, kernel,
	Detlev Casanova, Christopher Healy

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@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@collabora.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-12 17:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-12 14:26 [PATCH 0/3] media: Add fdinfo support for v4l2 drivers Detlev Casanova
2026-06-12 14:26 ` [PATCH 1/3] media: v4l2: Add callback for show_fdinfo Detlev Casanova
2026-06-12 14:26 ` [PATCH 2/3] docs: media: add documentation for media client usage stats Detlev Casanova
2026-06-12 14:26 ` [PATCH 3/3] media: hantro: add per-context fdinfo " Detlev Casanova
2026-06-12 15:18   ` Nicolas Dufresne
2026-06-12 17:25     ` Detlev Casanova

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®