Commit graph

221326 commits

Author SHA1 Message Date
Christoph Pillmayer
91e0f4c2a3 pan: Add BUS_WIDTH query to pan_props 2026-04-17 11:21:01 +02:00
Christoph Pillmayer
b6a8d664f7 pan/kmod: Add l2 features to pan_kmod_dev_props 2026-04-17 11:21:01 +02:00
Christoph Pillmayer
dd7671fedd pan/perf: Use proper counter category type in config
pan_perf_gen.py already writes the enum value instead of an index. Use
the enum type instead of a plain int in pan_perf_counter.
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
3a1dadf038 pan/perf: Rename pan_perf_counter_read[_raw] functions
_raw no longer takes the "raw" offsets as arguments so the name doesn't
make sense anymore. The old non "_raw" function actually sums over
blocks instead of just reading the passed counter.

This commits fixes the naming of those two functions so they match what
the functions do.
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
77f46dfb5a pan/perf: Pass counter info to raw read function
When a counter is derived, it can't be read based on just the offsets
into the buffer. To prepare for that, pass the info struct instead.
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
6cde1e3403 docs: Add Panthor to the Perfetto documentation as a data source
Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
903a366173 pps: Add panthor counters to Perfetto config files
v2:
 - Lower the counter_period_ns to match the minimum value in code

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
Suggested-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
c7c0875500 pps: Add panthor to available driver list
Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
Suggested-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
36cd197203 pan/perf: Make sure category indices match 2026-04-17 11:21:01 +02:00
Christoph Pillmayer
fd5b441d35 pan/pps: Generalize timing related settings 2026-04-17 11:21:01 +02:00
Christoph Pillmayer
1afc465345 pan/perf: Add timing related getters
These will be used by the pps-producer.
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
2e6a34bf0e pan/pps: Output counters per block
Instead of summing counters from shader cores, and outputting only
the counters from the first l2 slice, use the memory layout provided
from the kmod to output individual counters for each (category, block,
counter) combination.

Co-Authored-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
51992c8556 pan/pps: Delegate more tasks to PanfrostPerf
This makes it so that everything that uses the pan_perf C lib is
hidden inside PanfrostPerf instead of being used directly from the
pps driver.

Co-Authored-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
8141fd7342 pan/perf: Remove kmod version restriction
Both kmod backends implement the perf interface now.
2026-04-17 11:21:01 +02:00
Christoph Pillmayer
8d7387deea pan/kmod: Implement panthor kmod perf counter methods
Co-Authored-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
e05a94a1de drm-uapi: Add panthor performance counter uAPI
Add the panthor performance counter uAPI, added in v5 of the patch
series "Add performance counters with manual sampling mode",
based on the drm-misc-next kernel, base commit
96c85e428ebaeacd2c640eba075479ab92072ccd

v2:
 - the series is now based on the v5 of the kernel patch
2026-04-17 11:21:01 +02:00
Boris Brezillon
34131f71de pan/perf: Don't count on category definition order in the XML 2026-04-17 11:21:01 +02:00
Lukas Zapolskas
5c32d45ede pps: Add the Primitive, Instruction, Pixel and Fragment unit types
The Perfetto spec supports several units that are supported directly by
Mali performance counters, which are not being expressed in the data
source.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
226669227e panfrost: Move PanfrostDevice to a separate file
Put PanfrostDevice into it's own file to keep pan_pps_perf.cpp focused on
the panfrost specific producer implementation.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 11:21:01 +02:00
Boris Brezillon
7e7d9cddc7 panfrost/perf: Add Gx25 perfcounters 2026-04-17 11:21:01 +02:00
Christoph Pillmayer
825ac92605 pan/model: Update G610 perf counters 2026-04-17 11:21:01 +02:00
Lukas Zapolskas
7618984cf5 panfrost/perf: Add Gx10 perfcounters
Add manually created Mali-Gx10 counter definitions.

v2:
 - Added the architecture major field.

v3:
 - Swap the order of the shader core and memsys blocks.

v4:
 - G710 -> Gx10, to indicate that all GPUs in this generation are
   supported

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
Co-developed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
2026-04-17 11:21:01 +02:00
Lukas Zapolskas
23d265928e panfrost: Use the enum values for counter description generation
Using the enum definitions prevents the category indices to get
out of sync from the block types specified in the XML.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 09:48:50 +02:00
Lukas Zapolskas
1749999200 panfrost: Create an enumeration for the counter categories
The Mali-Gx10 series (G710, G610 and G510) introduce one new category of
counters which needs to be accounted for in the setup code. Adding this
into an enum ensures relevant structs are updated automatically.

v2:
- Modified generator script to use the enum

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 09:48:50 +02:00
Lukas Zapolskas
0c0b2a4d38 panfrost: Fix typo in pan_gen_perf.py
Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 09:48:50 +02:00
Lukas Zapolskas
f34b53396a panfrost: Update copyright year for new counter definitions
The source files generated from counter XML files should now contain
a copyright corresponding to the year of generation.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 09:48:50 +02:00
Lukas Zapolskas
d102217665 panfrost: Add a new interrupt unit
Starting from the Mali Gx10 series, some hardware counters may indicate
the number of interrupts occurring during the sampling period.

Signed-off-by: Lukas Zapolskas <lukas.zapolskas@arm.com>
2026-04-17 09:48:50 +02:00
Christoph Pillmayer
ab67e972dd pan/perf: Use new kmod api
Use the new kmod api for everything except getting
counter definition configs.
2026-04-17 09:48:50 +02:00
Christoph Pillmayer
901dd8dc6c pan/kmod: Implement panfrost kmod perf counter methods
This is mostly a copy of the logic from pan_perf.c and hooking it up
to the kmod api.
2026-04-17 09:48:50 +02:00
Christoph Pillmayer
dcc0dc10d7 pan/kmod: Add perf counter api
The kernel module is responsible for starting/stopping the counter
collection. It decides the layout of the counters in memory.

The commit adds an API to reflect this. The counter collection
can be started and stopped through the kmod. Counters are dumped into
a buffer also provided by the kmod. This is so that later for panthor
the buffer can be an mmapped bo. It also allows for having a larger
buffer where multiple samples are located internally but pointing data
at the most recent one.

The memory layout of whatever the data pointer points to can be
queried so that the counters can be extracted from it without
going through the kmod vtable.
2026-04-17 09:48:49 +02:00
Mauro Rossi
dfca417db8 radv: Fix gnu-empty-initializer errors in 8c10eab1
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fixes the following building errors:

../src/amd/vulkan/radv_rra.c:1369:43: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
      struct radv_bvh_stats_gfx12 stats = {};
                                          ^
../src/amd/vulkan/radv_rra.c:1376:45: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
      struct radv_bvh_stats_gfx10_3 stats = {};
                                            ^
2 errors generated.

Fixes: 8c10eab1 ("radv: Add an option for dumping BVH stats")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41011>
2026-04-17 07:09:51 +00:00
Mauro Rossi
46d396d9d8 radv: Fix gnu-empty-initializer errors in 480a94fb
Fixes the following building errors:

../src/amd/vulkan/radv_shader.c:3460:42: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
   struct radv_shader_debug_info debug = {};
                                         ^
1 error generated.

../src/amd/vulkan/radv_shader_args.c:975:43: error: use of GNU empty initializer extension [-Werror,-Wgnu-empty-initializer]
   struct user_sgpr_info user_sgpr_info = {};
                                          ^
1 error generated.

Fixes: 480a94fb ("radv: Gather debug info about shader args")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41011>
2026-04-17 07:09:51 +00:00
Georg Lehmann
cc212f6beb radv: remove radv_graphics_shaders_link
Only one actual linking step remains, so simplify the call.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:30 +00:00
Georg Lehmann
ae2213fa6d radv: export multi view index as layer after lowering io
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:30 +00:00
Georg Lehmann
8e74c0020e radv: remove draw_id from mesh shader a bit later
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:29 +00:00
Georg Lehmann
f85767a035 radv: never call nir_assign_io_var_locations
The comment is outdated and this info is never used.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:29 +00:00
Georg Lehmann
97c7e4b41f radv: remove unused vs/tes num_outputs from shader info
Supposedly used for ngg xfb, but apparently unused.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:28 +00:00
Georg Lehmann
1dd9c57233 radv: move fs view_index handling after lowering io
And update the comment to reflect that we now use a sysval to load
the layer id.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:28 +00:00
Georg Lehmann
2a5823c988 radv: move per-primitive fixup closer to radv_nir_lower_io
Ideally this would be in radv_nir_lower_io, but we need the information
about the previous stage.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40982>
2026-04-17 06:46:28 +00:00
Dhruv Mark Collins
78e2bbc70f tu/query_pool: Avoid CP counter conflict with autotune
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With autotune allocating counters low-to-high, the conflict with
PERFORMANCE_QUERY_KHR will happen if any CP-based counters are
used. This is a temporary workaround which just drops the first
two CP counters from being usable for performance queries.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
f78541b765 tu/autotune: Allocate performance counters from low-to-high
This is more consistent with the newly established pattern of the
UMD allocating all locally used performance counters low-to-high
instead of the prior high-to-low order.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
24849eef9f fd/pps: Allocate performance counters from high-to-low
The UMD will be switching to allocating counters from low-to-high,
so to avoid the chances of conflict with this new policy the PPS
driver now allocates the other way around. Additionally, this will
future proof it for the MSM-DRM uAPI for performance counters which
will similarly allocate from high-to-low.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Dhruv Mark Collins
a5ec9b7892 tu/autotune: Fail gracefully when CP counters are unavailable
When preemption optimization is supported then the necessary CP
counters being missing causes a device initialization error which
is unnecessary as support can simply be disabled instead to allow
for a more graceful fail. This also fixes A8XX which doesn't have
performance counters hooked up yet.

Cc: mesa-stable
Signed-off-by: Dhruv Mark Collins <mark@igalia.com>
Assisted-by: OpenAI Codex (GPT-5.4)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Zan Dobersek
c2708afbc7 tu: only support userspace-managed perfcounters on a7xx and earlier
Future kernel API for perfcounter management will likely be required for
a8xx and onwards. For a7xx and earlier, cmdstream-based selector and
counter register management is still supported.

Cc: mesa-stable
Signed-off-by: Zan Dobersek <zdobersek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40949>
2026-04-16 21:59:35 +00:00
Aleksi Sapon
712a4e5691 llvmpipe: fix overflow in rasterizer
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39498>
2026-04-16 19:36:28 +00:00
Aleksi Sapon
0326051618 llvmpipe: remove unused SSE rasterization code
Reviewed-by: Roland Scheidegger <roland.scheidegger@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39498>
2026-04-16 19:36:28 +00:00
Georg Lehmann
ae8f83d465 radv: allow input attachment to use pixel coord optimization
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The vectorized f2i32 would block nir_opt_frag_coord_to_pixel_coord.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40985>
2026-04-16 14:54:49 +00:00
Alyssa Rosenzweig
4b81cb6206 nir/opt_generate_bfi: avoid trivial instructions
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With the pass order shuffling, code like `(x & 0xf) + (x & 0xfffffff0)` gets
optimized to bitfield_select(0xF, x, x). But it would be much better to optimize
simply to x. nir_opt_algebraic would do that for us but we run this pass too
late for algebraic to save us from ourselves, so be smarter.

Observed on dEQP-GLES31.functional.compute.basic.image_atomic_op_local_size_8
with Jay, this saves an instruction there.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40956>
2026-04-16 13:54:41 +00:00
Erik Faye-Lund
f137207108 panvk: drop out-of-date TODO
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We already did this, so let's drop this TODO.

Fixes: d36e6af329 ("panvk: Bump the max image size on v11+")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40990>
2026-04-16 11:21:48 +00:00
Georg Lehmann
f949e3b819 nir: remove nir_link_xfb_varyings
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
RADV was the last user.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40977>
2026-04-16 08:49:23 +00:00