linux/Documentation/gpu
Adrián Larumbe f11b0417ee drm/panfrost: Add fdinfo support GPU load metrics
The drm-stats fdinfo tags made available to user space are drm-engine,
drm-cycles, drm-max-freq and drm-curfreq, one per job slot.

This deviates from standard practice in other DRM drivers, where a single
set of key:value pairs is provided for the whole render engine. However,
Panfrost has separate queues for fragment and vertex/tiler jobs, so a
decision was made to calculate bus cycles and workload times separately.

Maximum operating frequency is calculated at devfreq initialisation time.
Current frequency is made available to user space because nvtop uses it
when performing engine usage calculations.

It is important to bear in mind that both GPU cycle and kernel time numbers
provided are at best rough estimations, and always reported in excess from
the actual figure because of two reasons:
 - Excess time because of the delay between the end of a job processing,
   the subsequent job IRQ and the actual time of the sample.
 - Time spent in the engine queue waiting for the GPU to pick up the next
   job.

To avoid race conditions during enablement/disabling, a reference counting
mechanism was introduced, and a job flag that tells us whether a given job
increased the refcount. This is necessary, because user space can toggle
cycle counting through a debugfs file, and a given job might have been in
flight by the time cycle counting was disabled.

The main goal of the debugfs cycle counter knob is letting tools like nvtop
or IGT's gputop switch it at any time, to avoid power waste in case no
engine usage measuring is necessary.

Also add a documentation file explaining the possible values for fdinfo's
engine keystrings and Panfrost-specific drm-curfreq-<keystr> pairs.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230929181616.2769345-3-adrian.larumbe@collabora.com
2023-10-04 13:04:15 +02:00
..
amdgpu drm/amd: Update driver-misc.html for Rembrandt-R 2023-06-09 10:40:22 -04:00
bridge
dp-mst drm/dp_mst: Introduce new refcounting scheme for mstbs and ports 2019-01-10 20:12:19 -05:00
rfc drm/doc/rfc: Mark GPU VA as complete. 2023-09-07 17:29:54 -04:00
afbc.rst drm/afbc: Add AFBC modifier usage documentation 2019-01-11 17:52:06 +00:00
backlight.rst doc-rst: Wire-up Backlight kernel-doc documentation 2020-07-20 10:26:22 +01:00
driver-uapi.rst drm/nouveau: implement new VM_BIND uAPI 2023-08-04 20:34:41 +02:00
drivers.rst Documentation/gpu: Reorganize DC documentation 2021-12-13 16:33:16 -05:00
drm-client.rst drm/fb-helper: Remove drm_fb_helper_crtc 2019-06-04 12:13:47 +02:00
drm-internals.rst drm/doc: Add KUnit documentation 2022-06-27 13:46:03 +02:00
drm-kms-helpers.rst drm/bridge: Document the expected behaviour of DSI host controllers 2022-12-08 09:56:57 +01:00
drm-kms.rst drm/doc: Fix title underline length 2022-12-01 11:12:44 +01:00
drm-mm.rst drm/gpuvm: doc: fix filename references 2023-09-27 17:49:38 +02:00
drm-uapi.rst drm/doc: Document DRM device reset expectations 2023-10-02 11:05:21 +02:00
drm-usage-stats.rst drm/panfrost: Add fdinfo support GPU load metrics 2023-10-04 13:04:15 +02:00
i915.rst drm/i915/mtl: Handle wopcm per-GT and limit calculations. 2022-11-14 10:11:47 -08:00
index.rst Docs/subsystem-apis: Remove '[The ]Linux' prefixes from titles of listed documents 2023-01-24 15:27:08 -07:00
introduction.rst drm/doc: Add sections about tiny drivers and external refs to intro page 2022-04-22 13:56:31 +02:00
kms-properties.csv drm/doc: Drop "content type" from the legacy kms property table 2019-03-26 14:18:51 +01:00
komeda-kms.rst Documentation: gpu/komeda-kms: eliminate duplicated word 2020-07-13 09:44:06 -06:00
mcde.rst drm/mcde: Fix reference to DOC comment 2019-10-05 20:35:14 +02:00
meson.rst Documentation/gpu/meson: Remove link to meson_canvas.c 2019-04-05 08:35:05 -04:00
msm-crash-dump.rst docs: mark orphan documents as such 2019-06-08 13:42:11 -06:00
panfrost.rst drm/panfrost: Add fdinfo support GPU load metrics 2023-10-04 13:04:15 +02:00
pl111.rst drm: pl111: Update documentation 2020-07-23 10:06:22 +02:00
tegra.rst
todo.rst drm/panel: Fix todo indentation for panel prepared/enabled cleanup 2023-08-03 10:21:27 +02:00
tve200.rst
v3d.rst
vc4.rst drm/vc4: Improve the KUnit documentation 2022-12-15 08:54:08 +01:00
vga-switcheroo.rst
vgaarbiter.rst PCI/VGA: Move vgaarb to drivers/pci 2022-03-09 18:30:46 -06:00
vkms.rst drm/vkms: drop "Rotation" TODO 2023-05-08 09:57:24 -03:00
xen-front.rst