Commit graph

3593 commits

Author SHA1 Message Date
Samuel Pitoiset
736ddb6ba8 ac/perfcounter: move configuration for GFX10 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:03 +00:00
Samuel Pitoiset
6374484123 ac/perfcounter: compute the number of block instance properly on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:02 +00:00
Samuel Pitoiset
a037feb40b ac/perfcounter: update configuration of many blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:02 +00:00
Samuel Pitoiset
b7c2e38019 ac/perfcounter: fix the number of static instances for some blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
1925d61a7b ac/perfcounter: define a distribution mode for all perf blocks on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
f4bc670ddf ac/perfcounter: move configuration for GFX10.3 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:01 +00:00
Samuel Pitoiset
abc72740a7 ac/perfcounter: fix number of instances for GCEA
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39126>
2026-01-05 08:38:00 +00:00
Timur Kristóf
18b8543026 ac/nir: Add pass to fixup SMEM on GFX6-7
The pass implements two mitigations for the GFX6-7 SMEM bug:

1. To mitigate VM faults by NULL descriptors:

Make sure that SMEM buffer loads always access a mapped BO.
Use either the descriptor BO (or compute scratch BO),
or otherwise use the zero-filled BO in their place.

2. To mitigate VM faults by OOB robust buffer access:

Add an instruction to clamp the offset source to the
num_records field of the descriptor. It will be still
out of bounds, but the VM fault can be completely mitigated
if the driver adds a padding to each memory allocation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Timur Kristóf
7023ef4b8b ac/cu_info: Add GFX6-7 SMEM OOB bug
On GFX6-7, SMEM instructions access memory when num_records == 0
or offset >= num_records, which causes VM faults when reading a
page that isn't mapped.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38769>
2026-01-02 23:42:16 +00:00
Marek Olšák
d0dd5a5f57 ac,radeonsi: move SX PS downconversion code into ac_formats.c
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39093>
2026-01-02 16:46:20 +00:00
Samuel Pitoiset
5d4afe60ff ac/surface: add RADEON_SURF_VIEW_3D_AS_2D_ARRAY
This is only compatible with non-sparse 3D images. It will be used
to select a better swizzle mode from RADV.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38084>
2026-01-02 09:54:29 +00:00
Samuel Pitoiset
468c8dca18 ac/perfcounter: compute the number of block instance properly on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
3c7ea1e4ca ac/perfcounter: update configuration of many blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
08f50f169b ac/perfcounter: fix the number of static instances for some blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
59b35e9777 ac/perfcounter: define a distribution mode for all perf blocks on GFX11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
d03ad11e11 ac/perfcounter: move configuration for GFX11 in a separate file
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
d18dbd9804 ac/perfcounter: define new GPU blocks on GFX11+
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
1672b3aa6d ac/perfcounter: fix configuration of SQ/SQ_WGP blocks on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
0bb4a6039f ac/perfcounter: remove setting unused fields for GFX12 blocks
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39099>
2026-01-02 09:27:20 +01:00
Samuel Pitoiset
2e63aa1191 ac/spm: prevent selecting invalid brodcast mode for SPM blocks
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
We should really have a distribution mode per block.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39080>
2026-01-02 07:18:17 +00:00
Samuel Pitoiset
ec453a10e3 ac/spm: select correct broadcasting mode for CPF/GCEA blocks
These blocks were recently added for new performance counters in RGP 2.6.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39080>
2026-01-02 07:18:17 +00:00
Samuel Pitoiset
c8cb0f5941 ac/spm: fix GRBM broadcasting for global blocks
They should broadcast SE and SA.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39080>
2026-01-02 07:18:16 +00:00
Marek Olšák
f00f054087 ac,radeonsi: move lowering to load_color0/1 to ac_nir_lower_ps_early
It's better to have these all in one pass.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38802>
2026-01-01 18:30:29 +00:00
Georg Lehmann
cbedced5e8 ac/nir/cull: do not reuse variables if subgroup ops are used
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Subgroup ops make divergence information useless for our purpose,
we would need workgroup divergence.

The game affected here has control flow dependent on vote_any,
so it's possible that a wave only executes the code after culling/reordering
invocations.
That means we can't reuse the maybe undefined value from before culling.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14459
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39060>
2025-12-29 18:38:29 +00:00
Samuel Pitoiset
78e1f53429 ac/perfcounter: update configuration of many blocks on GFX12
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:41 +00:00
Samuel Pitoiset
e377060e5c ac/perfcounter: rework computing the number of block instances on GFX12
This needs to be generalized to older generations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:41 +00:00
Samuel Pitoiset
a90b913817 ac/perfcounter: fix the number of static instances for some blocks on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:41 +00:00
Samuel Pitoiset
a62ca19010 ac/perfcounter: update the number of events for GRBME_SE on GFX12
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:40 +00:00
Samuel Pitoiset
3317ea5122 ac/perfcounter: define a distribution mode for all perf blocks on GFX12
This will be used to compute the number of instances and more stuff.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:40 +00:00
Samuel Pitoiset
5de9390d4c ac/perfcounter: move configuration for GFX12 in a separate file
Performance counters are too different between generations and it's
less error prone to define them separately for each generations.

I'm starting with GFX12 first.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39083>
2025-12-29 07:22:39 +00:00
Samuel Pitoiset
b3c983b8dd amd,radv,radeonsi: add a new function to update windowed perf counters
Some checks failed
macOS-CI / macOS-CI (dri) (push) Has been cancelled
macOS-CI / macOS-CI (xlib) (push) Has been cancelled
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39065>
2025-12-24 07:20:01 +00:00
Timur Kristóf
7dbabc6acc ac/nir/lower_taskmesh_io_to_mem: Use AC_TASK_DRAW_ENTRY_BYTES
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace draw_entry_bytes with AC_TASK_DRAW_ENTRY_BYTES.
This is 16 on all AMD HW that supports task/mesh shaders.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39032>
2025-12-22 15:17:59 +00:00
Timur Kristóf
fc57fa4589 radv, radeonsi: Don't pass task ring info to mesh/task payload lowering
The pass now uses the ring descriptors to figure these out.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39032>
2025-12-22 15:17:59 +00:00
Timur Kristóf
4d381c9136 ac/nir/lower_taskmesh_io_to_mem: Don't hardcode payload entry size in shaders
Currently the number of task payload entry size is hardcoded
in shaders as a constant. This isn't a good idea because it
makes the code inflexible, eg. doesn't allow us
to change the number of entries dynamically.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39032>
2025-12-22 15:17:59 +00:00
Timur Kristóf
5348d953aa ac/nir/lower_taskmesh_io_to_mem: Don't hardcode num_entries in shaders
Currently the number of task shader ring entries is hardcoded
in shaders as a constant. This isn't a good idea because it
makes the code inflexible, eg. prevents us from using the same
shader binary accross some chips as well as doesn't allow us
to change the number of entries dynamically.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39032>
2025-12-22 15:17:58 +00:00
Samuel Pitoiset
3b18fa348e ac/rgp: enable new performance counters for RGP 2.6 on GFX10-GFX11
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
GFX12 needs more work and it will be added separately.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:52:14 +01:00
Samuel Pitoiset
8bc37d0d19 ac/spm: add support for Ray Tracing counters in RGP
These aren't new in RGP 2.6, they have been added since a while. But
because RADV wasn't supporting the new derived SPM chunk it wasn't
possible to expose them.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:51:44 +01:00
Samuel Pitoiset
0b5ae0758e ac/spm: add support for new Memory percentage counters in RGP 2.6
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:51:14 +01:00
Samuel Pitoiset
3d2bb52a81 ac/spm: add support for new Memory bytes counters in RGP 2.6
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:50:44 +01:00
Samuel Pitoiset
84ecdc534c ac/spm: add support for new LDS counters in RGP 2.6
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:50:41 +01:00
Samuel Pitoiset
07d9fc574c ac/spm: implement the new derived SPM chunk for performance counters
This is the new method to add performance counters to RGP captures.
This will be used to add the new RGP 2.6 counters too.

The previous SPM code will be deprecated at some point but it's hard
to support all generations in one batch. So, I will implement this
step by step.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:48:59 +01:00
Samuel Pitoiset
3e4d629458 ac/spm: add an ID to raw performance counters
This will be used to compute derived values for the new RGP/SPM chunk.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:48:29 +01:00
Samuel Pitoiset
21ad7e4e32 ac/spm: print an error message when a group is unknown
Help debugging.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:48:21 +01:00
Samuel Pitoiset
7da6fe6a00 ac/spm: fix programming more than one counter slot
Some blocks have two or more SPM counters and they should be used when
more than 4 counters are programmed (ie. 16-bit per counter).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:48:14 +01:00
Samuel Pitoiset
e5a041ee1c ac/spm: add an assertion to check the number of global instances
To make sure counters aren't silently discarded.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:48:06 +01:00
Samuel Pitoiset
eca9c00430 ac/spm: adjust configuration of some GPU blocks
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:47:58 +01:00
Samuel Pitoiset
6613dfb234 ac/perfcounter: add GCEA block description on GFX10-11
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:47:29 +01:00
Samuel Pitoiset
25e28819bd ac/perfcounter: adjust the number of events for TD on GFX10.3
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:47:21 +01:00
Samuel Pitoiset
a4cb114f5a ac/perfcounter: add a separate group for GFX10.3
This is just a copy&paste but GFX10.3 has way more counters than GFX10
that will be added later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39013>
2025-12-22 09:47:09 +01:00
Daniel Schürmann
1e8d367537 amd: add and use ac_cu_info::has_vtx_format_alpha_adjust_bug
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38701>
2025-12-22 07:34:48 +00:00