Marek Olšák
92133bb0ab
amd: demystify various optimizations we already have for memory channels
...
Explain why we do what we do, and use the radeon_info field properly.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39120 >
2026-01-06 20:32:10 +00:00
Samuel Pitoiset
4fce09268a
ac/perfcounter: rename ac_pc_block::num_global_instances to num_instances
...
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/39155 >
2026-01-06 11:43:21 +00:00
Samuel Pitoiset
59dc20262c
ac/perfcounter: rename ac_pc_block::num_instances to num_scoped_instances
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39155 >
2026-01-06 11:43:21 +00:00
Samuel Pitoiset
3658d9588f
ac/perfcounter: add num_{16,32}bit_spm_counters to GPU blocks
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39155 >
2026-01-06 11:43:21 +00:00
Samuel Pitoiset
9a1b925400
ac/spm: use GPU block distribution mode to determine instances
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39155 >
2026-01-06 11:43:20 +00:00
Samuel Pitoiset
ac0423eb3f
ac/spm: use GPU block distribution mode to determine broadcasting
...
SPM is only implemented for GFX10+.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39155 >
2026-01-06 11:43:19 +00:00
Rhys Perry
614437ead5
ac/nir: don't vectorize 16-bit shared loads to 8-bit
...
Fixes an issue where a 2x16 load was vectorized with a 1x16 load into a
8x8 load. This became possible after 49d923078f increased
aligned_new_size from 6 bytes to 8 bytes.
fossil-db (navi31):
Totals from 5 (0.01% of 79825) affected shaders:
Instrs: 6994 -> 6257 (-10.54%)
CodeSize: 44000 -> 39464 (-10.31%)
Latency: 90482 -> 89795 (-0.76%)
InvThroughput: 202955 -> 201926 (-0.51%)
VClause: 560 -> 565 (+0.89%)
Copies: 1135 -> 1108 (-2.38%); split: -2.82%, +0.44%
PreVGPRs: 201 -> 199 (-1.00%)
VALU: 3882 -> 3201 (-17.54%)
SALU: 493 -> 479 (-2.84%)
VOPD: 262 -> 258 (-1.53%)
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 49d923078f ("ac/nir: fix calculation of aligned_new_size")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14500
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39156 >
2026-01-06 10:28:02 +00:00
Marek Olšák
3552028e87
ac/lower_ngg_mesh: fix a segfault accessing out_variables out of bounds
...
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
component_addr_off (in bytes) was used to offset a component index (in dwords).
Cc: mesa-stable
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39144 >
2026-01-05 22:23:42 +00:00
Marek Olšák
b340588119
ac/gpu_info: don't read uninitialized dev_filename
...
This fixes radeonsi-run-tests.py not being able to read AMD_DEBUG=info.
Fixes: 8777894d3e - amd: remove radeon_info::dev_filename
Reviewed-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/39145 >
2026-01-05 21:56:36 +00:00
Samuel Pitoiset
48d30ce5bf
ac/rgp: enable the new derived SPM chunk for performance counters on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
dcf9f630ff
ac/spm: add support for Ray Tracing counters in RGP on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
179184c07e
ac/spm: add support for new Memory percentage counters in RGP 2.6 on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
78bdc03282
ac/spm: add support for new Memory bytes counters in RGP 2.6 on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
4d7794f0b3
ac/spm: add support for new LDS counters in RGP 2.6 on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:07 +00:00
Samuel Pitoiset
e315bd0321
ac/spm: update the cache group on GFX12
...
No L1 counter.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:06 +00:00
Samuel Pitoiset
7349169745
ac/spm: rework indexing of the derived groups/counters/components
...
RGP expects linear indexing across the number of counters/components.
Because a component can be used with different counters, its index
should be re-used when needed.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:06 +00:00
Samuel Pitoiset
11a12893d6
ac/perfcounter: add new GCEA_SE block definition on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:05 +00:00
Samuel Pitoiset
7f84c0056f
ac/perfcounter: add new GCEA_CPWD block definition on GFX12
...
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39100 >
2026-01-05 10:02:05 +00:00
Samuel Pitoiset
3722ef141c
ac/spm: fix a crash with the RT counters on GFX10
...
They are only enabled on GFX10.3+.
Fixes: 8bc37d0d19 ("ac/spm: add support for Ray Tracing counters in RGP")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39127 >
2026-01-05 09:05:50 +00:00
Samuel Pitoiset
a057800300
ac/perfcounter: compute the number of block instance properly on GFX10
...
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:04 +00:00
Samuel Pitoiset
87b938ce41
ac/perfcounter: update configuration of many blocks on GFX10
...
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:04 +00:00
Samuel Pitoiset
381e4f4c9f
ac/perfcounter: fix the number of static instances for some blocks on GFX10
...
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:04 +00:00
Samuel Pitoiset
91fdbadacc
ac/perfcounter: define a distribution mode for all perf blocks on GFX10
...
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
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
...
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
...
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
...
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