Commit graph

58 commits

Author SHA1 Message Date
Ryan Zhang
279d21607c Guarantee surface caps is consisitent between EXT and KHR
Due to Vulkan WSI only support query surface caps by KHR,
so query result will mismatch when driver support EXT and
have different strategy with Vulkan WSI.

Mesa init min/maxImageCount = {4,0} both in EXT and KHR
Vulkan WSI init min/maxImageCount = {2,6} only in KHR

So cts obtain {4,0} by vkGetPhysicalDeviceSurface
Capabilities2EXT and obtain {2,6} by vkGetPhysicalDevi
ceSurfaceCapabilitiesKHR.

fix case:
dEQP-VK.wsi.wayland.surface.query_surface_counters

Signed-off-by: Ryan Zhang <ryan.zhang@nxp.com>
2025-10-21 10:20:27 +08:00
Iason Paraskevopoulos
12228bcd09 Merge 'Reset query pool on creation' into 'main'
See merge request mesa/vulkan-wsi-layer!211
2025-10-17 15:02:41 +00:00
Iason Paraskevopoulos
3da272878d Reset query pool on creation
Makes use of the VK_QUERY_POOL_CREATE_RESET_BIT_KHR when creating the
query pool. It disables present timing when VK_KHR_maintenance9 is not
supported by the device.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I9d364050f0cd4a2be74e1b1d44cf3f6a0795e6f4
2025-10-17 15:02:40 +00:00
Nir Ekhauz
9053ee1b74 Support VK_KHR_swapchain_maintenance1
Update:
1. Json file.
2. README file.
3. WSI Layer code.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: I3881090238804f70a88fefbd0a3232faf5181305
2025-10-16 16:02:36 +01:00
Alex Bates
ace729f7f8 Support nonzero present timing queue family
Adds a per-device check for a 'best' queue family to
use for present timing, rather than always using index 0.

wsi_ext_present_timing holds resources (such as the command
buffer) per queue family, rather than supporting only one. However,
currently, only one queue family is supported at a time.
In future, we can hook vkGetDeviceQueue calls to map
VkQueues to their family index. Doing this will transparently
give present timing support for multiple queue families.

Signed-off-by: Alex Bates <alex.bates@arm.com>
Change-Id: I5becb29dfc4a082e301031e0c693acd23eb95a51
2025-10-06 11:27:34 +01:00
Nir Ekhauz
8c65fb2af7 Update the layer's readme and release notes with VK_KHR_present_wait2 support
1. Update the README file.
2. Remove the guards from the code.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: Idf65baee25d09a3b4bc3b563455468bac4d5bddf
2025-09-18 10:20:43 +01:00
Maged Elnaggar
78b21da4ef Adding exception-safe custom mutex to the WSI layer
Introduce util::mutex, util::recursive_mutex
and util::unique_lock; switch WSI layer call sites to it.
All locks are acquired via try_lock(), no system_error leaks.

Signed-off-by: Maged Elnaggar <maged.elnaggar@arm.com>
Change-Id: Ide9ef4318be7cc47e9577059695cc298f8b8e579
2025-09-05 16:06:38 +01:00
Nir Ekhauz
5060dbbc3a Implement vkWaitForPresent2KHR
Add the entry point for VK_KHR_present_wait2.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: I8b0ad681a6c02ea646d072e69b25113a8c8ad3ce
2025-08-28 15:46:50 +01:00
Nir Ekhauz
64c1c46609 Initial support for VK_KHR_present_wait2
Add support for present wait2 ext. for physical, surface and sc.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: I0f7cdadb2d3ea0ecbc32b8b2efe9fc3bb4ba0369
2025-08-26 13:42:14 +01:00
Nir Ekhauz
7fac7b1339 Update the layer's readme and release notes with VK_KHR_present_id2 support
Removed experimental flags around this extension.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: If314e8c05d0f0fd7405379fe1c714f0e56519b4b
2025-08-20 12:45:46 +01:00
Nir Ekhauz
472597ed42 Add initial support for VK_KHR_present_id2 in the layer
Add support for present id2 ext.

Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: Ic4cf137158188e9b6db1fa999f2c61248456c139
2025-08-13 09:41:21 +01:00
Maged Elnaggar
4a6f61a72b This commit merges several related changes to make the layer
fully spec-compliant and avoid leaking unsupported symbols.

Extension enablement

* Only enable extensions promoted to core in Vulkan 1.1 when 
  the application’s API version is < 1.1.
* Filter the list passed to vkGet{Instance,Device}ProcAddr so
  that only _application_-enabled extensions affect symbol lookup. Internally-added
  extensions are ignored during GetProcAddr resolution.

Entrypoint exposure fixes

* getProcAddr now only returns pointers for entrypoints when _all_ of 
  their required extensions (or core version) are enabled:
  * vkGetPhysicalDevicePresentRectanglesKHR
  * vkAcquireNextImage2KHR
  * vkGetDeviceGroupSurfacePresentModesKHR
  * vkBindImageMemory2 / vkBindImageMemory2KHR
  * vkGetPhysicalDeviceFeatures2KHR
* Removed all OR-conditions that previously exposed these functions prematurely,
  replacing them with clear AND-checks per the spec.

Always-exposed device-level entrypoints

* Introduce INSTANCE_ENTRYPOINTS_LIST_EXPANSION for entrypoints that:
  * Come from device-level extensions,
  * Are looked up via instance APIs,
  * Are _not_ in core Vulkan.
* Assign them an empty extension string so they’re always exposed, regardless
  of which instance extensions the application requests.

Hiding non-intercepted functions

* Any entrypoint the layer lists internally but does _not_ intercept 
  is now hidden from applications, preventing calls into stubs.

These combined changes ensure the layer:

* advertises only the extensions it needs,
* obeys all cross-extension dependencies, and
* never leaks unsupported symbols via GetInstanceProcAddr/GetDeviceProcAddr.

Signed-off-by: Maged Elnaggar maged.elnaggar@arm.com 
Change-Id: I7a5e5cb210e017f1aed76b187db1f40537010914
2025-06-27 15:21:58 +00:00
Nir Ekhauz
0545f795de Document the VK_PRESENT_MODE_FIFO_LATEST_READY_EXT support for Headless and Wayland
1. Remove the guards.
2. Update the README.md file

Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com>
Change-Id: Iccf31b407c5cef4ebf2577f48cc378c6438ccf68
2025-06-08 15:32:22 +03:00
Normunds Rieksts
cedf53a2be Enables the present wait extension by default - experimental flag is no longer needed.
Fixes the following issues:

* For Wayland backend, populates the presentation feedback listener with all callbacks as it is considered a fault by the protocol to not implement those
* For Wayland backend presentation feedback listener, forwards the feedback_discarded event to present ID as there could be situations where previously submitted buffers are discarded, such as when swapchains are using the MAILBOX presentation mode.
* For all swapchains, communicate critical errors back to present wait extension as otherwise, all callers waiting that are waiting on present to be delivered in vkWaitForPresentKHR call will never exit.
* Expanded the implementation in vkWaitForPresentKHR to be able to return critical swapchain errors if they have occured during the wait time.
* Fix issues in present ID where infinite waits could result in the vkWaitForPresentKHR call returning immediately due to UINT64_MAX timeout resulting in overflowing the system clock used in std::condition_variable

Change-Id: I1e475c3073c05394db259657eae1da21764a5a5c
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Alex Bates <alex.bates@arm.com>
2025-06-06 16:41:12 +00:00
Iason Paraskevopoulos
5e91113efd Merge 'Tag fences created by the layer' into 'main'
See merge request mesa/vulkan-wsi-layer!161
2025-06-04 11:18:37 +00:00
Iason Paraskevopoulos
eda337c308 Tag fences created by the layer
Tags the fences created by the layer with the WsiLayerFence name
when instrumentation has been enabled.

Change-Id: I90ad71e5073d80cd650c6ba3be406abd67185376
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-06-04 11:18:37 +00:00
Rosen Zhelev
3aee47be65 Merge 'Support VK_PRESENT_MODE_FIFO_LATEST_READY_EXT for headless & wayland' into 'main'
See merge request mesa/vulkan-wsi-layer!160
2025-06-04 09:39:04 +01:00
Avi Shif
670f1e9476 Support VK_PRESENT_MODE_FIFO_LATEST_READY_EXT for headless & wayland
Enabling VK_PRESENT_MODE_FIFO_LATEST_READY_EXT for headless & wayland
This extension is handled the same as the MAILBOX ext.

Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com>
Change-Id: I010c3c9474a6d9c28964806ba5aa63549b622454
2025-06-04 09:39:03 +01:00
Ginu Jacob
5d4b84408a Acquiring timings for VK_PRESENT_STAGE_QUEUE_OPERATIONS_END_BIT_EXT 2025-05-28 15:59:16 +00:00
Maged Elnaggar
16e77d770a Support WSI present timing if time domain supported 2025-05-16 08:26:19 +00:00
Ginu Jacob
29ee099f25 Use the KHR version for vkGetCalibratedTimestamps
In this change, instead of checking the available version for
vkGetCalibratedTimestamps between KHR and EXT, unconditionally use the
KHR version in VK_EXT_present_timing as the extension has a dependency
on VK_KHR_calibrated_timestamps extension.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I279182ae6d5311613c430546a8054dee0276c499
2025-05-14 16:32:07 +01:00
Normunds Rieksts
ab138f30ef Implement vkWaitForPresentKHR entrypoint 2025-05-09 16:04:39 +00:00
Ginu Jacob
4bd55986b3 Merge branch 'upstream/main' into gitlab/ginu.jacob/present_stage_time_domain_cal
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I7185d7009412a684f023791427f4cac7c0ba3806
2025-04-08 17:10:26 +01:00
Iason Paraskevopoulos
a7c2a9181c Merge 'Make layer require VK_KHR_bind_memory2 extension and intercept KHR' into 'main'
See merge request mesa/vulkan-wsi-layer!146
2025-04-08 12:45:02 +00:00
Ginu Jacob
27aecc165e Support timestamp calibration for present stage local time domains
In this change, the support for present stage local time doimain
is enabled. The Vulkan entry-points vkGetCalibratedTimestampsEXT and
vkGetCalibratedTimestampsKHR are introduced. These entry-points are
intercepted for the structure VkSwapchainCalibratedTimestampInfoEXT
to calibrate any stage local time domains.

Internally, the stage local time domains are mapped to VK time
domains with an offset. On intercepting the APIs when the structure
VkSwapchainCalibratedTimestampInfoEXT is available, timestamps
are internally queried based on VK time domain from the driver and are
then converted to the corresponding stage local timestamps using the
internally maintained offset for the time domain.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I635e1bc27dd40540cc5e016ab5f784f9d8ebd333
2025-04-03 16:11:31 +01:00
Dennis Tsiang
bd54fc460b Update entrypoint list documentation with the alias parameter
The comment explaining the format for the entrypoint entries are
updated to include the new alias parameter.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I34b0d1247a010b0e60b19bb284bb6bdaf32eab23
2025-04-03 11:55:02 +01:00
Dennis Tsiang
928514385b Make layer use non-KHR commands for promoted entrypoints
Some entrypoints when promoted lose the KHR suffix. Some ICDs only
provide the non-KHR versions and the KHR versions are unavailable
unless the associated extension is explicitly enabled. This change
makes the layer's dispatch table internally convert any promoted KHR
entrypoint calls to the non-KHR version when the the Vulkan API is of
sufficient level.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I556c9071b738e15ef5fd2f970a8443b1c5215b16
2025-04-02 18:44:47 +01:00
Alex Bates
4eb145cf8b Handle VkPhysicalDevicePresentWaitFeaturesKHR
Advertises support for present wait in vkGetPhysicalDeviceFeatures2KHR when all surface extensions are supported. If there are unsupported extensions, present wait feature advertisement is left to lower layers.
2025-04-01 09:29:51 +00:00
Normunds Rieksts
637b847465 Fix the bugs with function dispatcher and swapchain handling
Fixes two bugs:
  - The handling when swapchains are destroyed when VK_NULL_HANDLE is
    passed for the vkDestroySwapchain function to terminate early rather
    than forward it to any dispatch functions below us which could
    potentially not be exported by the layers/ICDs below us.
  - The dispatcher did not implement get_fn() correctly as if the
    function that we attempted to acquire was NULL, this function still
    returned a valid std::optional with the function pointer itself
    being set to NULL if no layers/ICDs under ours did not implement
    these entrypoints. This fixes other issues that could arise in the
    layer when this function is used.

Change-Id: If4fb67c246ef48a97f88914acfb8db3df734b133
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-03-13 17:47:43 +00:00
Normunds Rieksts
a92fa2a8d9 Add support for querying swapchain timing properties
Adds initial support to the headless and Wayland backends to query
swapchain timing properties. This patch also moves all present timing
backend specific code into its own file and refactors the private_data
code that is specific to present timing entrypoints into a more common
format.

Change-Id: I377197a6e14b3cbd968e35735d43060d19dfe5bc
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-02-11 16:47:42 +00:00
Ginu Jacob
02ae04d08f Introduce an extensions abstraction in the layer
In this change, an abstraction layer is added to the swapchain
extensions. The extensions present_timing, present_id,
image_compression_control, frame_boundary, and swapchain_maintenance1
are moved to the new extensions abstraction framework.

Additionally, the compression control extension has been formalized in
the layer as it is part of Vulkan spec so compression control guards
have been removed.

Change-Id: Ib28739ca35dfbf5df987241a9010619279f3e1bb
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-01-31 17:31:32 +00:00
Angeliki Agathi Tsintzira
1f37310208 Check for unsupported surfaces in the layer
Change-Id: I64eca7bf0f5f095c4dbc916c84377ae17350b3ec
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
2025-01-13 10:53:31 +00:00
Angeliki Agathi Tsintzira
3051ca8b67 Add vkGetSwapchainTimeDomainPropertiesEXT support 2024-11-15 12:49:31 +00:00
Normunds Rieksts
94dd9840c9 Implement support for marking frame boundaries 2024-10-01 15:18:22 +00:00
Dennis Tsiang
b1f9e5811a Add initial support for VK_KHR_present_id
Layer updated to advertise support for the VK_KHR_present_id
extension. vkGetPhysicalDeviceFeatures2KHR and vkCreateDevice updated
to handle the new struct.

Also add the extensions enabled by the layer to the
instance_data and device_data objects so that the layer can correctly
check which extensions have been enabled.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I71ae2b28c94d3f16b485a06094712d6c3f6c7e77
2024-08-20 11:46:07 +00:00
Normunds Rieksts
d2b8eb3135 Add vkReleaseSwapchainImagesEXT entrypoint
Adds the vkReleaseSwapchainImagesEXT entrypoint in the WSI layer which
allows applications to release the acquired images back to the swapchain
without presenting them.

Change-Id: I52900547f95661e6ec40cb586b035da0ca2d266f
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:27:53 +01:00
Dennis Tsiang
8f2722de92 Add support for VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT
Check for VkPhyscialDeviceSwapchainMaintenance1FeaturesEXT struct in
the pNext chains of VkCreateDeviceInfo and VkPhysicalDeviceFeatures2

Change-Id: I540b800d882855c6782043ca6c88bafc850c4bcd
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:26:53 +01:00
Dennis Wildmark
e62cc2d42f VK_KHR_display swapchain implementation
Implementation of VK_KHR_display swapchain class. VK_KHR_display is
another WSI backend that provides surfaces to render directly to a
display. The swapchain class is responsible for creating and managing a
swapchain based on the specific type of surface provided by
VK_KHR_display.

Change-Id: I9b103c20c3444b1ca75f3df7edf6b66fc87a0992
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-12 11:44:22 +00:00
Dennis Wildmark
8a74233de2 Add support for VK_KHR_shared_presentable_image for headless backend
Support for VK_KHR_shared_presentable image added in swapchain_base.
Headless backend will report support for it through
vkGetPhysicalDeviceSurfacePresentModesKHR.

Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Change-Id: Ibbbab0b8c8137fdd41df9889d7e183a8259c83ba
2024-04-30 08:28:21 +00:00
Normunds Rieksts
fecfd94079 Fix issue with OOM CTS test
Fixes issues reported by the
create_instance_device_intentional_alloc_fail.basic CTS test. One of the
issues can happen if allocation fails at the time when dispatch table is
allocated at device/instance creation time which can result in dispatch
table being a null pointer which later is used to resolve Vulkan entrypoints.

This patch also makes sure that dispatch table is passed around the
{instance/device}_private_data::associate functions as a value-type
rather than a pointer which forces the user of the table to use the move
operator as otherwise the ownership transfer from the user to
the{instance/device}_private_data classes was not obvious and the user
could continue to invoke dispatch table functions erroneously.

Fixes the issue of the layer making use of the dispatch table when its
initialization has failed in the cases when calls to
dispatch_table::populate returned an error.

Any calls to vkDestroyInstance within vkCreateInstance
have been removed as the Vulkan loader handles the unloading of the
instance which would otherwise result in a double-free exception being
thrown.

Change-Id: I36bb7219db9d852bc31f09c8154b2f93776c162f
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2024-04-29 16:07:49 +00:00
Dennis Wildmark
2837bab5c4 Refactor dispatch table to fix extension entry point visibility
Add functionality to the dispatch tables enabling the layer to hide
entrypoints from user. Add filtering to
vkGetDeviceProcAddr/vkGetInstanceProcAddr to only return pointers to
entrypoints which belongs to user enabled extensions.

Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Change-Id: Ieec305cc9479363de0b8e1618c671c08f7af3997
2024-02-14 14:33:40 +00:00
Iason Paraskevopoulos
32c5ad9d1b Remove swapchain from device_data after destruction
Fixes an issue, where the swapchain addresses weren't removed from the
device_private_data::swapchains member after swapchain destruction. This
could cause clashes with swapchains handled by different components
(e.g. ICD).

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I0e05734368ef6100b67ded973283f99ef248e540
2022-07-07 08:33:57 +00:00
Matteo Franchin
dd1f3f24cc Enable instance extensions required by layer
The layer needs functionality that is not part of Vulkan 1.0 and is
provided by either Vulkan 1.1 or separate Vulkan extensions.
The layer used to solve this issue by bumping the API version passed
by the application in VkCreateInfo to 1.1 if this was set to 1.0.
This workaround does not seem to be working anymore with recent
versions of the loader. Fortunately, the loader now allows layers
to change the extension lists passed by the application.
This patch changes the layer to use this approach and removes the
API bump logic.

Documentation is updated accordingly.

Change-Id: I61c426311612c7f288a0f7d969782d6c5365acf5
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
2022-05-30 13:51:20 +01:00
Dennis Tsiang
2bc2109194 Add support for VK_EXT_image_compression_control_swapchain
Implement support for VK_EXT_image_compression_control_swapchain
for both the Wayland and the headless windowing systems.
The extension can be conditionally enabled through the new build option
BUILD_WSI_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN. Compiling with this
option enabled requires recent Vulkan headers (1.3.213)
Note also that support in the layer is enabled conditionally to
the ICD supporting VK_EXT_image_compression_control.

Update the WSIALLOC interface to version 2 and add support to
prefer selection of a format with the highest fixed rate compression
from the formats provided. This is used to pick a fixed rate
compression when VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT is
specified during swapchain creation.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Change-Id: Ie37e6901042a65f2a408e428a705b5a24227b262
2022-05-25 16:49:52 +01:00
Iason Paraskevopoulos
2aa963ba92 Implement VK_KHR_get_surface_capabilities2 entrypoints
Adds support for the VK_KHR_get_surface_capabilities2 extension.

Change-Id: Iae882a41819baf413a0ba949ec44d6e722ebca5a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2022-03-10 10:28:33 +00:00
David Harvey-Macaulay
ba0684b5e0 Mark fences and semaphores as already signalled in AcquireNextImage
The VK_KHR_external_[fence|semaphore]_fd extensions allow sync
primitives to be signalled without the use of QueueSubmit. Using these
extensions in AcquireNextImage instead of using QueueSubmit offers two
advantages: (1) there is no waiting for work to complete in the queue
before the primitives are signalled and (2) there is no data race if
the application happens to call QueueSubmit on the same queue at the
same time.

The QueueSubmit method of signalling sync primitives continues to be
used for ICDs that do not support the external FD extensions.

Signed-off-by: David Harvey-Macaulay <david.harvey-macaulay@arm.com>
Change-Id: Ib4a922d44430110e2353a4e0221e27017e72abab
2022-02-08 15:27:29 +00:00
Iason Paraskevopoulos
96657394ec Store enabled instance and device extensions
Stores the enabled instance and device extensions during
vkCreateInstance and vkCreateDevice respectively. This fixes an issue
where function pointers for functions of disabled extensions were
returned during vkGetInstanceProcAddr/vkGetDeviceProcAddr.

Adds functionality for adding extensions that belong to a subset of
other extensions in util::extension_list.

Adds function for checking if the proper surface extension has been
enabled in each WSI backend.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: If5e23e0d07c9f09006be18c410c4e1d4c3a1e676
2021-11-17 11:51:30 +00:00
Iason Paraskevopoulos
17204773df Handle present request for multiple swapchains
Adds an additional semaphore for every swapchain image to be waited for
before the present engine access an image. During a present request with
multiple swapchains, these semaphores are grouped together and are
signaled after the incoming pWaitSemaphores signal.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I94cabbf5f7d9a45dceef60eec7773b48ccc32078
2021-11-01 17:28:43 +00:00
Rosen Zhelev
d7aabddf40 Use explicit synchronization for Wayland surfaces
This change adds the use of zwp_linux_explicit_synchronization_v1 to
attach a Sync FD fence on presented image submitted to the compositor.

The change introduces the wsi/synchronization.hpp header and
implementation of the synchronization primitives used by WSI
implementations. Currently only Vulkan fences and fences exportable to
Sync FD are supported.

Change-Id: Ic7d6b712cc8ae8d171f799af51a70be62585b8a1
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-09-14 10:52:28 +01:00
Rosen Zhelev
c7be05e3ff Implement objects associated with VkSurface
Defines an abstract wsi::surface object to be implemented by each WSI
backend. This object is then associated with the corresponding VkSurface
object in the instance specific data.

To keep track of these objects the layer now intercepts
vkDestroySurfaceKHR, while specific surface creation entrypoints are
intercepted by individual WSI backends.

In addition this change should allow for fixing incompatibility issues
with layers that wrap VkSurface which breaks casting to the Loader's ICD
VkSurface type.

Make greater use of util::unique_ptr and allow for such pointers to be
constructable when casting derived types.

Change-Id: I163e9c47088ad9989583ebce1319b1fc05559d73
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-08-17 16:42:21 +01:00