Commit graph

1080 commits

Author SHA1 Message Date
Yiwei Zhang
12edb83fb5 venus: add a wsi image log
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is helpful to tell which path is taken:
1. explicit modifier: legacy_scanout=0, prime_blit=0
2. prime blit: legacy_scanout=0, prime_blit=1
3. legacy scanout: legacy_scanout=1, prime_blit=0

To be noted, venus doesn't advertise legacy scanout support, but we
implicitly support it for gamescope compatibility.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38457>
2025-11-16 15:37:16 +00:00
Yiwei Zhang
07d059f3e2 venus: use seq_cst for ring cs and tail update ordering
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
To avoid incompatibility between the compiler implementations used by
the driver and the renderer, seq_cst ordering is picked here, which has
required a full mfence instruction. Then the renderer side acquire is
ensured to be ordered after the cache flush of ring cs updates.

Perf wise, there's no regression in headless vkmark runs. In theory,
the overhead introduced here weighs trivially as compared to the ring
cs encode/decode part. So we should go for better robustness.

Test: venus on windows guest works with renderer on Linux
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/14277
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38435>
2025-11-14 01:26:52 +00:00
Yiwei Zhang
4201613de1 venus: enable sparse resource support on lavapipe
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Now that lavapipe sparse resource support on external memory has been
fixed, expose sparse resource support from venus on lavapipe. Meanwhile,
make remaining failures explicit (failed in lavapipe as well).

This CL also drops an obsolete comment and updates expectations from
full nightly runs.

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38074>
2025-11-05 08:26:40 +00:00
Yiwei Zhang
ee57fef755 venus: enable sparse only queue family along with feedback
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Now that both ffb and sfb support feedback suspend and resume, we no
longer need to filter out sparse only queue family.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
13e9bc2ff9 venus: allow timeline semaphore feedback to suspend and resume
Similar idea with fence feedback, but a bit tricky in the resume
condition. See comments for details.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
ecb385f088 venus: rename async_wait_mtx to counter_mtx
The lock scope will be extended to support semaphore feedback suspend
and resume later. So give it a general name.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
b187c1ab92 venus: update sfb cmd lookup to follow ffb
Now sfb cmd can be VK_NULL_HANDLE on incompatible queues. Avoid passing
that to set cmd, and explicitly assert below.

Test: dEQP-VK.synchronization2.basic.timeline_semaphore.multi_queue can
properly assert on the driver side when assert is enabled.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
2c08e6d8bb venus: allow fence feedback to suspend and resume
Previously, we either have to filter out incompatible queue or disable
fence feedback. Now we track whether the queue can do feedback, and will
mark the fence feedback not pollable if the fence is submitted on an
incompatible queue.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
30b41c2b57 venus: add vn_queue_family_can_feedback helper
No behavior change. This is to prepare for better feedback
compatibility support.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38049>
2025-10-25 00:02:59 +00:00
Yiwei Zhang
2e32dd7472 venus: skip feedback cmd record on incompatible queue families
Feedback requires transfer capability, so we must skip feedback cmd
pool initialization on incompatible queue families. Meanwhile, use
pool_handle for all validity check needed.
- fence and semaphore feedback: skip feedback cmd alloc and record when
  pool_handle is VK_NULL_HANDLE
- event feedback: not affected as we patch in-place upon recording
- query feedback: assert the feedback cmd alloc is on supported queue

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38016>
2025-10-23 08:57:12 +00:00
Mel Henning
fafb81cd02 treewide: Use vk_collect_dependency_info_src_stages
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>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37961>
2025-10-22 19:22:17 +00:00
Alyssa Rosenzweig
84d8e6824b treewide: don't check before free
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This was something that came up in the slop MR. Not sure it's actually a
good idea or not but kind of curious what people think, given we have a
sound tool (Coccinelle) to do the transform. Saves a redundant branch
but means extra noninlined function calls.. likely no actual perf impact
but saves some code.

Via Coccinelle patches:

    @@
    expression ptr;
    @@

    -if (ptr) {
    -free(ptr);
    -}
    +free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr) {
    -FREE(ptr);
    -}
    +FREE(ptr);

    @@
    expression ptr;
    @@

    -if (ptr) {
    -ralloc_free(ptr);
    -}
    +ralloc_free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -free(ptr);
    -}
    -
    +free(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -FREE(ptr);
    -}
    -
    +FREE(ptr);

    @@
    expression ptr;
    @@

    -if (ptr != NULL) {
    -ralloc_free(ptr);
    -}
    -
    +ralloc_free(ptr);

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> [v3d]
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> [venus]
Reviewed-by: Frank Binns <frank.binns@imgtec.com> [powervr]
Reviewed-by: Janne Grunau <j@jannau.net> [asahi]
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> [radv]
Reviewed-by: Job Noorman <jnoorman@igalia.com> [ir3]
Acked-by: Marek Olšák <maraeo@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Job Noorman <jnoorman@igalia.com>
Acked-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37892>
2025-10-15 23:01:33 +00:00
Simon McVittie
9d36bf891b vulkan: Compute path to write into JSON manifests once, use it everywhere
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This reduces duplication: we only need to distinguish between Windows
and Unix in one place.

The previous code was inconsistent about using either the `platforms`
option, or the `host_machine`. Following the logic described in
commit 94379377 "lavapipe: build "Windows" check should use the host machine, not the `platforms` option.",
I've assumed that checking the host machine is the more-correct version
and used that.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37576>
2025-09-26 10:47:31 +00:00
Simon McVittie
be8cac52d3 vulkan: Consistently form driver library names as prefix + name + suffix
This consistently uses `NAME.dll` on Windows, `libNAME.dylib` on Darwin
derivatives such as macOS, and `libNAME.so` on Linux, *BSD and so on.
It's also consistent about using the local variable name `icd_file_name`
for this name in every Vulkan driver, which was already the case in many
but not all drivers.

Some of these drivers probably don't make sense (or don't work) on
Windows and/or macOS, but if this is kept consistent for all drivers,
it should avoid the need for driver-specific commits like
commit 611e9f29e "lavapipe: fix icd generation for windows",
commit 951f3287 "lavapipe: set empty dll prefix",
commit 13e7a39f "lavapipe: fixes for macOS support",
commit 7008e655 "radv: Update JSON generator if Windows" and so on,
each time a driver is found to be relevant on more platforms than
previously believed.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37576>
2025-09-26 10:47:31 +00:00
Yonggang Luo
773a7f347a clang-format: Update the .clang-format files to conformance clang-format json-schema
The document is at
https://clang.llvm.org/docs/ClangFormatStyleOptions.html

The json-schema at
https://www.schemastore.org/clang-format.json

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37235>
2025-09-09 07:04:55 +00:00
Thibault Payet
1de30797ae venus: Use SYS_thr_self on FreeBSD instead of SYS_gettid
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/36953>
2025-08-24 02:15:46 +00:00
Yiwei Zhang
f0c52fee25 venus: misc sync2 emulation fixes
Venus renderer side has strict entry points sanitization based on the
app requested app api version + physical device api version. So on the
driver, we should follow the same for legacy client apps.

Meanwhile, VK_PIPELINE_STAGE_NONE can't be used when we hit the sync2
emulation path, so we swap it with VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT
placeholder for the 2nd sync scope there.

Fixes: 07cee75c39 ("venus: layer vkQueueSubmit2 over vkQueueSubmit w/o sync2")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36830>
2025-08-21 14:25:22 +00:00
Yiwei Zhang
ec4cebbf2e venus: expose KHR_present_id(2)/wait(2) support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Venus does support these via common wsi.

Test: dEQP-VK.wsi.*.present_id_wait.*
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36834>
2025-08-19 22:48:35 +00:00
Yiwei Zhang
fd0b41b98d venus: hide swapchainMaintenance1 behind wsi guard
..otherwise would give false alarm on Android.

Fixes: acd5497067 ("venus: support wsi maintenance1 extensions")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36834>
2025-08-19 22:48:35 +00:00
Yiwei Zhang
94fdc5bc47 venus: use VK_USE_PLATFORM_ANDROID_KHR when applicable
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
To stay consistent with common code gen:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36702

Besides using the spec platform guard, this change also:
- drops the guard for ANB sharedImage
- keep the gettid and disk cache guards as they are

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36802>
2025-08-18 02:36:12 +00:00
Yiwei Zhang
07cee75c39 venus: layer vkQueueSubmit2 over vkQueueSubmit w/o sync2
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This helps with common wsi code.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36799>
2025-08-16 19:14:17 +00:00
Yiwei Zhang
403a62a9e5 venus: stop consuming wsi_memory_signal_submit_info
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Dropped in https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36800>
2025-08-15 20:32:24 -07:00
Yiwei Zhang
c58b3fa3a4 venus: fix a race condition in ring shmem reuse
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
With the shmem cache, vkDestroyRingMESA must be a synchronous call to
ensure renderer side ring destruction has finished before the same shmem
gets reused by other things.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13672
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36664>
2025-08-09 00:24:28 +00:00
Yiwei Zhang
7b59d09299 venus: drop vn_trace_init
No longer needed.

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36655>
2025-08-08 16:02:31 +00:00
Yiwei Zhang
6775873e9e venus/android: clean up leftovers from common AHB helpers adoption
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This is a follow up for:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36581>
2025-08-05 19:22:20 +00:00
Antonio Ospite
ddf2aa3a4d build: avoid redefining unreachable() which is standard in C23
In the C23 standard unreachable() is now a predefined function-like
macro in <stddef.h>

See https://android.googlesource.com/platform/bionic/+/HEAD/docs/c23.md#is-now-a-predefined-function_like-macro-in

And this causes build errors when building for C23:

-----------------------------------------------------------------------
In file included from ../src/util/log.h:30,
                 from ../src/util/log.c:30:
../src/util/macros.h:123:9: warning: "unreachable" redefined
  123 | #define unreachable(str)    \
      |         ^~~~~~~~~~~
In file included from ../src/util/macros.h:31:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:456:9: note: this is the location of the previous definition
  456 | #define unreachable() (__builtin_unreachable ())
      |         ^~~~~~~~~~~
-----------------------------------------------------------------------

So don't redefine it with the same name, but use the name UNREACHABLE()
to also signify it's a macro.

Using a different name also makes sense because the behavior of the
macro was extending the one of __builtin_unreachable() anyway, and it
also had a different signature, accepting one argument, compared to the
standard unreachable() with no arguments.

This change improves the chances of building mesa with the C23 standard,
which for instance is the default in recent AOSP versions.

All the instances of the macro, including the definition, were updated
with the following command line:

  git grep -l '[^_]unreachable(' -- "src/**" | sort | uniq | \
  while read file; \
  do \
    sed -e 's/\([^_]\)unreachable(/\1UNREACHABLE(/g' -i "$file"; \
  done && \
  sed -e 's/#undef unreachable/#undef UNREACHABLE/g' -i src/intel/isl/isl_aux_info.c

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36437>
2025-07-31 17:49:42 +00:00
Yiwei Zhang
037fd5704a venus: set wsi alias binding memoryOffset to zero
This aligns with common wsi and Android expectations and obeys the spec
for dedicated wsi mem alloc.

Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388>
2025-07-29 07:50:11 +00:00
Yiwei Zhang
e559d76066 venus: drop is_wsi tracking and some asserts
This is to help with kms support.

Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388>
2025-07-29 07:50:11 +00:00
Yiwei Zhang
8a156fb695 venus: drop cached ahb buffer memory types
No longer needed as we relocated the type fix to mem alloc time even for
non-dedicated export alloc.

Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388>
2025-07-29 07:50:10 +00:00
Yiwei Zhang
ca97816136 venus: rework AHB memory import
We don't need the host dma-buf size anymore since the blob mapping size
has been made passive.

Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388>
2025-07-29 07:50:10 +00:00
Yiwei Zhang
87b1a46d88 venus: adopt vk_common_GetAndroidHardwareBufferPropertiesANDROID
This is based on:
1. external format handling has been made passive
2. blob mapping size has been made passive
3. common helper has improved mem type reporting

Reviewed-by: Antonio Ospite <antonio.ospite@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36388>
2025-07-29 07:50:09 +00:00
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
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
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
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
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
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