Commit graph

210975 commits

Author SHA1 Message Date
Samuel Pitoiset
944e26eae7 radv: fix hashing graphics pipeline when no stages are compiled
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
It's possible with GPL.

This fixes a NULL pointer dereference with updated pipeline binaries
tests in VKCTS.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36999>
2025-08-26 07:37:40 +00:00
Karol Herbst
b9f060438f nak: rework scale argument of compute_mat and rename it
"scale" was a bad name as it meant nothing others could comprehend.
However that value corresponded to the tile size of the Matrix layouts.
For int8 we have a tile size of 4, for 16 and 32 bit values we have a size
of 2.

For the future the same value need to be 32 for booleans, 8 for int4, 1
for fp64 and tf32 and 4 for all em types.

The "scale = 1 << scale;" assignment can simply be removed because it was
4 for 2 and 2 for 1 simply being the expected value after this change.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36391>
2025-08-26 09:06:51 +02:00
Georg Lehmann
d0f4b535fe nir: constant fold txd with 0 ddx/ddy to txl
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Foz-DB GFX1201:
Totals from 34 (0.04% of 80287) affected shaders:
Instrs: 3111158 -> 3111076 (-0.00%)
CodeSize: 16345020 -> 16344908 (-0.00%); split: -0.00%, +0.00%
Latency: 15378053 -> 15378063 (+0.00%); split: -0.00%, +0.00%
InvThroughput: 2940485 -> 2940477 (-0.00%); split: -0.00%, +0.00%
VClause: 79940 -> 79941 (+0.00%)
Copies: 228205 -> 228159 (-0.02%)
VALU: 1730040 -> 1729994 (-0.00%)

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36967>
2025-08-26 06:19:43 +00:00
Arseny Kapoulkine
bb3727ce5a ac/rgp: Warn when RGP capture can't be saved without libelf
Without this, mesa build on some distros may silently produce a version
of radv that silently refuses to save RGP traces

Signed-off-by: Arseny Kapoulkine <arseny.kapoulkine@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36960>
2025-08-26 00:42:16 +00:00
Mark Collins
098521559d freedreno/drm: Only initialize memory data source when Perfetto is active
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
FdMemoryDataSource was being registered as a Perfetto data source
unconditionally which led to anything calling fd_device_new(...)
attempting to do this even when they might not have Perfetto
initialized which is done as a part of util_perfetto_init, without
which trying to register the event causes a SEGFAULT.

Fixes: c7045e3e63 ("perfetto: unify init")

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36993>
2025-08-25 22:04:45 +00:00
Connor Abbott
7d925dbc52 freedreno/ci: Update a750 expectations
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/32533>
2025-08-25 20:11:58 +00:00
Martin Roukala (né Peres)
44dbf8756e freedreno/ci: uprev the kernel for the a750
We are still in the process of moving our kernels to gfx-ci/linux, but
we got the request to uprev the kernel a month ago when I started my
holiday, so let's not delay it more. Anyway, it is better to change
only one variable at a time so no harm done.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:58 +00:00
Connor Abbott
d921225af1 freedreno/ci: Update kernel with VM_BIND fixes
Pull in msm-fixes plus a few extra fixes we've accumulated from the
list.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32533>
2025-08-25 20:11:58 +00:00
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
cde83062ad ci/android: enable cross-building nvk and panvk for Android
Enable cross-building nvk and panvk for Android to make it easier to
spot build regressions.

NOTE: nvk is built only for x86_64, and panvk is built only for aarch64.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
2025-08-25 15:55:55 +00:00
Antonio Ospite
289913547c ci: bump DEBIAN_BUILD_TAG to include all the android/rust changes for nvk and panvk
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
2025-08-25 15:55:55 +00:00
Antonio Ospite
ca0f0d7b95 meson: handle dep_libdrm before the driver specific libdrm modules
Handle dep_libdrm before the driver specific libdrm modules, this is for
when libdrm is built as a subproject, for example libdrm_amdgpu is only
available after dep_libdrm has been added.

Acked-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
2025-08-25 15:55:54 +00:00
Antonio Ospite
9d26eb9a2f subprojects: fix ignore exception for files under packagefiles/
Fix the rule about not ignoring files under subprojects/packagefiles/
which is not covering files in subdirectories of
subprojects/packagefiles

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
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
Antonio Ospite
5ae3343590 ci/android: add comment about updating tags to create-android-cross-file.sh
Add a comment about updating tags in .gitlab-ci/image-tags.yml to the
.gitlab-ci/container/create-android-cross-file.sh as it is not immediate
that it gets called from .gitlab-ci/container/debian/android_build.sh
which also requires to update DEBIAN_BUILD_TAG.

Reviewed-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
Antonio Ospite
3cd4cc7d07 ci/android: add rust compiler to create-android-cross-file.sh
Add rust compiler definitions to the create-android-cross-file.sh file
to be able to cross-build drivers that use Rust code.

This is inspired by the changes in commit 2f5db959a7 ("docs/android:
update cross file and add nvk instructions", 2025-08-01)

Also add rust and bindgen to the debian/android_build container.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-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
David Rosca
fbbb5d15f0 ci: Add missing rust subprojects to meson/build.sh
Reviewed-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36710>
2025-08-25 15:55:52 +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