]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/panthor: Add tracepoint for hardware utilisation changes
authorNicolas Frattaroli <nicolas.frattaroli@collabora.com>
Fri, 16 Jan 2026 12:57:32 +0000 (13:57 +0100)
committerBoris Brezillon <boris.brezillon@collabora.com>
Thu, 22 Jan 2026 14:15:22 +0000 (15:15 +0100)
commit52ebfd8d2feb1f37bc75c6b662b620323de676ea
treefb6ce380ec178b23125b69c10c265cfb91d7236e
parentc5bf1d4e4473f0f18dfba0266a8fd48cb3700e73
drm/panthor: Add tracepoint for hardware utilisation changes

Mali GPUs have three registers that indicate which parts of the hardware
are powered at any moment. These take the form of bitmaps. In the case
of SHADER_READY for example, a high bit indicates that the shader core
corresponding to that bit index is powered on. These bitmaps aren't
solely contiguous bits, as it's common to have holes in the sequence of
shader core indices, and the actual set of which cores are present is
defined by the "shader present" register.

When the GPU finishes a power state transition, it fires a
GPU_IRQ_POWER_CHANGED_ALL interrupt. After such an interrupt is
received, the _READY registers will contain new interesting data. During
power transitions, the GPU_IRQ_POWER_CHANGED interrupt will fire, and
the registers will likewise contain potentially changed data.

This is not to be confused with the PWR_IRQ_POWER_CHANGED_ALL interrupt,
which is something related to Mali v14+'s power control logic. The
_READY registers and corresponding interrupts are already available in
v9 and onwards.

Expose the data as a tracepoint to userspace. This allows users to debug
various scenarios and gather interesting information, such as: knowing
how much hardware is lit up at any given time, correlating graphics
corruption with a specific powered shader core, measuring when hardware
is allowed to go to a powered off state again, and so on.

The registration/unregistration functions for the tracepoint go through
a wrapper in panthor_hw.c, so that v14+ can implement the same
tracepoint by adding its hardware specific IRQ on/off callbacks to the
panthor_hw.ops member.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20260116-panthor-tracepoints-v10-3-d925986e3d1b@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
drivers/gpu/drm/panthor/panthor_gpu.c
drivers/gpu/drm/panthor/panthor_gpu.h
drivers/gpu/drm/panthor/panthor_hw.c
drivers/gpu/drm/panthor/panthor_hw.h
drivers/gpu/drm/panthor/panthor_trace.h [new file with mode: 0644]