Commit graph

1411 commits

Author SHA1 Message Date
Yiwei Zhang
eb709cba47 venus: track prime blit dst buffer memory in the wsi image
This is to prepare for handling WSI implicit acquire fence.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39401>
2026-01-21 23:15:40 +00:00
Jason Macnak
bf55e43f30 gfxstream: Reland "Add Vulkan func/structs for passing debugging da..."
Reason for reland: relanding with host side fix

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39360>
2026-01-20 20:27:10 +00:00
Yiwei Zhang
2e683eb738 venus: fix aliased image memory requirement caching
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The spec doesn't guarantee that the aliased and non-alised image shares
the same memory requirement.

Fixes: 63cac09d74 ("venus: improve image memory requirement cache for image aliasing")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39398>
2026-01-20 18:10:04 +00:00
Gurchetan Singh
f38a25fd6b virtio/kumquat: fixes to enable meson2hermetic
The "log" dependency has loaded connotations since it's already
used for ALOGE(..) via the fake Android pkg-config files.

Use "rust-log" and "rust-libc" to mirror the clearer Debian
naming conventions.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39279>
2026-01-20 17:17:57 +00:00
Yiwei Zhang
419a3e66f8 venus: allow vtest to properly wait for present
Previously common wsi has a special submission to install implicit fence
to wsi memory directly, which has been deprecated in favor of bonfire
implicit fencing (implicit fencing has been turned into explicit fencing
within vulkan since then). The virtgpu backend is fine but the vtest
backend has been regressed since then, only relying on renderer side hw
driver doing implicit fencing.

With async present landed earlier, we can directly tell which submission
is done by common wsi, and can revive the idle waiting accordingly.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39377>
2026-01-19 21:01:13 +00:00
Yiwei Zhang
d4e2184904 venus: refactor vn_QueueSubmit2
To prepare for fixing vtest wsi present.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39377>
2026-01-19 21:01:13 +00:00
Yiwei Zhang
c2c9266fed venus: workaround to consider ALIAS for image mem req cache
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
ANV can return different memory requirements with and w/o the ALIAS bit.
See https://gitlab.freedesktop.org/mesa/mesa/-/issues/14671 for details.

Meanwhile, venus has a driver side cache for image memory requirements.
As blessed per spec for memory aliasing, venus strips the ALIAS bit when
populating the cache key. Because of the use of imageless mem req query,
the ALIAS mem req now can hit the cache first, leaving a smaller/relaxed
requirement in the cache...busted.

Venus is unable to fix ANV behavior behind the scene, so this workaround
is only to align Venus behavior with ANV to not suffer from Venus-only
rendering artifacts.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39368>
2026-01-18 08:48:01 +00:00
Yiwei Zhang
fea23746ce venus: amend missing logs for image format cache dump
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39339>
2026-01-18 08:10:53 +00:00
Yiwei Zhang
c57659c9a3 venus: cache VkBufferUsageFlags2CreateInfo
Proton has widely used this struct.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39339>
2026-01-18 08:10:53 +00:00
Yiwei Zhang
a16ae2f684 venus: refactor vn_buffer_get_cache_index
Prepare to handle VkBufferUsageFlags2CreateInfo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39339>
2026-01-18 08:10:53 +00:00
Yiwei Zhang
25970096d4 venus: only preserve 12 bits for VkBufferCreateFlagBits
Save more bits to prepare for VkBufferUsageFlags2CreateInfo.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39339>
2026-01-18 08:10:52 +00:00
Valentine Burley
71171abadb venus/ci: Switch Alder Lake job to Xe KMD
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The Android 16 Cuttlefish build comes with a new Xe minigbm backend that
we can use on the host in the android-angle-venus-anv-adl nightly job.
Also update two outdated comments.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39297>
2026-01-13 22:48:26 +00:00
Yiwei Zhang
c8144ae072 venus: vn_wsi_sync_wait to relax queue access for async present
As mentioned in earlier commit, for sem fd export on async present
thread, it occurs after internal queue submissions for all swapchains.
So we can allow queue commands while sync wait w/o violating ordering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:14 +00:00
Yiwei Zhang
6b5a4b55fb venus: enable async presentation along with a perf option
Async presentation can be disabled via VN_PERF=no_async_present

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:13 +00:00
Yiwei Zhang
387a49d4f0 venus: vn_wsi_sync_wait to relax chain acquire for async present
For sem fd export on async present thread, it occurs after internal
queue submissions for all swapchains and before presenting to WSI
backend. We can safely unlock the chain acquire lock though we still
have to lock against chain destroy as well as chain async present on
other queues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:13 +00:00
Yiwei Zhang
8392e82298 venus: implement async present
Brief:
1. present info is deep-copied and passed to async present thread
2. normal queue present always waits for async present to take over
3. queue access is protected by async present queue lock
4. chain access is protected by chain locks
5. no perf gain in practice since we haven't allowed parallel queue
   submit or acquire image yet

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:12 +00:00
Yiwei Zhang
84e2623300 venus: prepare to flush async queue present
This is to ensure external synchronization for queue operations.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:12 +00:00
Yiwei Zhang
f216c109be venus: add a deep copy helper for VkPresentInfoKHR
Below pNext structs are handled:
- VkDeviceGroupPresentInfoKHR
- VkPresentRegionsKHR
- VkPresentIdKHR
- VkPresentId2KHR
- VkSwapchainPresentFenceInfoKHR
- VkSwapchainPresentModeInfoKHR
- VkPresentTimingsInfoEXT

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:11 +00:00
Yiwei Zhang
48680d5505 venus: add back vn_QueuePresentKHR
Prepare to not rely on implicit fencing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:10 +00:00
Yiwei Zhang
2c63534896 venus: add chain lock helpers for async present
The helpers will protect chain access during async present.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:09 +00:00
Yiwei Zhang
0a2525491d venus: prepare chain access for async present
During async presentation, swapchain is accessed by the async present
thread. With proper queue and chain access locks within venus driver,
we still have to rely on mesa common wsi implementation specifics for
optimal async present performance:

Below need to be protected:
- vkAcquireNextImage2KHR
- vkDestroySwapchainKHR

Below are safe:
- vkGetSwapchainImagesKHR
- vkWaitForPresentKHR
- vkWaitForPresent2KHR
- vkReleaseSwapchainImagesKHR
- VkSwapchainPresentFenceInfoKHR::pFences

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:08 +00:00
Yiwei Zhang
ca18b73669 venus: track swapchains
Will be used internally to ensure synchronized host access of swapchain
object.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:08 +00:00
Yiwei Zhang
fdb2a8f88f venus: add vn_wsi_sync_wait to handle implicit sync workaround
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:07 +00:00
Yiwei Zhang
37b95dc8d6 venus: vn_GetFenceFdKHR no need to block wait
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:07 +00:00
Yiwei Zhang
6b3686f49b venus: refactor to avoid nesting vn_QueueSubmit entrypoint
Prepare to wait for async queue present. This helps avoid redundant WSI
flushes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:06 +00:00
Yiwei Zhang
391f11671a venus: remove TP in vn_ResetDescriptorPool
This call can be verbose for some workloads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:06 +00:00
Yiwei Zhang
c8c6ee1dd7 venus: respect VK_SUBOPTIMAL_KHR returned from wsi image acquire
When suboptimal is returned, the fence payload is missed to be installed
unexpectedly. Instead, we can directly return errors from sync import.
With this change, dEQP-VK.wsi.xcb.maintenance1.release_images.* can pass
robustly now.

Fixes: a312bb4285 ("venus: refactor wsi acquire to use semaphore and fence SYNC_FD import")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39283>
2026-01-13 19:47:05 +00:00
Valentine Burley
8cd82ce149 ci/android: Update to Android 16
Update the Cuttlefish image to Android 16, move to the r29 NDK, and build
Mesa with SDK version 35, the latest version currently supported.

The new Cuttlefish build switches the 'venus_guest_angle' mode to use the
`venus:cross-domain` context type instead of `virgl:virgl2:venus`, which
now works on Android 16. This mode also moves to the `skiavk` Vulkan
backend for HWUI and SurfaceFlinger.

The Cuttlefish repositories have also been moved to the new
https://gitlab.freedesktop.org/gfx-ci/android namespace.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39197>
2026-01-09 15:35:00 +00:00
Andrew Sinclair
8f8bc7ca3b gfxstream: revert "gfxstream: Add Vulkan func/structs for passing debugging data to host"
Breaks emulator 26Q1-release.

Reviewed-by: David Gilhooley <djgilhooley.gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39205>
2026-01-08 08:02:36 -08:00
Marek Olšák
1912a00a91 ALL: use SHA1_DIGEST_LENGTH etc. instead of hardcoding the numbers
only build_id is switched to use literal 20 instead of SHA1_DIGEST_LENGTH
because we will increase SHA1_DIGEST_LENGTH to BLAKE3_KEY_LEN

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39110>
2026-01-07 08:32:33 +00:00
Jason Macnak
462e73ce1c gfxstream: Add Vulkan func/structs for passing debugging data to host
... and send data on connection creation.

Test: cvd create --gpu_mode=gfxstream_guest_angle
      and go/cuttlefish-tracing to grab perfetto trace

Reviewed-by: Aaron Ruby <aruby@qnx.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39161>
2026-01-05 18:47:21 +00:00
Eric Engestrom
4f91d4d888 virtgpu_kumquat_ffi: mark single-item match as expected
It will presumably get more values in the future and should not just be
replaced with an `if`.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38924>
2026-01-05 17:01:39 +00:00
Eric Engestrom
590daa1282 virtgpu_kumquat_ffi: use auto-deref instead of doing it by hand
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38924>
2026-01-05 17:01:39 +00:00
Eric Engestrom
6cb997ab22 virtgpu_kumquat_ffi: use mutex.get_mut() instead of mutex.lock() to get compile-time garantee that the mutex isn't already locked
See https://rust-lang.github.io/rust-clippy/rust-1.92.0/index.html#mut_mutex_lock

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38924>
2026-01-05 17:01:38 +00:00
Eric Engestrom
ea9f75e85c virtgpu_kumquat_ffi: mark the remaining allow annotations (all non_camel_case_types) as expected
`#[expect(...)]` instead of `#[allow(...)]` means that the linter warns
once the annotation should be removed.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38924>
2026-01-05 17:01:37 +00:00
Eric Engestrom
2b76adb765 virtgpu_kumquat: cleanup derelict allow(dead_code) & allow(unused) annotations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38924>
2026-01-05 17:01:37 +00:00
Yiwei Zhang
f4cd0bf810 venus: allow hw wsi for newer Nvidia proprietary driver
Prime buffer blit has been reported working on Nvidia driver version
590.48.01.

Acked-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39069>
2026-01-02 20:08:44 +00:00
Yiwei Zhang
5106ab5c7a venus: track renderer driver version for driver workaround
Acked-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39069>
2026-01-02 20:08:44 +00:00
Yiwei Zhang
f47c9b3f9c venus: amend missing VKAPI_ATTR/CALL for render pass APIs
Fixes: c696ec3b73 ("venus: add missing VKAPI_ATTR/CALL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39033>
2026-01-01 20:11:28 +00:00
Yiwei Zhang
166923bf0e venus: adopt vk_common_GetCalibratedTimestampsKHR
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Venus driver already has to query host time domains within the guest to
be monotonic, so we can rely on the common impl as well and only query
device domain from the renderer.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38963>
2025-12-21 16:47:30 +00:00
Yiwei Zhang
36c52644fa venus: use vk_common_GetPhysicalDeviceCalibrateableTimeDomainsKHR
Only host domains are conditional, and they are checked with the common
vk_device_get_timestamp helper.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38963>
2025-12-21 16:47:30 +00:00
Yiwei Zhang
9670c15d46 venus: hide vtest from Windows build
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/38969>
2025-12-20 19:12:47 +00:00
Yiwei Zhang
1ddd09c72d venus: refactor meson to be more flexible for additions
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:47 +00:00
anonymix007
55219167c6 venus: Guard Linux-specific code against being compiled on Windows
v2:
- drop most additions except thread id
- fix DRM_FORMAT_MOD_LINEAR in a different way

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:47 +00:00
Yiwei Zhang
d792403f0b venus: disable TLS ring prio forwarding on Windows
The prios aren't consistent when guest and host are different OS'es.
Even if they are the same, sometimes the forwarding can hit other
permission issues. The entire ring prio thing has to be redesigned, and
before that we just disable it on Windows.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:47 +00:00
Yiwei Zhang
77b32df391 venus: hide unsupported external extensions on Windows
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:47 +00:00
anonymix007
342605f9b1 venus: Expose deviceLUID in props if available
v2: wrap props within id props and use snake case naming

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:47 +00:00
Yiwei Zhang
1aa273ae57 venus: hide unsupported device extensions on Windows
This change hides:
- VK_EXT_image_drm_format_modifier
- VK_EXT_map_memory_placed
- VK_EXT_physical_device_drm

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:46 +00:00
Yiwei Zhang
c00c398995 venus: hide unsupported wsi extensions on Windows
Hide present id/wait extensions on Windows

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38969>
2025-12-20 19:12:46 +00:00
Eric Engestrom
47ebdbab81 meson: add rust_global_args for flags for all the rust compilations
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38807>
2025-12-20 00:13:19 +01:00