Commit graph

1493 commits

Author SHA1 Message Date
Samuel Pitoiset
4c66fc1383 venus: use drirc_gen
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41881>
2026-06-10 07:17:14 +00:00
Jason Macnak
1ca550927f virtgpu_kumquat_ffi: replace mutex.get_mut() with mutex.lock()
mutex.get_mut() says

   Since this call borrows the Mutex mutably, no actual locking
   needs to take place – the mutable borrow statically guarantees
   no new locks can be acquired while this reference exists.

However, the borrow checker does not really apply inside of the
unsafe ffi functions which can result in unintended concurrent
access.

Bug: b/519657682
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42061>
2026-06-08 19:07:43 +00:00
Yiwei Zhang
2cf1f6cb50 venus: fix unbound malloc leak in vn_ring_get_submits
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Credits to Toshinari Morikawa, and this supersedes
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41904.

ring->free_submits can go unbound for heavy scenes that use 3 or more
shm pool allocs for CS storage. This change fixes to loop through the
free list for a cached entry, which is good enough in practice since
the most recently retired submit is cached at the list head.

Cc: mesa-stable
Reported-by: Toshinari Morikawa <morikawa.toshinari@jp.panasonic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41917>
2026-06-08 03:32:20 +00:00
Yiwei Zhang
4e8595da21 venus: let resource_create_blob wait for mem alloc
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Previously, the mem alloc wait barrier is via a separate renderer
submission (e.g. execbuf for virtgpu backend). In fact, we can leverage
the cmd payload in resource_create_blob to avoid the extra submission.
This would help downstream win32 backend as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42003>
2026-06-04 16:33:02 +00:00
Yiwei Zhang
77b73d8595 venus: update create_from_device_memory to take a cmd payload
This is to leverage drm_virtgpu_resource_create_blob::cmd for expressing
the blob mem host resource dependency in the virtgpu backend, which can
avoid the execbuf. Similar for vtest backend.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/42003>
2026-06-04 16:33:02 +00:00
Sid Pranjale
020a6bc282 vulkan: implement VK_EXT_debug_marker
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/32722>
2026-06-01 15:31:38 +00:00
Val Packett
118e48402c util: rust: align API with real eventfd capabilities
Linux eventfds contain a 64-bit value which can be increased by arbitrary
numbers, and waiting returns a numeric value that consumers might need
to actually read.

Also, reading/waiting does mutate kernel state, so make it &mut self
like reading on std::fs::File is.

Signed-off-by: Val Packett <val@invisiblethingslab.com>
Signed-off-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Reviewed-by: David Gilhooley <djgilhooley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41754>
2026-05-29 03:07:51 +00:00
Valentine Burley
2d56ccbfe0 venus/ci: Widen the ANV skips
These could still cause hangs:
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/100936550
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/100935415

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41516>
2026-05-28 10:17:25 +00:00
Valentine Burley
190ce8280f meson: Add Soong compatibility compiler flags to Vulkan drivers
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Suggested by @gurchetansingh.

Android's Soong build system treats several compiler warnings as errors
by default: https://android.googlesource.com/platform/build/soong/+/27f57506/cc/config/global.go/#218

To catch these issues in Mesa, introduce `soong_compat_c_args`
and `soong_compat_cpp_args` with the following flags treated as errors:
 -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
 -Werror=date-time
 -Werror=gnu-alignof-expression
 -Werror=ignored-qualifiers
 -Werror=implicit-fallthrough
 -Werror=int-conversion
 -Werror=missing-prototypes
 -Werror=pragma-pack
 -Werror=pragma-pack-suspicious-include
 -Werror=sizeof-array-div
 -Werror=string-plus-int
 -Werror=unreachable-code-loop-increment

These compatibility flags are added to the meson configurations
for ANV, Gfxstream, Lavapipe, PanVK, Turnip, and Venus.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Gurchetan Singh <gurchetan.singh.foss@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41644>
2026-05-22 07:09:49 +00:00
Samuel Pitoiset
54b71e9e77 util: pass a struct to driParseConfigFiles()
It would be easier to add more functionalities like shader hashes etc.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41657>
2026-05-19 19:51:45 +00:00
Valentine Burley
84645c9d8f venus/ci: Skip more even more robustness and synchronization2 tests on ANV
These can cause hangs on CML:
https://gitlab.freedesktop.org/Valentine/mesa/-/jobs/99906137
https://gitlab.freedesktop.org/Valentine/mesa/-/jobs/99901358

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41541>
2026-05-15 17:38:59 +00:00
Valentine Burley
6cf5da8dd3 ci/deqp: Rewrite headless Android WSI patch
Update the headless Android WSI patch to fix intermittent timeout issues. It
now uses an ImageReader listener to actively drain and instantly release frames
from the buffer queue. This acts as a "null compositor" that prevents buffer
starvation while maintaining stable GPU backpressure.

This fixes dEQP-VK.wsi.android.maintenance1.* in newer VKCTS versions and
resolves the race conditions that caused occasional teardown crashes.

Also rebase build-deqp-gl_Build-Don-t-build-Vulkan-utilities-for-GL-builds.patch
on top of the updated WSI patch.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41541>
2026-05-15 17:38:59 +00:00
Yiwei Zhang
e6734ed39e venus: fix a renderer side queue timeline bound race
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Timeline assignment has been asynchronous upon vkGetDeviceQueue2.
However, fence submission via vq can get ahead of it for things like
ring and vq synchronization. This change fixes vkGetDeviceQueue2 to be
synchronous instead, which is fine since it's off the critical path.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41582>
2026-05-15 16:11:29 +00:00
Emma Anholt
76c39acad7 ci: Update VK CTS to 1.4.5.3 with fixes.
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
I've pulled in a pile of changes to reduce the overhead (runtime and
memory) when sharding for deqp-runner, along with a bunch of fixes for
KHR_display testing that we recently enabled, plus a few others that
affect our drivers.

The big new set of failures looks like it's from more complete coverage of
blitting between formats.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41243>
2026-05-14 04:22:21 +00:00
Valentine Burley
fc4c44b09d ci/android: Remove CtsDeqpTestCases from Android CTS
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
CtsDeqpTestCases was originally added to run WSI tests on Android.
This is now covered by the command-line dEQP executable, which produces
comparable results and is much, much faster thanks to multithreading via
deqp-runner.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
2026-05-06 15:51:28 +02:00
Valentine Burley
11720e1b58 venus/ci: Enable WSI testing on Android
We can now run dEQP-VK.wsi.android.* and more EGL tests with ANGLE in the
deqp-runner suite.

The regular VKCTS test set had to be reduced to fit within the time
limit.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41314>
2026-05-06 15:51:28 +02:00
Yiwei Zhang
1883f3094f ci: uprev virglrenderer
This uprev:
- brings in vrend fixes with virgl ci expectation updated
- enables new venus extensions support
- drops render-server-worker since process isolation is the default
- updates venus ci expectations

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41331>
2026-05-05 00:41:46 +00:00
Valentine Burley
207aa9eba4 venus/ci: Skip more robustness tests on ANV
dEQP-VK.robustness.buffer_access.* can cause hangs in Cuttlefish:

https://gitlab.freedesktop.org/mesa/mesa/-/jobs/98383598

04-27 18:45:39.578  5675  5675 I dEQP    : Test case 'dEQP-VK.robustness.buffer_access.through_pointers.compute.reads.32B_in_memory_with_vec4_f32'..
04-27 18:45:39.583  5675  5675 I vulkan  : CreateInfoWrapper::FilterExtension: already have 'VK_KHR_external_fence_fd'.
04-27 18:45:43.428  5675  5675 D MESA-VIRTIO: stuck in fence wait with iter at 1024
04-27 18:45:43.486  5675  5675 D MESA-VIRTIO: ERROR: ffb must be signaled now
04-27 18:45:43.488  5675  5675 I dEQP    :   Fail (vk.waitForFences(*m_device, 1, &m_fence.get(), true, ~(0ull) ): VK_ERROR_UNKNOWN at vktRobustBufferAccessWithVariablePointersTests.cpp:1608)

Skip the entire group to improve CI stability.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41296>
2026-04-30 21:58:55 +00:00
Yiwei Zhang
58cc8e1f85 venus: adopt common ANB helpers
Below are adopted:
- vk_android_get_anb_layout
- vk_android_import_anb
- vk_android_import_anb_memory

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
2026-04-24 16:25:36 +00:00
Yiwei Zhang
4c4302d14b venus: adopt common vk_image::anb_memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
2026-04-24 16:25:36 +00:00
Yiwei Zhang
d4ae409365 venus: refactor vn_android_get_wsi_memory to return VkDeviceMemory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
2026-04-24 16:25:36 +00:00
Yiwei Zhang
f91520f75b venus: adopt vk_android_get_ahb_layout
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
2026-04-24 16:25:35 +00:00
Yiwei Zhang
61bd3fcd84 venus: adopt vk_android_init_deferred_image
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41145>
2026-04-24 16:25:35 +00:00
Yiwei Zhang
2cfbc7ef9a ci/venus: update expectation for an expected fail
Failed since the below MR and was said to be a CTS bug:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40520

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:04 +00:00
Yiwei Zhang
b90adb10e8 venus: ensure ffb can catch device lost
similar to qfb

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15206
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:04 +00:00
Yiwei Zhang
35a18596ee venus: add vn_get_fence_status that takes vn_relax_state
No behavior change in this commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:04 +00:00
Yiwei Zhang
e3afacb7b3 venus: ensure sfb can catch device lost
Similar to qfb except that we skip sfb consistency validation here.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:04 +00:00
Yiwei Zhang
20533207d3 venus: add vn_get_semaphore_counter_value that takes vn_relax_state
No behavior change in this commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:04 +00:00
Yiwei Zhang
9764c494ef venus: ensure qfb can catch device lost
qfb shortcuts the synchronous query wait, so venus might be unable to
populate the device lost error from the host Vulkan driver. This change
emits a host call upon vn_relax warn order for that purpose. If the host
call ends up successful, we double check the qfb availability for
consistency to avoid silent regressions in qfb code path.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:03 +00:00
Yiwei Zhang
de86f0223d venus: add vn_relax_warn to check if at warn order
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:03 +00:00
Yiwei Zhang
b1de02b7ea venus: relocate vn_query_feedback_wait_ready into qfb query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:03 +00:00
Yiwei Zhang
c8d9142b1f venus: add vn_get_query_pool_results for non-qfb
This is the legacy path. Refactor to a helper to prepare for more
robust device lost detection.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40790>
2026-04-10 12:16:03 +00:00
Valentine Burley
338a96f0a0 venus/ci: Move android-angle-venus-tu-a618 to sc7180-trogdor-kingoftown
Huge thanks to Laura and Doug for updating the EC and AP firmware, and
for switching the network adapter across all trogdor Chromebooks,
enabling them to boot Cuttlefish.

Also limit the concurrency to 6 for now.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40010>
2026-04-03 09:25:14 +00:00
Valentine Burley
be65d69b02 ci/venus: Skip crashing Android CTS test on ANV
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40600>
2026-03-25 07:51:08 +00:00
Georg Lehmann
284b4143f7 gallivm: don't optimize fadd(a, 0.0) with signed zero preserve
Fixes: 540e84bedb ("gallivm: Preserve -0 and nan")
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40520>
2026-03-23 17:58:32 +00:00
Yiwei Zhang
c2fe95a364 venus: fix to relax the KHR_external_memory_fd requirement
This reverts commit 1895de16a6. The proper
way to filter out venus incapable physical devices is to do the platform
specific check during renderer side instance creation time.

Fixes: 1895de16a6 ("venus: filter out venus incapable physical devices")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40478>
2026-03-23 17:39:53 +00:00
Marek Olšák
102d41799b Rename more sha and sha1 names to blake3
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:28 +00:00
Marek Olšák
d4831aaf5f Rename sha1_* and sha_* names to blake3_*
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:28 +00:00
Marek Olšák
c0ac992a2a Remove mesa-sha1.h
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Marek Olšák
699f9d7066 Inline _mesa_sha1_init/update/final functions
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Marek Olšák
a965ada6ee Inline mesa_sha1, SHA1_CTX
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Marek Olšák
110632f702 Inline SHA1_DIGEST_LENGTH
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40383>
2026-03-23 07:03:27 +00:00
Yiwei Zhang
1a302155ee venus: force prime blit on Nvidia GPU
Normally Venus on Nvidia GPUs takes the prime blit path. The exception
is when KWin or any wlroots based compositors are used:
1. KWin and wlroots based compositors always add LINEAR to dmabuf
   feedback tranches assuming LINEAR can be handled by GPU drivers.
2. Venus + Virgl only sees the compositor injected LINEAR mod since
   Virgl doesn't support explicit modifiers on the driver side.
3. Nvidia GPUs doesn't support LINEAR color attachment, and it's too
   late to reject LINEAR mod when the native image path has already
   been taken instead of the prime image path.

Gamescope requires VK_EXT_physical_device_drm and its runtime doesn't
use standard WSI extensions, so venus can spoof without impacting it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40339>
2026-03-12 20:03:19 +00:00
Yiwei Zhang
b5655609b0 ci/venus: update expectation based on nightly job runs
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
https://gitlab.freedesktop.org/mesa/mesa/-/jobs/94723493

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40362>
2026-03-12 18:19:47 +00:00
Valentine Burley
2addcc1dce venus/ci: Add an Android Venus on Turnip job on a618
Add a nightly job running Cuttlefish with Venus on Turnip.

Similar to the existing Venus-on-ANV jobs, this uses Cuttlefish's
'venus_guest_angle' mode to run deqp-vk and deqp-egl with ANGLE and
Venus inside the Android guest, with Turnip on the host.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39993>
2026-03-10 09:54:03 +01:00
Valentine Burley
0478046036 venus/ci: Remove hanging timeout override for ADL and TGL jobs
New deqp-runner version prints messages more frequently.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39993>
2026-03-10 09:53:29 +01:00
Eric Engestrom
078fd1b19f venus/ci: update expectations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40243>
2026-03-05 18:29:29 +00:00
Yiwei Zhang
f85416e79d ci/venus: skip broken drm display tests
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40227>
2026-03-04 20:20:14 +00:00
Valentine Burley
0468dbf989 venus/ci: Skip invalid SkQP test on ANV
This was clarified to be a spec violation: https://gitlab.khronos.org/vulkan/vulkan/-/issues/4713

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14912
Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40111>
2026-02-26 09:46:11 +01:00
Yiwei Zhang
835fd613b5 venus: expose VK_EXT_descriptor_heap by default
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The debug option is now toggled. VN_DEBUG=no_desc_heap can disable the
extension.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40085>
2026-02-25 18:02:46 +00:00