1.. SPDX-License-Identifier: GPL-2.0+
2
3=========================
4 drm/Panthor CSF driver
5=========================
6
7.. _panthor-usage-stats:
8
9Panthor DRM client usage stats implementation
10==============================================
11
12The drm/Panthor driver implements the DRM client usage stats specification as
13documented in :ref:`drm-client-usage-stats`.
14
15Example of the output showing the implemented key value pairs and entirety of
16the currently possible format options:
17
18::
19     pos:    0
20     flags:  02400002
21     mnt_id: 29
22     ino:    491
23     drm-driver:     panthor
24     drm-client-id:  10
25     drm-engine-panthor:     111110952750 ns
26     drm-cycles-panthor:     94439687187
27     drm-maxfreq-panthor:    1000000000 Hz
28     drm-curfreq-panthor:    1000000000 Hz
29     panthor-resident-memory:        10396 KiB
30     panthor-active-memory:  10396 KiB
31     drm-total-memory:       16480 KiB
32     drm-shared-memory:      0
33     drm-active-memory:      16200 KiB
34     drm-resident-memory:    16480 KiB
35     drm-purgeable-memory:   0
36
37Possible `drm-engine-` key names are: `panthor`.
38`drm-curfreq-` values convey the current operating frequency for that engine.
39
40Users must bear in mind that engine and cycle sampling are disabled by default,
41because of power saving concerns. `fdinfo` users and benchmark applications which
42query the fdinfo file must make sure to toggle the job profiling status of the
43driver by writing into the appropriate sysfs node::
44
45    echo <N> > /sys/bus/platform/drivers/panthor/[a-f0-9]*.gpu/profiling
46
47Where `N` is a bit mask where cycle and timestamp sampling are respectively
48enabled by the first and second bits.
49
50Possible `panthor-*-memory` keys are: `active` and `resident`.
51These values convey the sizes of the internal driver-owned shmem BO's that
52aren't exposed to user-space through a DRM handle, like queue ring buffers,
53sync object arrays and heap chunks. Because they are all allocated and pinned
54at creation time, only `panthor-resident-memory` is necessary to tell us their
55size. `panthor-active-memory` shows the size of kernel BO's associated with
56VM's and groups currently being scheduled for execution by the GPU.
57