Commit graph

1280 commits

Author SHA1 Message Date
Yiwei Zhang
cefda4eedb venus: clean up post vk_android_get_ahb_image_properties adoption
Make this a separate commit to ease review of the prior adoption.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36151>
2025-07-17 20:12:23 +00:00
Yiwei Zhang
e4f9ce838a venus: adopt vk_android_get_ahb_image_properties
Now we can fully resolve the AHB image query on the driver side without
roundtrips.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36151>
2025-07-17 20:12:23 +00:00
Yiwei Zhang
e33870d207 venus/wsi: move wsi image format info validation to vn_wsi
Added vn_wsi_validate_image_format_info helper to clean up query side
codes.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36151>
2025-07-17 20:12:23 +00:00
Yiwei Zhang
89f5938930 venus: adopt vk_android_get_ahb_buffer_properties
Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36151>
2025-07-17 20:12:23 +00:00
Yiwei Zhang
afdb2c64de venus/ci: udpate expectations from venus-lavapipe-full runs
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/36180>
2025-07-16 22:56:43 +00:00
Yiwei Zhang
442f242a49 venus: requests whole blob mem size for non-dedicated import
For non-dedicated import, later import could have varied size against
the same bo, so we just request the whole blob mem size for those.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
2025-07-16 22:05:11 +00:00
Yiwei Zhang
b32a8d17a2 venus/virtgpu: use size zero to request mapping the entire blob mem
For import, requested size might be smaller than the whole blob mem
size. Currently, venus virtgpu backend tracks the initial import size
and sanity checks with later re-import size. So let's add a way to
request whole blob mem size

No need vtest backend changes since dma_buf import is not supported.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
2025-07-16 22:05:11 +00:00
Yiwei Zhang
768375fede venus: refactor ahb import interface to take whole alloc info
Prepare for adopting common runtime so that we don't leave unused vars
after dropping codes from vn_AllocateMemory. It's trying to minimize
code changes in the venus adoption since that'd be huge.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
2025-07-16 22:05:11 +00:00
Yiwei Zhang
e27ad2a021 venus: drop force_unmappable hack
No longer needed since the vkMapMemory would fail properly instead of
failing the external memory import.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
2025-07-16 22:05:11 +00:00
Yiwei Zhang
6c8f075fb3 venus/virtgpu: drop mappable if blob size is smaller than requested
Instead of failing the import, drop the mappable bit if blob size is
smaller than the requested alloc size, which defers the error to the
intended vkMapMemory api call if the client app requests Vulkan mapping
from the imported external memory.

Normally this won't occur if the app obeys the spec with a properly
implemented blob mem allocator. However, legacy allocators like minigbm
virtgpu_virgl backend could allocate via virgl w/o knowing the real blob
size from the guest side. The unsatified cases are external gralloc
images, which won't be mapped in any meaningful way after being
imported. This is to prepare dropping the force_unmappable workaround,
and to further prepare adopting common Android runtime.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36128>
2025-07-16 22:05:10 +00:00
Yiwei Zhang
cf548b4500 venus/meson: amend api_version in the generated icd file
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Missed when we support 1.4...again

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36153>
2025-07-15 22:54:33 -07:00
Yiwei Zhang
7bb3f29b2a venus: adopt wsi_common_get_memory
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35875>
2025-07-09 23:45:03 +00:00
Yiwei Zhang
d93840dc22 venus: allow to build vtest-only on non-DRM/KMS systems
The vtest backend doesn't require drm.

Backport-to: 25.1
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13420
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36017>
2025-07-09 14:43:09 +00:00
Yiwei Zhang
48cd696213 venus: use common ANB swapchain gralloc usage query
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/35785>
2025-07-09 03:47:07 +00:00
Corentin Noël
8c96b9b9c7 virgl: Add more Gallium formats to the list
Include the recently added formats.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35908>
2025-07-08 15:14:37 +00:00
Yiwei Zhang
0282ce8211 venus: back out implicit fencing handling for NV proprietary
It is a tech debt now since NV proprietary is on sw wsi path, and
rendering to the prime blit dst buffer  may never get supported there.
For later, when performance optimization is needed for venus on nv, we
can downgrade the sw wsi device workaround to a venus dri config, so
that setups with tiled explicit modifier support can be perf optimal.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35984>
2025-07-07 18:16:34 +00:00
Yiwei Zhang
054c8e117e venus: fix a prime blit assert
The assert doesn't consider multiple queue family case where the same
blit cmd has to be recorded for each, thus hitting the assert for the
same image and buffer.

Fixes: 5535184539 ("venus: track prime blit dst buffer memory in the wsi image")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35984>
2025-07-07 18:16:34 +00:00
Dmitry Osipenko
d561be1c27 venus: Fix vn_CreateImage crashing with debug build of venus
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Fix Venus crashing when running in KMS mode and using debug build of Mesa
due to previous patch missing to adjust the assert-check, making it prepared
to handle WSI/scanout images.

Fixes: 31a8218f5b78 ("venus: wsi workaround for gamescope")
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35958>
2025-07-07 01:45:50 +03:00
Yiwei Zhang
83ae6393e5 virtio/ci: update AHardwareBufferNativeTests expectations
The Blob_BlobTest_* tests should have been fixed by the updated CF
image in 5ac532bfc7.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35865>
2025-07-01 18:28:58 +00:00
Yiwei Zhang
a5762997da venus: support AHB storage image format
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
R8 + GPU_DATA_BUFFER has been added to support AHB backed storage image
for compute use cases.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35845>
2025-07-01 15:34:10 +00:00
Valentine Burley
5ac532bfc7 ci/android: Update Cuttlefish image
Main changes:
- Use hwcomposer=drm for venus_guest_angle instead of ranchu
- Cherry pick an upstream change in external/minigbm
  https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6691931

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35786>
2025-07-01 14:50:55 +00:00
Valentine Burley
26bd1df9bf virtio/ci: Run additional VKCTS tests on Cuttlefish with Venus+ANV
Extend the deqp-runner suite to run a fractional set of VKCTS tests
on Cuttlefish with Venus on ANV. This involved:

- Introducing a skip list for tests incompatible with this setup
- Increasing the parallelism of the pre-merge job on CML

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35786>
2025-07-01 14:50:54 +00:00
Yiwei Zhang
09eda329a2 venus: filter out vulkan video feature bits on common video formats
Tested with ANV_DEBUG=video-decode,video-encode:
- dEQP-VK.api.info.format_properties.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35842>
2025-07-01 07:25:58 +00:00
Corentin Noël
c5b42a2ae4 virgl: Add more Gallium formats to the list
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Include the recently added formats.

Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35741>
2025-06-30 09:04:43 +00:00
Yiwei Zhang
3f1d40d230 venus: wsi workaround for gamescope
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Gamescope relies on legacy scanout support when explicit modifier isn't
available and it chains the mesa wsi hint requesting such. Venus doesn't
support legacy scanout with optimal tiling on its own, so venus disables
legacy scanout in favor of prime buffer blit for optimal performance. As
a workaround here, venus can once again force linear tiling when legacy
scanout is requested outside of common wsi.

Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35811>
2025-06-28 17:52:40 -07:00
Yiwei Zhang
c5d1392a10 venus: share code for AHB image subres query
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35810>
2025-06-28 23:16:58 +00:00
Yiwei Zhang
d45b76c3cc venus: drop tiling_override tracking
It used to serve 2 purposes:
1. aliased swapchain image
2. faked legacy scanout support

...and now can be cleaned up.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35810>
2025-06-28 23:16:58 +00:00
Yiwei Zhang
a96d7cdbc0 venus: drop drm_format_modifier tracking
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35810>
2025-06-28 23:16:58 +00:00
Yiwei Zhang
0db7818b87 venus: use wsi_common_create_swapchain_image
We no longer need to do our own since the chain has the info stored for
the common helper.

Test:
- dEQP-VK.wsi.*.swapchain.create.*
- dEQP-VK.wsi.*.maintenance1.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35810>
2025-06-28 23:16:57 +00:00
Yiwei Zhang
cb54338f65 venus: fix msaa state sample location info sanitization
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The additional reference has corrupted the below D/S state instead of
properly ending the msaa state pnext chain.

Fixes: ff64092ff3 ("venus: support VK_EXT_sample_locations")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35808>
2025-06-28 20:25:23 +00:00
Corentin Noël
c0d1b199ae venus: Fix leak in syncobj creation failure path
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
CID: 1475984 Resource leak
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35474>
2025-06-27 13:56:24 +00:00
Yiwei Zhang
6469d7268f venus: suppress Coverity Uninitialized scalar variable
Just false alarm. Adjusted the code to suppress it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35474>
2025-06-27 13:56:24 +00:00
Pierre-Eric Pelloux-Prayer
bb12eebe2a util: add util_sync_provider::clone
Tested-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34470>
2025-06-27 08:15:49 +00:00
Guilherme Gallo
d06f8cfb19 ci/android: Add dEQP module for CML cuttlefish test
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Add only those tests for initial coverage:
  * `dEQP-VK.wsi.android.*`
  * `dEQP-VK.api.external.memory.android_hardware_buffer.*`

This increases the job execution time to almost 1h, so move this job to
nightly.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35706>
2025-06-26 23:21:12 +00:00
Guilherme Gallo
545727f97c ci/android: Move ANDROID_CTS_MODULES to build script
Rely on the include files (-android-cts-include.txt) to filter both
tests and modules from Android CTS during test time.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35706>
2025-06-26 23:21:12 +00:00
Guilherme Gallo
655cd186ee ci/android: Add a job to run CTS on Intel CML
Like we do with `android-angle-lavapipe`, let's include the Android CTS
testing alongside the vkcts one.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35706>
2025-06-26 23:21:12 +00:00
Valentine Burley
bac51d2931 virtio/ci: Add nightly Android Venus jobs on Intel TGL and ADL
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Introduce nightly Cuttlefish jobs on Intel Tiger Lake and Alder Lake.

Like `android-angle-venus-anv-cml`, these jobs run dEQP with the Android
guest using Venus + ANGLE, and the host using the ANV Vulkan driver.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35737>
2025-06-26 12:51:54 +00:00
Valentine Burley
bf98db1c45 virtio/ci: Split android-angle-venus-anv into reusable template
Move shared variables and configuration for the android-angle-venus-anv
job into a new template so that it can be reused by other jobs.

This follows the structure used everywhere else.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35737>
2025-06-26 12:51:54 +00:00
Valentine Burley
32264e7a00 virtio/ci: Increase timeout for AHB tests
Some of the tests occasionally time out on Tiger Lake.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35737>
2025-06-26 12:51:54 +00:00
Eric Engestrom
1a6fc7006a meson: split subdir for virtio/vdrm and virtio/vulkan
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
2025-06-25 22:21:48 +00:00
Eric Engestrom
6f8c4a7ce1 virtio: move inc_virtio up one folder
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35723>
2025-06-25 22:21:48 +00:00
Yiwei Zhang
4d972bce5b venus: use more common wsi codes
This has been unblocked a while back after common queue adoption.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35705>
2025-06-24 18:38:32 +00:00
Yiwei Zhang
25d7c6cd4d venus: relocate tls ring hint from wsi init to queue submission
This ensures synchronous shader compilation doesn't occur on most render
threads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35705>
2025-06-24 18:38:32 +00:00
Yiwei Zhang
2d3f64bf97 venus: use common vk_android_get_front_buffer_usage helper
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/35568>
2025-06-23 00:46:43 +00:00
Guilherme Gallo
c035454a3c ci/virtio: Add an Android Venus job on Intel Comet Lake
Introduce a Venus job running in Cuttlefish on Intel Comet Lake DUTs.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Co-authored-by: Antonio Ospite <antonio.ospite@collabora.com>
Co-authored-by: Valentine Burley <valentine.burley@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35522>
2025-06-19 20:20:42 +00:00
Valentine Burley
0553a2de25 ci/virtio: Generalize .venus-rules
Decouple the .venus-rules definition from lavapipe to prepare for adding
hardware driver coverage for Venus.

Signed-off-by: Valentine Burley <valentine.burley@collabora.com>
Co-authored-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Co-authored-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35522>
2025-06-19 20:20:42 +00:00
Mel Henning
f7aa6ba906 vulkan: Specify library_arch in ICD files
This should help vk-icd-loader skip libraries of the wrong bit width.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35567>
2025-06-19 17:30:24 +00:00
Yiwei Zhang
4efaa64159 vulkan/treewide: add and use common Android HMI hal implementation
There's no need for a per driver HMI implementation since the
vk_icdGetInstanceProcAddr implementation can well populate the required
entrypoints for Android icd.

Changes have to be done in this single commit for simplicity. Otherwise,
I would have to create a separate android shared library in the runtime
like how vk_instance is handled today, so that the target is able to
check per driver enablement def. However, after all drivers have
migrated over within this MR, we still have to clean those up. So I
decided to just do those in a single commit instead.

v2: avoid preloading u_gralloc in vulkan hal open

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> (v1)
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
2025-06-18 22:23:53 +00:00
Yiwei Zhang
08f18030bd venus: adopt common android u_gralloc helpers
Drop explicit u_gralloc init since it will be initialized upon the
initial vk_android_get_ugralloc.

Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
2025-06-18 22:23:53 +00:00
Gurchetan Singh
3a3239dcf9 gfxstream: proper depedendences in non virtgpu-kumquat case
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
In case virtgpu_kumquat isn't built, provide a null_dep
rather than undefined meson dependencies.

Reviewed-by: Marcin Radomski <dextero@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35607>
2025-06-18 15:16:32 +00:00