Commit graph

20736 commits

Author SHA1 Message Date
Konstantin Seurer
c9b60cfa4f radv: Move a whole bunch of debug/profiling related into a subdir
For slightly better separation of debug and driver code.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41044>
2026-05-29 10:59:38 +00:00
Konstantin Seurer
23677605f2 radv: Move debug options to radv_instance.h
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41044>
2026-05-29 10:59:38 +00:00
Samuel Pitoiset
76fdc606c8 ac/nir,radv: lower task payload to zeroes when the mesh shader has no task
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The Vulkan spec allows this to be used in a mesh shader as long as
it's not accessed, so it can be eliminated.

This fixes dEQP-VK.mesh_shader.ext.misc.payload_not_accessed.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41828>
2026-05-29 07:44:40 +02:00
Eric Engestrom
97391328a3 drirc: move 00-$drv-defaults.conf to each driver's folder
Makes more send to put them there, and it means that modifying them will
only trigger the CI jobs for that driver and not everything.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41866>
2026-05-28 19:55:05 +00:00
Samuel Pitoiset
f7321be05a radv/amdgpu: stop deduplicating winsys
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is no longer needed because allocated memory is tracked separately
now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41805>
2026-05-28 18:08:54 +00:00
Samuel Pitoiset
a0a9f9dda1 radv/amdgpu: rework tracking allocated memory for budget
Deduplicating the winsys just for budget looks more like a hack than
a real implementation. Reworking tracking allocated memory to remove
the dedup.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41805>
2026-05-28 18:08:54 +00:00
Georg Lehmann
38c4461c78 aco/gfx8: fix 16bit nir_op_ffma
aco uses the GFX9 opcode names, and GFX8 only has the legacy 16bit fma
that zeros the high register half.

Fixes: 570bfe1ee0 ("ac: handle new float multadd opcodes")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41837>
2026-05-28 14:52:27 +00:00
jyotiranjan
a5d34f85f8 radv/sqtt: forward zero-submit-count vkQueueSubmit2 for SQTT capture
Vulkan applications use vkQueueSubmit2(submitCount=0) to signal
throttle fences (e.g. per-image frame-pacing fences). When SQTT
is enabled, sqtt_QueueSubmit2() skips both the bypass path and
the submit loop, so the call is never forwarded and the fence
remains unsignaled.

This causes hangs in drmSyncobjWait (WAIT_FOR_SUBMIT) after capture.

Forward submitCount==0 calls directly to the underlying
QueueSubmit2 to ensure the fence is signaled.

Signed-off-by: jyotiranjan <jyotiranjan.bhuyan@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41766>
2026-05-28 12:14:59 +00:00
Samuel Pitoiset
05cd2b9509 radv/ci: fix list of expected failures
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/41836>
2026-05-28 11:55:42 +00:00
Rhys Perry
ca0496bc26 radv: use load_deref_transpose_amd for transposed cooperative matrix loads
This requires that BDA is used or robust buffer access is disabled for
cooperative matrix loads.

No fossil-db changes.

fossil-db (gfx1201, dEQP-VK.compute.pipeline.cooperative_matrix.*):
Totals from 603 (37.15% of 1623) affected shaders:
Instrs: 57422 -> 51212 (-10.81%); split: -11.99%, +1.17%
CodeSize: 357444 -> 310688 (-13.08%); split: -13.70%, +0.62%
VGPRs: 16668 -> 13188 (-20.88%); split: -21.53%, +0.65%
Latency: 492820 -> 469600 (-4.71%); split: -4.82%, +0.11%
InvThroughput: 63548 -> 55754 (-12.26%); split: -13.09%, +0.82%
VClause: 1624 -> 1620 (-0.25%); split: -2.71%, +2.46%
Copies: 2965 -> 3175 (+7.08%); split: -15.41%, +22.50%
PreSGPRs: 6966 -> 5450 (-21.76%); split: -21.91%, +0.14%
PreVGPRs: 7049 -> 5978 (-15.19%); split: -15.39%, +0.20%
VALU: 27454 -> 24315 (-11.43%); split: -14.74%, +3.30%
SALU: 5996 -> 6997 (+16.69%)
VMEM: 6748 -> 4656 (-31.00%)
SMEM: 1225 -> 1577 (+28.73%)
VOPD: 45 -> 39 (-13.33%); split: +4.44%, -17.78%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Rhys Perry
0cdb7594d7 radv: track cooperative matrix robustness
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Rhys Perry
b1429caab3 nir,ac/nir,aco: add load_global_tr_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Rhys Perry
b982e71084 nir: add load_global_transpose_amd
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41653>
2026-05-27 14:44:59 +00:00
Samuel Pitoiset
8444977b87 radv: rename master_fd to wsi_master_fd
It's only used for KHR_display.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Samuel Pitoiset
ff7c70cb5b radv: remove useless checks when creating a physical_device
drm_device can never be NULL now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Samuel Pitoiset
9ab3828d5e radv: close the local fd slightly later when enumerating physical devices
So that it can be used to print GPU info.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41802>
2026-05-27 08:12:37 +00:00
Andrzej Datczuk
691371a176 radv/rra,rmv: fix device id written into trace files
Both RRA and RMV used the PCI bus slot index in the trace device_id
field. On a typical single-GPU system, this resulted in "Device ID =
0000" displayed in RRA and RMV when traces were opened.

Match RGP dump, which reports device ids correctly.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41788>
2026-05-27 06:10:48 +00:00
Samuel Pitoiset
72f02d6e89 radv/amdgpu: fix releasing the mutex for virtio and RADV_PERFTEST=localbos
Found by inspection.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
473551ecd0 radv: determine supported syncobj types directly in the physical device
To remove the dependency on the winsys.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
b5403ff331 radv/amdgpu: simplify syncobj verifications during submissions
These are equivalent but do not rely on syncobj_sync_type.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
f8ce76e996 radv: remove declared but unused create_null_physical_device()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
921eedee8b radv: add a separate function to query allocated/usage for each heap
This is just a cleanup that will be useful for upcoming changes.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:50 +00:00
Samuel Pitoiset
25a53ab412 radv: pre-compute a mask of supported global queue priorities
That removes the winsys dependency when querying that.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:49 +00:00
Samuel Pitoiset
c1a3619d2c radv: use radv_device::ws directly for quering sync payloads
Easier to spot the remaining occurrences.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41755>
2026-05-26 10:18:49 +00:00
David Rosca
dfc608260a radv: Add support for timestamps on video queue
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41744>
2026-05-26 09:29:42 +00:00
David Rosca
581bf2e3b0 ac/cmdbuf: Add ac_emit_video_write_timestamp
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41744>
2026-05-26 09:29:42 +00:00
David Rosca
165a0105d3 ac/vcn_dec: Move register defines to ac_vcn_dec.c
Also remove unused struct jpeg_params.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41743>
2026-05-26 08:31:12 +00:00
David Rosca
fa96c3781c radv: Use ac_emit_video_write_memory
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41743>
2026-05-26 08:31:12 +00:00
David Rosca
8f2ee52c0e ac/cmdbuf: Add ac_emit_video_write_memory
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41743>
2026-05-26 08:31:10 +00:00
David Rosca
e1e65e47d4 ac/vcn: Add ac_vcn_sq_header/tail and use it for decode
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41743>
2026-05-26 08:31:10 +00:00
David Rosca
f775ecb143 ac/vcn_dec: Add ac_vcn_dec_init_regs to get register offsets
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41743>
2026-05-26 08:31:10 +00:00
Timur Kristóf
af8c3eb3d6 ac/nir: Fix SMEM workaround with emulated RT
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Use the RT descriptors pointer as dummy VA.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41780>
2026-05-25 23:32:13 +00:00
Timur Kristóf
3ff698e9fc ac/nir: When loading an arg, assert that it's used
To avoid weird crashes caused by trying to load unused attributes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Natalie Vock <natalie.vock@gmx.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41780>
2026-05-25 23:32:13 +00:00
Samuel Pitoiset
e2e7fce6e9 radv: rename radv_zero_vram to vk_zero_vram
More common and this implicitly enables this for Path Of Exile and X4
Foundations. Though, zero VRAM allocs is already the default in AMDGPU,
so that doesn't change anything in practice (except for very old
kernels).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41735>
2026-05-25 16:49:28 +00:00
Samuel Pitoiset
e2631eca0f radv: close the local fd immediately after the winsys is created
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
libdrm dups the fd internally, so local_fd and get_fd() are different
fd number but they point to the same file descriptor. Close it right
after the amdgpu device is initialized to avoid keeping two fds open
for the same thing.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41753>
2026-05-25 16:26:19 +00:00
Marek Olšák
1b45a8aee2 radv: select frag_coord_xy and pixel_coord conditionally based on dynamic state
the code explains it

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> (shader parts)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41689>
2026-05-25 13:38:08 +00:00
Marek Olšák
22e40edfb9 radv: move SPI_PS_INPUT_ENA emission into radv_emit_ps_state
The register values will depend on new fields in PS_STATE and it doesn't
seem like dynamic state belongs in radv_emit_fragment_shader_state.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41689>
2026-05-25 13:38:07 +00:00
Marek Olšák
caef0aebba radv: remove dead load_sample_pos code
lowered by radv_nir_lower_opt_fs_frag_pos

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41689>
2026-05-25 13:38:06 +00:00
Marek Olšák
6cd04ca6e5 radv: add a pass that selects either frag_coord_xy or pixel_coord, but not both
to reduce the number of initialized PS VGPRs, increasing the PS wave launch
rate.

The pass will have more RADV-specific stuff.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41689>
2026-05-25 13:38:06 +00:00
Georg Lehmann
f43bc8e8be radv: support VK_KHR_shader_fma
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
2026-05-25 11:50:38 +00:00
Georg Lehmann
3ea594f42b ac/llvm: never create ffmaz for broken llvm
The workaround wasn't proper fused ffma.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
2026-05-25 11:50:38 +00:00
Georg Lehmann
015b1d9e6d ac/llvm: don't assert on 32bit ffma before gfx9
Yes it's slow, but it's better than nothing.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
2026-05-25 11:50:38 +00:00
Georg Lehmann
a92d0356eb nir: seperate ffmaz from has_fmulz
There is no hardware which supports ffmaz with denorms.
We also need this to be seperate because there is AMD hardware
with ffma but not ffmaz.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
2026-05-25 11:50:38 +00:00
Georg Lehmann
19e56904f2 aco/optimizer: only create v_fma_legacy_f32 when denorms are disabled
For some reasons, this instruction always flushes denorms.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41649>
2026-05-25 11:50:38 +00:00
Samuel Pitoiset
07754c960a radv: validate drirc option names at compile time
This would prevent any typos or if something is backported incorrectly
in the future.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41700>
2026-05-21 14:26:28 +00:00
Samuel Pitoiset
e685f8d6aa radv/ci: cleanup list of expected failures
Triage invalid tests to make it easier to see real failures.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41717>
2026-05-21 14:03:22 +00:00
Samuel Pitoiset
91cf0a6e6d radv: use the new generation script for drirc
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41634>
2026-05-21 12:57:43 +00:00
Samuel Pitoiset
bf787fd91b radv: rename few drirc options for consistency
So that the option name matches everywhere.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41634>
2026-05-21 12:57:41 +00:00
Timothy Arceri
ca88f851c8 ac/nir/lower_tex_coord: basic lower tex coord test
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Tests issue from: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15494

Assisted-by: ChatGPT (GPT-5.5)
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41666>
2026-05-21 00:54:56 +00:00
David Rosca
2c0caee6db ac/info: Print number of VPE instances
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35431>
2026-05-20 13:36:25 +00:00