Commit graph

2216 commits

Author SHA1 Message Date
Yiwei Zhang
c4e5661f29 vulkan/android: improve stage masks for semaphore ops
Strictly speaking, for an empty batch, there is no inherit/defined
ordering between the wait and signal operations within the batch. We
are relying on MESA impl defined behavior to transfer payloads of the
wait sempahores to the signal sempahore here.

Ideally we need a MESA internal hint to ensure transitivity, but since
this is on the legacy fallback path, it's not worth the effort. So here
we follow common wsi to use TRANSFER_BIT which avoids most unnecessary
stalls on the queue (an improvement over the previous ALL_COMMANDS_BIT).

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
2025-08-26 17:24:09 +00:00
Yiwei Zhang
d72d0e8580 vulkan/android: skip queue submit with copy_sync_payloads
Follows common wsi side for the same reason as explained in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
2025-08-26 17:24:08 +00:00
Yiwei Zhang
9ce92584ed vulkan/runtime: silence a -Wsometimes-uninitialized warning
../src/vulkan/runtime/vk_device.c:746:28: warning: variable
'was_signaled' is used uninitialized whenever 'for' loop exits
because its condition is false [-Wsometimes-uninitialized]

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
2025-08-26 17:24:08 +00:00
Yiwei Zhang
5372fe7cc4 vulkan/android: switch to vkQueueSubmit2
This follows common wsi side as suggested, and simplifies the later
adoption of vk_device_copy_semaphore_payloads.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
2025-08-26 17:24:07 +00:00
Yiwei Zhang
3a5514febf vulkan/android: add an early return when there's no wait semaphores
..and no need to give result a default.

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36855>
2025-08-26 17:24:07 +00:00
Aleksi Sapon
a9066c801b wsi/metal: current extents might not be known until swapchain is created
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33518>
2025-08-26 15:32:41 +00: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
Yiwei Zhang
25b1591df5 vulkan/android: support AHB query for VK_ANDROID_external_format_resolve
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
Conditional based on whether the extension is enabled.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
2025-08-22 23:40:36 +00:00
Yiwei Zhang
2c63252517 vulkan/android: refactor to retrieve AHB format properties once
...and loop through pNext chain once.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
2025-08-22 23:40:36 +00:00
Yiwei Zhang
9e99e604db vulkan/android: support AHARDWAREBUFFER_FORMAT_YCbCr_P010 format mapping
Add it only on external format code path so that no api level guard is
needed. It automatically works with gralloc impls that support
allocating such format.

Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
2025-08-22 23:40:35 +00:00
Yiwei Zhang
25a8e124e0 vulkan/android: amend a missing case for IMPLEMENTATION_DEFINED AHB
An AHB with IMPLEMENTATION_DEFINED format is commonly backed by NV12 or
XBGR8888. The former is the usual pick for camera <-> GPU interop, while
the latter is mostly only seen in Android CTS. Ideally, we can rely on
the queried fourcc to resolve everything instead of being on the
fallback path, but keeping this a minimal fix is easy for porting.

Cc: mesa-stable
Reviewed-by: Lucas Fryzek <lfryzek@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36866>
2025-08-22 23:40:33 +00:00
Faith Ekstrand
d9217bd9cf vulkan/wsi: Always use VK_PIPELINE_STAGE_2_TRANSFER_BIT for semaphore ops
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:05 +00:00
Faith Ekstrand
75434fb5cb vulkan/wsi: Skip the vkQueueSubmit() entirely if we aren't blitting
If we don't need any prime blits then there's no reason to submit
anything to the queue.  We can just signal the signal semaphores and
fences with the wait semaphores and skip the queue.

This is only possible because we no longer need a vkQueueSubmit() for
implicit synchronization.  The old ANV implicit synchronization path is
gone and all other drivers that do implicit sync do it per-bo so we can
assume that they synchronized somewhere else when writing to the BO and
that the present submit does nothing.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:05 +00:00
Faith Ekstrand
6266751749 vulkan/wsi: Consolodate vkQueueSubmit2() calls across swapchains
Vulkan WSI allows you to present to multiple swapchains at the same
time.  If it weren't for some of the Vulkan sync rules, this wouldn't be
a big deal as we could just loop and do the present per-swapchain.
However, the whole present takes a single set of wait semaphores and we
can only wait on them once.  Right now this works because we do at least
one QueueSubmit2() per-swapchain on the present queue.  Since those all
happen on the same queue, we can just wait on the semaphores in the
first present and all the others will pick up that wait thanks to queue
ordering.  However, this requires doing a lot of vkQueueSubmit().

This commit changes the vkQueuePresent() flow so that we do a single
vkQueueSubmit2() on the present queue for all swapchains that consumes
the wait semaphores and signals any per-image semaphores and fences.  In
the case where separate blit queues are used, we just signal blit
semaphores in the first vkQueueSubmit2() on the present queue and then
do a submit per-swapchain for each of the blit queue blits and signal
per-image semaphores and fences with that submit.

This significantly reduces the number of vkQueueSubmit2() calls being
made by vkQueuePresent() and also breaks the dependency on implicit
ordering of submits, which will be important in the next commit.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:05 +00:00
Faith Ekstrand
47fcc88b93 vulkan/wsi: Handle throttling in a separate loop
Instead of doing the throttle as we go through the present loop,
allocate throttle fences and wait on them at the top.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:04 +00:00
Faith Ekstrand
cec7e865a7 vulkan/wsi: Gather per-swapchain results in an array in queue_present()
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:04 +00:00
Faith Ekstrand
cb1ee1d730 vulkan/wsi: Add a QueueSubmit2() wrapper
Unlike regular QueueSubmit2(), the wrapper takes multiple out fences.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:03 +00:00
Faith Ekstrand
9a023b3615 vulkan/wsi: Make get_blit_queue return a struct vk_queue *
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:03 +00:00
Faith Ekstrand
59f85e678f vulkan/wsi: Take a vk_queue in wsi_common_queue_present()
The common entrypoint wrapper already depends on vk_queue, as do all the
drivers that implement drv_QueuePresentKHR() so there's no point in
passing through Vulkan API types anymore.

The one functional change here is that ANV is no longer forcing the
queue index to be zero, which I suspect was a mistake in the first
place.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:02 +00:00
Faith Ekstrand
81325cf887 vulkan,anv,hasvk: Drop vk_queue_wait_before_present()
This helper existed to ensure that drivers waited for semaphores to
materialize before processing a QueuePresent().  However, most drivers
never called this and they were kind-of fine.  Now that we have explicit
and dma-buf sync built into WSI, this wait happens as part
GetSemaphoreFd when we fetch the sync file from the semaphore.

It's also less racy to just rely on GetSemaphoreFd() because, even
though we were stalling the submit thread prior to present, the present
itself does one or more submits and those may go to the thread and
potentially race with the window system.  The GetSemaphoreFd(), however,
happens at the right time to ensure we actually stall before handing
off to the window system.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:02 +00:00
Faith Ekstrand
c9d361ca80 vulkan/wsi: Switch to vkQueueSubmit2()
Venus was the last driver to be implementing old-school vkQueueSubmit()
but it now has a 2-on-1 wrapper as of 07cee75c39 ("venus: layer
vkQueueSubmit2 over vkQueueSubmit w/o sync2").  This makes everything a
little more readable now that we're not juggling separate arrays for
timelines.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:01 +00:00
Faith Ekstrand
4827ba625d vulkan/drm_syncobj: Add a vk_drm_syncobj_copy_payloads helper
This intentionally matches vk_device::copy_sync_payloads.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:00 +00:00
Faith Ekstrand
f4d00c1dbf vulkan: Add a vk_device_copy_semaphore_payloads() helper
This acts as a vkQueueSubmit() except that it doesn't take any command
buffers or sparse binds and it doesn't act on a queue.  Instead, it just
copies semaphore payloads around using a new copy_sync_payloads vfunc on
vk_device.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:00 +00:00
Faith Ekstrand
379cffc3bb vulkan: Add a vk_sync_signal_unwrap() helper
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:05:00 +00:00
Faith Ekstrand
8cffa9a7fd vulkan/queue: Move timeline point allocation to vk_queue_submit_final()
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:59 +00:00
Faith Ekstrand
3c7e973d40 vulkan: Add a vk_sync_wait_unwrap() helper
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:59 +00:00
Faith Ekstrand
b5045d6e42 vulkan/drm_syncobj: Implement signal/reset_many
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:58 +00:00
Faith Ekstrand
c203c5ba91 vulkan/sync: Add vk_sync_signal/reset_many()
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:57 +00:00
Faith Ekstrand
57368203a7 vulkan/sync: Make the can_wait_many() check faster
In the common case where drivers only support one sync type, we can make
this check a lot faster.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:57 +00:00
Faith Ekstrand
1f6209ba09 vulkan/drm_syncobj: Use SWAP() in vk_drm_syncobj_move()
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:56 +00:00
Faith Ekstrand
4a634a56bb vulkan/sync: Return early in vk_sync_timeline_wait() if wait_value == 0
This is a trivial case so we don't even need to take the lock.

Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36827>
2025-08-22 23:04:56 +00:00
Gurchetan Singh
11a6a49534 vulkan: #if DETECT_OS_ANDROID --> #if defined(VK_USE_PLATFORM_ANDROID_KHR)
The use of the bionic toolchain (DETECT_OS_ANDROID) does not mean
that the typical set of Android libraries (nativewindow, gralloc)
are used on the system.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36829>
2025-08-22 16:09:38 +00:00
Yonggang Luo
de1a2a3537 util: Remove the __declspec(dllexport) on win32 for PUBLIC export macro
As on Windows, all DLLs are exported use def files, there is no need do __declspec(dllexport) on the function marker.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36863>
2025-08-22 02:05:57 +00:00
Yiwei Zhang
1d6c7f4cff vulkan/wsi: drop obsolete wsi_common_vk_instance_supports_present_wait
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36835>
2025-08-21 07:53:15 +00:00
Marek Olšák
271a1d8dd9 util/hash_table: don't allocate hash_table_u64::table, declare it statically
We can use _mesa_hash_table_init instead of _mesa_hash_table_create.
It doesn't have to be allocated.

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36728>
2025-08-21 06:13:48 +00:00
Lionel Landwerlin
ed471927e5 vulkan/runtime: use a pipeline flag for unaligned dispatches
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
The problem with the current flag is that it seems to belong to
VkShaderCreateFlagsEXT, not VkPipelineShaderStageCreateFlagBits.

Also it is completely skipped by the vk_pipeline.c code.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7b634ebb63 ("vulkan/runtime: Add VK_SHADER_CREATE_UNALIGNED_DISPATCH_BIT_MESA flag")
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36828>
2025-08-20 11:17:52 +00:00
David Rosca
c1610da677 vulkan/video: Add intra refresh support
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36718>
2025-08-20 10:57:59 +00:00
Faith Ekstrand
14b4160792 vulkan/wsi: Only test for dma-buf sync file support once
Instead of each helper having a VK_ERROR_FEATURE_NOT_PRESENT fast-reject
path, drop those paths and check at the top of each caller.  This
ensures that we do the check once per wsi_device, and only on a known
test dma-buf and that any subsequent fails turn into fails rather than
silently turning off explicit/implicit sync in potentially inconsistent
ways.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36816>
2025-08-19 18:59:43 +00:00
Faith Ekstrand
6d3c82704d vulkan/wsi: Sanitize the result of wsi_drm_check_dma_buf_sync_file_import_export()
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36816>
2025-08-19 18:59:43 +00:00
Faith Ekstrand
9ddd29639c vulkan/wsi: Style nits
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36816>
2025-08-19 18:59:43 +00:00
Emma Anholt
4dcf32c56e wsi/drm: Don't request implicit sync if we're doing implicit sync ourselves.
This will avoid kernel overhead on tu (implicit syncs every BO) and radv
(implicit syncs the swapchain BOs) for doing implicit synchronization on
non-explicit-sync WSI backends (old X11 and Wayland, KHR_display without
!36591, and headless).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
2025-08-16 22:26:41 +00:00
Emma Anholt
8f67d59725 wsi/drm: Do the dma_buf_semaphore setup at swapchain creation time.
Less work at present time, and will let us make decisions about implicit
sync up front.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
2025-08-16 22:26:41 +00:00
Emma Anholt
a377d32fdc vulkan/wsi: Add a test for kernel 6.0 sync file import/export ioctls.
We'll use this in DRM WSI to decide if we need the implicit_sync flag on
swapchain image creation.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
2025-08-16 22:26:40 +00:00
Emma Anholt
61fb238a4d vulkan/wsi: Add comments about the WSI's syncing, and KHR_display stuff.
I have spent so long orienting myself in this code, more than once, that
it's time to leave some clues for next time.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19309>
2025-08-16 22:26:40 +00:00
Faith Ekstrand
1b2acf9006 vulkan: Drop implicit sync support
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run
This gets rid of the internal wsi_memory_signal_submit_info structure
used to indicate implicit sync through vkQueueSubmit() as well as the
handling in vk_queue.c and vk_device::create_sync_for_memory.  Nothing
is using any of this anymore.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Faith Ekstrand
16520cfdf1 vulkan/wsi: Stop setting wsi_memory_signal_submit_info
There are no longer any drivers implementing the back-end hooks for this
so there's no point in setting it from WSI.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Faith Ekstrand
9cf6f14b88 vulkan/wsi: Drop signal_fence/semaphore_with_memory
Intel was the only drivers setting this and how they don't so we can get
rid of the flag and the associated code.

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36783>
2025-08-16 00:04:47 -04:00
Emma Anholt
9e61e72e9f vk/runtime: Set GPU_MULTI_WAIT on the drm syncobj type.
DRM syncobjs always let you wait repeatedly on them, so we can set the
flag in the core instead of having each driver override it once they try
to enable the emulated timeline semaphores.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36563>
2025-08-13 18:57:42 +00:00
Lionel Landwerlin
69a04151db vulkan/runtime: add ray tracing pipeline support
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36757>
2025-08-13 12:01:49 +00:00
Lionel Landwerlin
daac500e98 vulkan/runtime: add a few more shader properties
Ray tracing pipelines can contain unlimited number of shaders unlike
compute/graphics ones. Having the driver finding the maximum
scratch/ray-query/stack usage can be time consumming when this can be
stored on the pipeline and the runtime tell the driver at bind time.

These fields are unused for other shaders and so drivers can ignore
them.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36757>
2025-08-13 12:01:49 +00:00