Commit graph

214150 commits

Author SHA1 Message Date
Connor Abbott
12779451ee tu: Correctly set GRAS_LRZ_CB_CNTL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:26 +00:00
Connor Abbott
50aa66a7c1 tu: Rewrite visibility stream allocation
The mechanism implemented in the hardware to synchronize against Write
after Read hazards with the visibility stream for concurrent binning is
for BV and BR to keep track of the number of render passes they have
finished and BV waits until
BR_count >= BV_count - vis stream count. For example, if
there are two visibility streams and the user submits three
renderpasses, before starting renderpass #3 BV will wait for BR to
finish renderpass #1. It's assumed that renderpass #3 and #2 use
different visibility streams, so it's safe to start working on #3 once
 #2 is done.

This mechanism is assumed to work across renderpasses and even submits,
and the only way to reset the BR/BV counts is via
CP_RESET_CONTEXT_STATE which is only done by the kernel when
switching contexts. This vastly complicates things for Vulkan,
where we have no idea what order command buffers will be submitted. This
means that we have to defer emitting the actual pointers until
submission time and create patchpoints instead. This gets unfortunately
very complicated with SIMULTANEOUS_USE_BIT where we have to update the
patchpoints on the GPU.

I've taken the liberty of also deferring the allocation of the
visibility stream until submit time. This will help us later move to
per-queue visibility streams, which will be necessary for supporting
multiple simultaneous queues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:25 +00:00
Connor Abbott
416dc87be9 tu: Initialize registers for BV
Start introducing commands to setup BV. We need to run the initial
register setup with both BR and BV enabled, and similarly we need to
setup a bin preamble for BV. A few magic registers are BR-only and
should be skipped when initializing BV. The VPC attribute carveout
registers are a bit special because they must be initialized in BR and
BV bin preambles, so they are pulled into a separate function.

This commit also switches the "default" thread control from BR with
concurrent binning disabled to BR with concurrent binning enabled. GMEM
renderpasses now explicitly disable concurrent binning. This is
necessary because switching from CB enabled to disabled and vice versa
imposes a synchronization, and we want BV to be able to skip over
compute dispatches, sysmem renderpasses, etc. to find the next binning
pass. GMEM renderpasses re-enable concurrent binning at the end to keep
the "default" thread control and avoid having to sprinkle
THREAD_CONTROL(BR) around all the other Vulkan commands that can run
outside of a renderpass (compute dispatch, blits, query pool operations,
etc.).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:24 +00:00
Connor Abbott
9ea3d7c393 tu/cs: Allow conditional execution in substreams
This should work perfectly fine for all modes. The only caveat is that
re-emitting the condition won't happen, but that's fine.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:24 +00:00
Connor Abbott
f12db79c5a tu: Add tu7_thread_control helper
We're about to emit a lot more CP_THREAD_CONTROL. Make it more
ergonomic.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:23 +00:00
Connor Abbott
0cf7bd3d6c tu: Use scratch mem for conditional loads/stores on a7xx
With concurrent binning, reading directly from the VSC_STATE registers
for conditional loads/stores doesn't work because BR and BV have their
own copy of VSC registers and the BV is running ahead of BR. Instead,
the blob's solution is to allocate extra space in memory for the
contents of VSC_STATE and upload it there. It has to be allocated
together with draw stream/prim stream because it is also written by BV
and read by BR and therefore it also needs to be duplicated to avoid
hazards. The memory is then read in BR via CP_MEM_TO_SCRATCH_MEM, which
is purpose-made for this.

Make turnip use this strategy on a7xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:23 +00:00
Connor Abbott
7c4cd508fb tu: Refactor VSC bo initialization
Make it easier to add more parts.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
f0d7f2174e freedreno/a7xx: Add BV registers for ROQ status
Add the BV equivalent of various registers used by crashdec to determine
where the SQE (actually now BR) is.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
88b855ccea freedreno: Decode CP_RESOURCE_LIST
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
1c35684814 freedreno: Add synchronization-related control registers
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
b5f1108045 freedreno/crashdec: Add support for CP_BV_MEMPOOL
The BV mempool is even further cut down compared to the "small mem pool"
layout which seems to be used by a610. It also shrinks the block size to
4 chunks instead of 8. This layout happens to be shared by a702, so
abstract out the layout into a "mempool size" enum.

While we're here, fix a bug with how the mempool offset for chunks is
printed. This accounts for the test diff.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
3f70b05784 freedreno/registers: Fix encoding fields in 64b registers
This was already broken for BINDLESS_BASE, but we didn't notice it
because we weren't using the builders. We have to cast fields that we OR
in, and we need to return uint64_t from the legacy field functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
ba427bc274 freedreno: Expand a7xx LRZ metadata definition
As expected there is a second copy of the metadata for the second
buffer, and pointers to the current buffer that are updated when
flipping.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:22 +00:00
Connor Abbott
77b68ee78b freedreno/a7xx: Document GRAS_LRZ_CB_CNTL
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:21 +00:00
Connor Abbott
efc4bb5174 freedreno: Document BV BIN_PREAMBLE usage
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36590>
2025-10-28 19:33:20 +00:00
Job Noorman
32b646c597 nir: print in_bounds info for deref_type(_ptr_as)_array
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: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38110>
2025-10-28 14:21:01 +00:00
Job Noorman
0a6d698482 spirv: set in_bounds for ptr_as_array
Signed-off-by: Job Noorman <jnoorman@igalia.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38110>
2025-10-28 14:21:01 +00:00
Job Noorman
0ac55b786a spirv: don't set in_bounds for structs
The arr::in_bounds field was set unconditionally for every deref created
for a chain. For struct derefs, which don't have this field, this would
write to an unused memory location, which is probably why this never
caused issues.

Signed-off-by: Job Noorman <jnoorman@igalia.com>
Fixes: f19cbe98e3 ("nir,spirv: Preserve inbounds access information")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38110>
2025-10-28 14:21:01 +00:00
Danylo Piliaiev
62f0ef3445 tu: Faster descriptor set allocator
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
memmove was slow on large number of descriptor when destroying some of
them.

util_vma_heap is perfect for the task, ANV and RADV already use it.
It also simplifies the code.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38053>
2025-10-28 11:20:05 +00:00
Juan A. Suarez Romero
562bb8b62b v3dv: align width to 256 when using simulator
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:55 +00:00
Juan A. Suarez Romero
08e2da2379 v3d: set stride alignment when using simulator
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:55 +00:00
Juan A. Suarez Romero
d48b276acd broadcom/simulator: add helper to get stride alignment
Some GPUs, like AMD, has specific stride align requirements in order to
display the content correctly.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:55 +00:00
Juan A. Suarez Romero
5947eae0af v3d/simulator: create GEM BOs in GTT memory for AMD GPUs
As the BOs created in GPU needs to be accessible from the simulator,
create them in GTT memory, with CPU access.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:55 +00:00
Juan A. Suarez Romero
977d4f34dd vc4: set stride alignment when using simulator
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:55 +00:00
Juan A. Suarez Romero
aec701d094 vc4/simulator: add helper to get stride alignment
Some GPUs, like AMD, require specific stride alignment in order to
display the content correctly.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:54 +00:00
Juan A. Suarez Romero
66d715bac3 vc4/simulator: create GEM BOs in GTT memory for AMD GPUs
As the BOs created in GPU needs to be accessible from the simulator,
create them in GTT memory, with CPU access.

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37887>
2025-10-28 11:03:54 +00:00
Valentine Burley
84fa5ecff6 panvk/ci: Add an ANGLE job on G925
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Disable the max-fails feature in deqp-runner for this job, since it
aborts the run due to failures that don't occur otherwise.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38051>
2025-10-28 10:09:28 +00:00
Valentine Burley
3e14c64b28 panvk/ci: Add a VKCTS job on G925
This job runs on MT8196 Rauru Chromebooks.

Also remove the old G725 expectation files, as G725 is a smaller variant
of G925.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38051>
2025-10-28 10:09:28 +00:00
Valentine Burley
c4778f1d27 panfrost/ci: Drop redundant KERNEL_IMAGE_NAME for rock-5b
This was already the default value.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38051>
2025-10-28 10:09:28 +00:00
Valentine Burley
2bec7fb8c7 ci: Update linux-firmware version to pick up more ARM firmware
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38051>
2025-10-28 10:09:28 +00:00
David Rosca
0977ca2854 radeonsi/vce: Don't check ref modification and marking flags
The number of operations is now correctly set to 0 when needed.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38050>
2025-10-28 09:43:26 +00:00
David Rosca
1232a7a754 frontends/va: Always reset H264 slice ref modification and marking count
This way the driver doesn't need to check the flag.

Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38050>
2025-10-28 09:43:26 +00:00
David Rosca
b6a00adb41 radeonsi/vcn: Support H264 encode pic_order_cnt_type 1
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38052>
2025-10-28 09:14:24 +00:00
David Rosca
8c2de21090 frontends/va: Support H264 encode pic_order_cnt_type 1
Reviewed-by: Benjamin Cheng <benjamin.cheng@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38052>
2025-10-28 09:14:24 +00:00
Benjamin Cheng
cef8eff74d radv/video: Override H265 SPS unaligned resolutions
VCN requires 64x16 alignment for HEVC. When the app requests non-aligned
resolutions, make up for it with conformance window cropping.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38061>
2025-10-28 08:53:35 +00:00
Benjamin Cheng
84b6d8e0d7 radv/video: Override H265 SPS block size parameters
VCN only supports this set of parameters.

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38061>
2025-10-28 08:53:35 +00:00
Yogesh Mohan Marimuthu
53b9389563 winsys/amdgpu: use correct vm_timeline_point for userq creation
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
doorbell does not require va address mapping from userspace and hence
amdgpu_bo_va_op_common() function is not called and therefore doorbell
bo->vm_timeline_point is not updated. Currently to wait for all mappings
to be ready doorbell vm_timeline_point is used which is incorrect.

This patch updates vm_timeline_point to wait for all bos. The bos
can be real bo or slab bo. slab bo can be from old buffer and hence
there is a check to update vm_timeline_point to wait only if it is
new.

Reported-by: Zhang, ShanYi (Ken) <ShanYi.Zhang@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38059>
2025-10-28 07:23:43 +00:00
Samuel Pitoiset
45affb0e53 radv: advertise VK_EXT_shader_uniform_buffer_unsized_array
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38047>
2025-10-28 07:55:40 +01:00
Aitor Camacho
66bc12a747 kk: Set drawID in root descriptor table
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Arcady Goldmints-Orlov
9be352df12 kk: Enable VK_EXT_shader_atomic_float
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Arcady Goldmints-Orlov
53de36895c kk: enable shaderStencilExport
This requires a small new NIR pass to force the stencil output to be unsigned.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Arcady Goldmints-Orlov
d3424de889 kk: enable shaderDrawParameters
Currently draw_id is always 0 since we don't support multidraw yet.

Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Arcady Goldmints-Orlov
8c9e9555e8 kk: enable logicOp
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Arcady Goldmints-Orlov
938390c075 kk: enable dualSrcBlend
Reviewed-by: Aitor Camacho <aitor@lunarg.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38067>
2025-10-28 01:38:34 +00:00
Faith Ekstrand
a9e0adc679 nvk: Advertise VK_KHR_maintenance10
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:20:32 -04:00
Faith Ekstrand
268a1db7cc nvk: Advertise the new maintenance10 format features
We don't actually advertise compute-only or depth-only queues right now
but nothing in the spec says you have to advertise the queues in order
to advertise the bits.  Setting them now ensures we don't forget them
when compute-only or transfer-only queues get added.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:19:43 -04:00
Faith Ekstrand
0a5a456259 nvk: Switch to CmdEndRendering2KHR()
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:19:43 -04:00
Faith Ekstrand
6e3eeb6118 nvk: Plumb attachment flags through to MSAA resolve
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:19:43 -04:00
Faith Ekstrand
bbbf037303 vulkan/meta: Handle VkResolveImageModeInfoKHR
This contains resolve modes which override the format-based defaults as
well as resolve flags to allow disabling sRGB conversion.

Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:19:43 -04:00
Faith Ekstrand
b5d5836fd1 vulkan/meta: Handle VK_RENDERING_ATTACHMENT_RESOLVE_SKIP_TRANSFER_FUNCTION_BIT
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38094>
2025-10-27 16:19:43 -04:00