Commit graph

195271 commits

Author SHA1 Message Date
Connor Abbott
96513b5e8e freedreno/ci: Skip dEQP-VK.memory.mapping.*.full.variable.*
These use too much memory with VM_BIND and aren't super useful. We have
to skip them even with the full jobs to avoid taking them out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:58 +00:00
Connor Abbott
938ac2b67d freedreno/ci: Add sparse-related a618 skips
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:58 +00:00
Connor Abbott
4d2c14847f tu: Support sparseResidencyAliased
UCHE and CCU use virtual-tagged addresses, so whenever an alias may have
changed we have to always flush and invalidate everything. We detect
this through the sparse memory aliasing flag on the buffer/image, or for
plain memory barriers whether the feature is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
8feed47fce tu: Initial support for sparse binding
Plumb through support for a sparse queue and enable sparse binding using
the kernel interfaces we added earlier. We also support sparse residency
for buffers, which is straightforward, but sparse residency for images
is much more complicated so it will be enabled later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
71ef46717c tu/kgsl: Add support for sparse binding
Use the "virtual BO" interface.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
797c74452f tu/drm: Add support for sparse binding
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
f9daddf5d5 tu/knl: Add an API for sparse binding
Add a "sparse VMA" abstraction, and functions creating them, destroying
them, and submitting commands to map and unmap BOs into them. This
mirrors the Vulkan API, but with image offsets resolved to page offsets.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
4efbfa1441 tu/drm: Enable VM_BIND
Use a new driver-internal VM_BIND submit queue for mapping and unmapping
"normal" BOs. This will be required for sparse, because we can't mix
the old and new interface, but it should also allow us to stop using
"zombie" VMAs and the bo list.

Also use MSM_BO_NO_SHARE, which we assume is available when VM_BIND is.
This should significantly reduce kernel submit overhead, in parallel to
the userspace submit overhead cut by using VM_BIND.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
460ed35916 tu: Fix CmdBindTransformFeedbackBuffersEXT size handling
According to the spec and as implemented by other drivers, this should
use the size of the buffer instead of the size of the VkDeviceMemory
it's bound to when VK_WHOLE_SIZE is specified or pSizes is NULL. The
current behavior doesn't make sense at all for sparse buffers which are
not bound to a single VkDeviceMemory. Just use the common helper that
already does the right thing, copied from anv.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
aa392e1ec2 tu: Align BO size to page size
The kernel was rounding the size up for us, but it doesn't like a
non-aligned map size, so just sanitize the size here.

tu_cs was relying on the size not being rounded to keep the maximum size
2^20-1 or less, so fix that by using the initial unrounded size.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
d8d0e73899 freedreno/drm: Import new UABI for VM_BIND
Imported from kernel commit 203dcde88156
("Merge tag 'drm-msm-next-2025-07-05' of https://gitlab.freedesktop.org/drm/msm into drm-next").

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Connor Abbott
51a7aebc86 tu: Refactor BO deletion
For VM_BIND, BO deletion will have to be implemented differently in
native drm and virtio. We already have a somewhat awkward situation with
native-specific code in the common BO deletion helper, which we only get
away with because it's for kernels without SET_IOVA in which case virtio
isn't supported. Add a few common helpers for some of the guts, and move
the guts into backend-specific functions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:57 +00:00
Christian Gmeiner
e689b342fe etnaviv: Optimize sampler view iteration with u_foreach_bit(..)
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Replace loop over all PIPE_MAX_SAMPLERS with u_foreach_bit(..) to iterate
only over active sampler views. This avoids unnecessary iterations.

Improves drawoverhead test 1 performance by ~10%.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36831>
2025-08-25 19:21:09 +00:00
Dave Airlie
a6e0cbd110 radv: consolidate cooperative matrix array sizes enumeration
Share the code between khr and nv paths to not have to recreate it.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36544>
2025-08-25 18:55:08 +00:00
Dave Airlie
a55c036450 radv: add support for coopmat2 flexible dimensions
This allows matricies that are multiples of a base size.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36544>
2025-08-25 18:55:08 +00:00
Dave Airlie
7a96a928a2 nir: add coop mat flexible dimensions lowering.
This adds a generic lowering pass for coop mat flexible dimensions.

This should be suitable for all drivers that implement coop mat2 flexible dimensions
or even just lowering sw exposed sizes to hw sizes.

Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36544>
2025-08-25 18:55:08 +00:00
Mike Blumenkrantz
39ffc3f629 zink: when sparse unbinding, always wait on main timeline semaphore
this ensures synchronization between gfx/compute work and the sparse queue

fixes KHR-GL46.sparse_buffer_tests.BufferStorageTest_cases_*. on turnip

cc: mesa-stable

Closes: #13747
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
2025-08-25 14:35:25 -04:00
Mike Blumenkrantz
2cf626d17d zink: pass ctx to sparse bind functions
no functional changes

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
2025-08-25 14:35:25 -04:00
Mike Blumenkrantz
c9746103f5 zink: break out unflushed batch waiting into separate function/mechanism
this is useful on its own

no functional changes

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
2025-08-25 14:35:25 -04:00
Mike Blumenkrantz
483d53e0e3 zink: ALWAYS_INLINE resource inlines
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
2025-08-25 14:35:25 -04:00
Mike Blumenkrantz
f9bf524a6d zink: inline zink_resource_access_is_write()
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36954>
2025-08-25 14:35:25 -04:00
Connor Abbott
bef37336fb vulkan/queue: Fix VkTimelineSemaphoreSubmitInfo sanitization
We're supposed to completely ignore VkTimelineSemaphoreSubmitInfo if
there aren't any timeline semaphores, including the array lengths, which
is made clear by the various VUs already cited by the code. The
vkQueueSubmit() path correctly handled this when asserting but still
dereferenced pWaitSemaphoreValues unconditionally, which could lead to
dereferencing an invalid pointer if waitSemaphoreValueCount is less than
waitSemaphoreCount. The vkQueueSparseBind() path didn't even assert
correctly. Bring vkQueueSparseBind() in line with vkQueueSubmit()
and make both only dereference the wait/signal array once we've
determined it must be present. While we're here, also fix the assert in
vkQueueSubmit() to disallow a waitSemaphoreValueCount of 0 if there are
timeline semaphores present, which conversely is not allowed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36989>
2025-08-25 17:57:47 +00:00
Sagar Ghuge
2cd564c1de anv: Add missing L3 flushes
We are reading out some of the parameters from IR data structure those
have been written previously, on some platforms L3 is not coherent, so
explicitly add those flushes.

Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36952>
2025-08-25 17:36:08 +00:00
Sagar Ghuge
4473e21e2f anv: Enable CS stall for ACCELERATION_STRUCTURE_COPY stage
Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36952>
2025-08-25 17:36:08 +00:00
Sagar Ghuge
75d770b4f8 anv: Add missing ACCELERATION_STRUCTURE_READ in barrier handling
Cc: mesa-stable
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36952>
2025-08-25 17:36:08 +00:00
Jesse Natalie
fee83f4fcc d3d12: Move logicop descriptor initialization to after all blits
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The blit code is destructive on the framebuffer state, which means
that it can set new render targets. If you have 2 BGRA surfaces bound
for logic ops, then after setting up the surface for the first one,
the blit for the second will end up destroying + re-creating the
surface for the first one.

Let's be robust to this by putting the blit in a first pass, and
then actually initializing all of the descriptors in a second pass.

This is still woefully inefficient but at least it's correct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36945>
2025-08-25 17:21:37 +00:00
Jesse Natalie
cd3885c592 d3d12: Move logicop emulation resource from surface to resource
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36945>
2025-08-25 17:21:37 +00:00
Jesse Natalie
784f93653a d3d12: Support more logic op formats
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36945>
2025-08-25 17:21:36 +00:00
Jesse Natalie
91c063493d d3d12: Stop using util_framebuffer_init
For https://gitlab.freedesktop.org/mesa/mesa/-/issues/13262

This just inlines the existing logic. A surface cache needs to be
introduced next.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36945>
2025-08-25 17:21:36 +00:00
Georg Lehmann
635ac758c9 aco/optimizer: don't create undef copies from p_create_vector
p_create_vector allows undef operands, p_parallelcopy doesn't.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13765
Fixes: 01d20680e2 ("aco/optimizer: generalize p_create_vector of split vector opt")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
2025-08-25 16:47:38 +00:00
Georg Lehmann
8903bb4618 aco/optimizer: don't apply packed clamp to v_fma_mix
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13758
Fixes: 345bf8a2f2 ("aco/optimizer: remove label_vop3p")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36963>
2025-08-25 16:47:38 +00:00
Antonio Ospite
1dd1995388 nvk: silence error when cross-building for Android
When cross-building NVK for Android the compiler emits this error:

-----------------------------------------------------------------------
../src/nouveau/vulkan/nvk_image.c:1084:38: error: unused variable 'pdev' [-Werror,-Wunused-variable]
 1084 |    const struct nvk_physical_device *pdev = nvk_device_physical(dev);
      |                                      ^~~~
1 error generated.
-----------------------------------------------------------------------

Mark the variable definition as UNUSED to silence the error.

Acked-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
2025-08-25 15:55:53 +00:00
Mike Blumenkrantz
dfab0e952b zink: sprinkle in a bunch of MESA_TRACE_FUNC
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36984>
2025-08-25 15:34:20 +00:00
Eric Engestrom
9d0203bace ci/piglit: automatically use baremetal proxy
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/36955>
2025-08-25 14:52:38 +00:00
Eric Engestrom
fa74e939bf ci/piglit: automatically use LAVA proxy
This avoids having to hardcode the proxy in the traces `download-url` or
jobs setting `PIGLIT_REPLAY_EXTRA_ARGS` and accidentally overriding the
default args when the author meant to append.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36955>
2025-08-25 14:52:38 +00:00
Eric Engestrom
b4e49664f4 vmware/ci: fix caching proxy url
FDO_HTTP_CACHE_URI is not defined, but LAVA_HTTP_CACHE_URI is and is the
right URL for this.

This job is currently disabled, but fix it in preparation for when
someone eventually brings it back.

Note that this line also has another bug that will be addressed by the
next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36955>
2025-08-25 14:52:37 +00:00
Eric Engestrom
2851a305fd virgl/ci: drop invalid but overridden empty caching proxy
The variable is undefined, leading to an empty proxy being set, but
luckily it's actually overridden back to the default args, so this was
just dead code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36955>
2025-08-25 14:52:37 +00:00
Erik Faye-Lund
af203146f2 panvk: properly handle errors from utrace_context_init
Without this, I get failures in the following CTS test:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic

Fixes: 05006c21dd ("panvk/utrace: Alloc utrace copy buf from userspace heap")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36980>
2025-08-25 14:15:57 +00:00
David Rosca
e1fcc403d4 radeonsi/vcn: Fix HEVC encode transform_skip with old FW
Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
2025-08-25 13:55:40 +00:00
David Rosca
26fc4798c1 radeonsi/vcn: Fix HEVC encode cu_qp_delta with old FW
VCN2 needs interface version bump to enable it.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
2025-08-25 13:55:39 +00:00
David Rosca
e945bb3649 radeonsi/vcn: Fix compatibility with old FW for encode
The interface version can't be higher than the FW version, otherwise
FW will reject all encode jobs.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36845>
2025-08-25 13:55:39 +00:00
David Rosca
51d5c0d537 radeonsi/vcn: Disable H264/5 constrained intra pred with rate control
There is a FW issue when using constrained intra prediction with rate
control enabled, causing unexpected quality degradation.
Disable it until FW fix is available.

Cc: mesa-stable
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36837>
2025-08-25 13:34:00 +00:00
Samuel Pitoiset
102892a458 radv: clear RADV_CMD_DIRTY_xxx bits outside of the caller in most cases
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Prevent risks if an early return is added at some point.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:39 +00:00
Samuel Pitoiset
3ecf9a17f8 radv: stop abusing dirty_dynamic when binding a NULL fragment shader
RADV_DYNAMIC_RASTERIZATION_SAMPLES triggers the following states:
- FS (not needed when FS is NULL)
- MSAA (already triggered)
- BINNING (use radv_get_ps_iter_samples() on GFX9)
- OCCLUSION_QUERY (doesn't use the PS)
- DB_SHADER_CONTROL (already triggered)
- RAST_SAMPLES (use radv_get_ps_iter_samples())
- NGGC (doesn't use the PS)

So this can be simplified to BINNING (gfx9) | RAST_SAMPLES.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:38 +00:00
Samuel Pitoiset
19c712c8ef radv: rename rast_prim to vgt_outprim_type everywhere
To avoid confusion between the primitive topology and the output
rasterized primitive.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:38 +00:00
Samuel Pitoiset
5dec043cee radv: dirty the rast samples state when VRS is forced to 1x1
Only these two states use force_sample_iter_shading_rate.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:37 +00:00
Samuel Pitoiset
8120d14ee0 radv: dirty RADV_CMD_DIRTY_xx states when binding sample shading state
This reduces the number of states that are re-emitted but the logic
is mostly duplicated because sample shading can be set from the
fragment shader or the graphics pipeline. Could be refactored
eventually.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:34 +00:00
Samuel Pitoiset
4afff72e91 radv: dirty the rast sample states for VRS att/OOO rast
These fields are only used by radv_emit_rast_samples_state().

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:32 +00:00
Samuel Pitoiset
4dd05c9a91 radv: remove dead code when setting dynamic primitive topology
This is already handled slightly above in the same function. Also
state->dirty isn't for RADV_DYNAMIC_xxx and there is no corresponding
RADV_CMD_DIRTY_xxx either.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:31 +00:00
Samuel Pitoiset
dbcc9aa942 radv: remove radv_cmd_buffer_flush_dynamic_state()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36912>
2025-08-25 12:17:31 +00:00