Commit graph

202861 commits

Author SHA1 Message Date
Caio Oliveira
ff59013571 brw: Rework label tracking in assembler
For each label store its offset and two lists of uses (for JIP and UIP).
Because the parser itself already restricts what opcodes can use labels
(and which ones), don't re-validate them.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33522>
2025-03-06 17:06:20 -08:00
Caio Oliveira
7b45d31df0 brw: Add support for GOTO/JOIN in the assembler
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33522>
2025-03-06 17:06:20 -08:00
Caio Oliveira
9df254731e brw: Make assembler strict about JIP and UIP order
The "JIP:" and "UIP:" markers were being ignored, so was possible
to switch their order in the text but the parser would act as the
same.  Just fix the order now and enforce it through the parsing.

Since we are here, remove the "Jump:" and "Pop:" that are not used
for Gfx9+ anymore.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33522>
2025-03-06 17:06:19 -08:00
Caio Oliveira
25875f5e79 brw: Remove bblock_t parameters from various passes
These are either unused or can be trivially replaced by
a block stored in an instruction.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
8e2a7cb42d brw: Embed at_end() inside brw_builder(brw_shader *) constructor
All remaining uses of that constructor would also use at_end(),
and vice-versa.  So just implement that behavior in the constructor
itself.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
6f37e6f104 brw: Add explicit way to get an empty brw_builder
And use brw_builder(brw_shader *) and brw_builder() constructors
where possible.

The way tests are written, it is necessary to initialize an "empty"
builder -- which is later replaced by a proper one.  Default parameter
NULL make that initialization implicit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
32e562ae01 brw: Simplify brw_builder "insert before inst" constructor
Since brw_inst now has the block it belongs and the block can
reach the shader, the only necessary information to create a
builder is the brw_inst itself.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
66307811c3 brw: Remove block parameter from brw_inst::remove()
Use brw_inst::block instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
7924d48bcd brw: Use brw_inst::block in CSE
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
b0b0fa8624 brw: Use brw_inst::block in Combine Constants
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
07d0af763d brw: Use brw_inst::block in Def analysis
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
705d448bc3 brw: Add block pointer in brw_inst
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Caio Oliveira
b71ec53048 brw: Remove unused function
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33815>
2025-03-06 23:33:38 +00:00
Mike Blumenkrantz
7167214cab zink: support crazy CL buffer-to-texture extension
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33777>
2025-03-06 23:04:44 +00:00
Mike Blumenkrantz
a6d3078c80 zink: extract some samplerview bind/unbind code
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33777>
2025-03-06 23:04:44 +00:00
Mike Blumenkrantz
952ec2ab55 zink: extract some shader image resource binding code
no functional changes

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33777>
2025-03-06 23:04:44 +00:00
Mike Blumenkrantz
1f6c97f358 zink: disable reordering on compute contexts
in theory reordering shouldn't do anything here other than promote
everything to the reorder cmdbuf, which is harder to debug

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33777>
2025-03-06 23:04:44 +00:00
Samuel Pitoiset
5f177018f7 radv/ci: re-enable ET2C emulation testing on non-native GPUs
This env variable was renamed except for CI.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33924>
2025-03-06 22:09:49 +00:00
Samuel Pitoiset
54242f8f04 ci/b2c: fix passing B2C_* variables
Broken search&replace regex.

This fixes GPU hang detection on RADV/CI.

Fixes: bad0197300 ("ci/b2c: pass through all the B2C_* variable without renaming them")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33924>
2025-03-06 22:09:49 +00:00
Lakshman Chandu Kondreddy
2cfe070b3b freedreno: Add support for Adreno623 GPU
Add support to enable basic functionality of Adreno623 GPU.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33525>
2025-03-06 21:48:05 +00:00
Marek Olšák
40aac0681b ac,radeonsi: define all SDMA DCC fields & use them, enable compressed writes
SDMA supports HTILE, but SURF_TYPE must be set correctly.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:54 +00:00
Marek Olšák
ce0d213ac8 radeonsi: don't cull front/back faces in the hw if the shader culls them
This reduces the number of context rolls by not setting
the CULL_FRONT/CULL_BACK register fields.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:54 +00:00
Marek Olšák
bafab3324e radeonsi: reflect blitter VS in si_context::num_vertex_elements
Set it to 0 if the VS doesn't use VBOs. This fixes an assertion failure.

Fixes: 7bf5d2ce75 - radeonsi: add assertion requiring binding vertex elements before vertex_buffers
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12698
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:53 +00:00
Marek Olšák
c662fcfa94 radeonsi: lower IO only if io_lowered == false
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:53 +00:00
Marek Olšák
53ae218dcd radeonsi: use the restrict keyword for draw parameters
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:53 +00:00
Marek Olšák
95a9df811a radeonsi: enable Z/S caching in GL2 by default except FurMark
This improves performance for several workloads.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:52 +00:00
Marek Olšák
36ccc300d8 radeonsi: enable NGG culling when the shader writes the viewport index
Only W and face culling is enabled.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:52 +00:00
Marek Olšák
356f5b2d2e radeonsi: move buffer reallocation to a separate function
to be used later

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:51 +00:00
Marek Olšák
0f9c972453 radeonsi: use si_is_buffer_idle everywhere
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:50 +00:00
Marek Olšák
c96f7a079f winsys/amdgpu: don't use 32-bit address space for IBs
We run out of the 32-bit address space and then we crash.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:50 +00:00
Marek Olšák
e468321bee ac/cmdbuf: rework CB/DB cache controls for better perf
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:49 +00:00
Marek Olšák
73175ec0b6 ac/cmdbuf: split meta_*_policy to dcc and htile variables
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:49 +00:00
Marek Olšák
d2141e6751 ac/nir/ngg: add an option to skip viewport-based culling
We can do W and face culling when we have multiple viewports, but not
frustum and small prim culling because those are dependent on the viewport.
When a shader writes the viewport index, the new option allows skipping
viewport-based culling while keeping W and face culling.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:48 +00:00
Marek Olšák
d429e35169 ac/nir/cull: extract a helper calling accept_func
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:48 +00:00
Marek Olšák
177c9b173e Revert "ac/nir: clamp vertex color outputs in the right place"
This reverts commit b3fc49686e.

It was a rebase failure.

Fixes: b3fc49686e

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:47 +00:00
Marek Olšák
e99efe7164 ac,radeonsi: don't set num_slots/src/dest_type/write_mask when they're set automatically
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:47 +00:00
Marek Olšák
96722aeda3 ac/gpu_info: use max_good_cu_per_sa for computation of max_scratch_waves
every CU should be able to use scratch

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33482>
2025-03-06 21:10:46 +00:00
Rhys Perry
66130a51d3 radv: don't assume WGP mode in radv_get_max_waves
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33873>
2025-03-06 20:47:20 +00:00
Rhys Perry
17abc5f326 radv: improve radv_get_max_waves for multi-wave workgroups with LDS
LDS isn't divided among SIMDs, and it doesn't make sense to launch a
fraction of a compute workgroup.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33873>
2025-03-06 20:47:20 +00:00
Connor Abbott
076f52285c tu: Remove useless prim_order state merging
We already merged it below, when the library has both fragment output
interface and fragment shader state (which is when we'd compute it
anyway). Setting it twice is probably harmless but also confusing and
useless.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33902>
2025-03-06 20:24:22 +00:00
Connor Abbott
413947e2de tu: Fix static blend bandwidth calculation
We were never setting the valid bit, so would never happen. If it did
happen, we forgot to merge in the bandwidth calculation from child
libraries.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33902>
2025-03-06 20:24:22 +00:00
Loïc Minier
c36cd32345 freedreno: check if GPU supported in fd_pipe_new2
fd_pipe_new2 can segfault when trying to set the is_64bit flag on new
pipes. This can happen when the current GPU is not be listed in the
fd_dev_recs table because it's not supported by mesa, but is supported by
the kernel.

Add a helper function to test if the current GPU is in the supported table,
and use it in fd_pipe_new2.

Signed-off-by: Loïc Minier <loic.minier@oss.qualcomm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33830>
2025-03-06 20:00:02 +00:00
Mark Collins
0342d34bdb tu/kgsl: Remove zero CB queue submission fast path
The fast path for kgsl_queue_submit when there are no command buffers
and only sync objects led to breakage for two reasons:
* The fast path was not properly handling duplication of the merged sync
  object assigned to signalled `kgsl_syncobj`(s), which could lead to
  multiple `kgsl_syncobj`s owning the same FD and consequently issues
  such as double close of that FD leading to UB. This is fixed by moving
  to the slow path as it always produces a timestamp sync object which
  can be trivially duplicated.
* The Vulkan specification requires that drivers strictly follow the
  order of submission of command buffers and consequently the order of
  semaphore signal/wait operations. Since no submission was being made
  to the kernel, subsequent submissions could be executed without waiting
  for wait/signal operations from previous submissions to complete.

As both of these issues are fixed by moving to the slow path, this patch
removes the fast path in favor of the more correct slow path.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33894>
2025-03-06 19:40:41 +00:00
Pavel Ondračka
87a90a3b38 r300: fix temps counting for shader-db stats
RC_FILE_INPUT is pretty much just a RC_FILE_TEMPORARY with an initial
value in it. So we regalloc it the same way we do normal temps, however
for unknown reasons (probably to have a bit more readable shader dumps)
we still keep the RC_FILE_INPUT type even though its the same as
temporary. This is handled correctly when emitting the machine code,
however, it was not taken into account in shader stats.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33817>
2025-03-06 19:12:24 +00:00
Martin Krastev
15e0e53b4d svga/ci: enable vmware farm
Farm was down due to infra outage.

Signed-off-by: Martin Krastev <martin.krastev@broadcom.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33919>
2025-03-06 18:47:49 +00:00
Yiwei Zhang
6868212774 venus: fix a memory corruption in query records recycle
The free list must be re-initialized. Found the bug while running:
dEQP-VK.ray_tracing_pipeline.acceleration_structures.device_compability_khr.gpu_built.top
where it invokes VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT to purge
the cmd pool resources, and the next alloc still gets cache hit with the
"empty" list.

Fixes: e2c4bafccc ("venus: free query batches for VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33908>
2025-03-06 18:25:20 +00:00
Ruijing Dong
a3c859d9f3 radeonsi/vcn: vcn5 roi fix
Compared to vcn4, vcn5's implementation has changed.
It needs to apply the qp_delta directly instead of
dividing by 5.

Reviewed-by: David Rosca <david.rosca@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33886>
2025-03-06 17:59:22 +00:00
Marek Olšák
171ee1797b glapi: remove extension definitions that will likely never be implemented
If somebody needs these in the future, they can add them back, but a lot
of these extensions are very old (SUN, SGI, ...).

No code is added, though git diff is having trouble detecting that.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
2025-03-06 17:13:23 +00:00
Marek Olšák
0a330b1660 egl: use the current dispatch to execute glFlush instead of get_proc_address
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
2025-03-06 17:13:23 +00:00
Marek Olšák
8bb7033095 glx: fix build with -Dlegacy-x11=dri2
Fixes: 71bb62e3c9 - glx: stop exporting GL functions from libGLX_mesa.so

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33794>
2025-03-06 17:13:23 +00:00