Commit graph

381 commits

Author SHA1 Message Date
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
Iason Paraskevopoulos
626e40ba96 Add WSI integration guide
Adds a guide on implementing a WSI backend and extra documentation in
a few functions in swapchain_base.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: Ibdc702a05605989940966aae168331268c1ce2ba
2022-06-15 10:33:32 +01: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
Iason Paraskevopoulos
feee8f5d36 Use common code for get_surface_formats implementations
Adds a template function for setting the supported surface formats for
a surface. This function is used in the get_surface_formats
implementation of both the WSI backends, which previously were
implementing the same logic independently.

Removes the unused surface argument from get_surface_formats and
get_surface_capabilities.

Change-Id: Ib220166675d1c24aeef230cf9f510abba9e42a61
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2022-03-10 10:22:22 +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
Dennis Tsiang
e78252429a Fix FD ownership issue in Wayland Vulkan import
When a file descriptor is imported in Vulkan as a dma buf the Vulkan
implementation takes ownership. We use this property to manage the
lifetime of file descriptors allocated by WSIALLOC by importing them as
VkDeviceMemory. After import the WSI Layer doesn't need to close any
file descriptors and instead only needs to destroy the VkDeviceMemory
object.

However after import the original file descriptor should not be used by
the application. Currently the WSI Layer Wayland implementation violates
this by using the FD to pass to the compositor. This commit fixes the
issue by initiating the Wayland requests before importing the fd.
Internally libwayland will duplicate the fd.

Change-Id: I3ca877f90f0139cf23b8b39c6024e8815b82d692
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2022-01-24 17:23:03 +00:00
Ben Davis
79b5d296c2 Remove DEBUG build option
Users should use CMAKE_BUILD_TYPE to set the build type

Change-Id: I526b3a96f798a39ceca11674bf1e0b6964a3da7d
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-12-15 09:35:50 +00:00
Rosen Zhelev
5bed7d0c9b wayland: Fix nulltpr dereference on deprecated swapchains
Fixes a nulltpr dereference when a buffer release event is processed on
deprecated swapchains. In such a case some of the swapchain images are
invalid and associated resources have been freed.

Change-Id: I8f1c66e42e900d63c8c43cb53068a8aee9ea25a9
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-12-13 09:57:53 +00:00
Fufu Fang
c6a38f53c2 Casting operands to a wider type to prevent integer overflow
Previously the calculation for total_size was done in 32-bits, as the
operands were all 32-bit signed or unsigned integers. This led to
integer overflow when the extent being allocated is too large.
total_size is finally cast to size_t, as the kernel UAPI for ION uses
size_t.

Change-Id: I7a76b2c18be25fda0bf6ef70cd8a6fe717c2903c
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2021-12-10 12:11:30 +00:00
Dennis Tsiang
c06709c840 Include modifiers in params creation
Include the modifiers in the call to zwp_linux_buffer_params_v1_add

Change-Id: If4407af5f402a418b69a670d316fe56cce9f2a14
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-12-09 11:52:23 +00:00
Dennis Tsiang
0c7dcc9be9 Fix bug in has_descendant_started_presenting in headless backend
If there exists two swapchains where one is a descendant of another, we
need to return VK_ERROR_OUT_OF_DATE_KHR error if the application tries
to present from the ancestor when the descendant has started presenting.

The has_descendant_started_presenting() function checks whether the
descendant has started presenting by looking for pending images in the
descendant's list of swapchain images. However, the descendant could
have already presented its pending image(s) before the ancestor arrives
at this check. In this scenario, the descendant will have marked the
swapchain image(s) as now free, and therefore when the ancestor looks
for pending images it will fail to find any. This causes the function to
incorrectly return false.

This bug can be resolved by creating a new boolean member variable to
track whether the swapchain has started presenting.

Change-Id: Ibc3399a4bb05f89940f0b595d25aa07b8e2a2cb8
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-12-06 13:06:33 +00:00
Ben Davis
8dacefb892 Check for required protocols in vkGetPhysicalDeviceWaylandPresentationSupportKHR
Add additional checks ensuring required protocols are supported.
Currently Version 3 of zwp_linux_dmabuf_v1 and Version 1 of
zwp_linux_explicit_synchronization_v1 are required.

Change-Id: Ie1ed37a22254eb14ebdb9cc7d3a35fc99fcb4481
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-12-02 14:26:45 +00:00
Fufu Fang
a41dce418c Improve error handling when copying extension name
The extension list now calls abort() if an extension name exceeding
the length limit is copied.

Change-Id: I105946b647ebd0087dc892d7c8a227628da31966
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2021-11-29 09:18:11 +00:00
David Harvey-Macaulay
9f1c4c1733 Remove ENABLE_WSI_LAYER option
By removing this option, the layer will be enabled by default.

Signed-off-by: David Harvey-Macaulay <david.harvey-macaulay@arm.com>
Change-Id: I6d62e770d914098ad6f0d7d74fb45ce3f8fdbc01
2021-11-26 09:10:04 +00:00
Iason Paraskevopoulos
b3190998c7 Return appropriate error code in acquire_next_image
Fixes an issue, where acquire_next_image was always returning
VK_ERROR_OUT_OF_HOST_MEMORY when the swapchain had gone into a faulty
state.

Change-Id: Iafe016e4e31158d1a5f0d6d785f60d6a724c62ab
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-11-25 15:39:42 +00:00
Normunds Rieksts
92e8614cf9 Remove the roundtrip to Wayland when creating wl_buffers for each image
Change the implementation to create wl_buffers immediately on client
side and defer the creation of wl_buffers on the server
when the first image is presented as that's when all buffered
requests will be flushed to the display

Additionally remove the swapchain event queue as we no longer need it to
dispatch any events

Change-Id: Ic0683e7ec457df63638ce0b972c4925ac836b198
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-11-25 09:52: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
Dennis Tsiang
1701c1fea4 Add versioning to wsialloc interface
The wsialloc interface now has explicit versioning which is used to
ensure that wsialloc implementations are compatible with the interface.
wsialloc implementations should define which version they are using and
upon version mismatch compilation will fail.

Also:
- add new WSIALLOC_MAX_PLANE macro to define the maximum number of
planes that the wsialloc should support.

Change-Id: I211fc4341f249deff0c005d946c483ba47366600
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-11-15 13:59:10 +00:00
Ben Davis
0ef73036aa Update supported composite alpha flags
There is currently no protocol for setting composite alpha blending mode
via Wayland but the expectation is that we use premultiplied alpha
so we only report the premultiplied and inherit composite alpha bits

Change-Id: If4e103b47cb8e99213ca96216abc06d812c68db1
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-11-12 16:46:40 +00:00
Iason Paraskevopoulos
0c8259a994 Merge master branch into multiple_swapchains_present_req
Change-Id: I153e7a78609651bbfdf4fc0b6675d0ea97763905
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-11-12 12:21:10 +00:00
Normunds Rieksts
86fa15a8a2 Fix OOM issue
Fixes an issue where there was a chance that an exception would be
thrown when out of memory rather than returning an
appropriate VkResult code.

Additionally introduces a noncopyable utility class that can be used to
mark classes that should not have copy semantics

Change-Id: I1f84dc9bb1ea96db2a88a90d56adbee78b17c5e3
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-11-11 18:27:31 +00:00
Ben Davis
a7a53ef092 Integrate clang-tidy-8 with cmake build
We will now run clang-tidy if available as part of the standard build
with the bugprone-* and modernize-* checks

Change-Id: I4c9d3cf8712f802b912d32a443bca1584169a8b3
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-11-11 10:15:22 +00:00
Ben Davis
6ef056b517 Update code to use modern c++ style
Fix warnings given by clang-tidy 8 with checks 'bugprone-*,modernize-*'

Change-Id: I2e5660c5872728f957869c66b1143cfcc76bc20e
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-11-11 10:15:22 +00:00
Iason Paraskevopoulos
1da8a30a6d Merge master branch into multiple_swapchains_present_req
Change-Id: Ibc6c094d85795e532e59184252896ecd05b50019
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-11-10 15:38:07 +00:00
Normunds Rieksts
5bf469a278 Ensure that swapchain is not passed to the ICD when creating images
Ensures that all images created from a headless swapchain use the
same vkImageCreate info.

This ensures that when calling vkCreateImage with a swapchain that
is owned by the layer the VkImageSwapchainCreateInfoKHR is not
passed further down the chain to ICD on headless implementation.

Change-Id: I1bd723589e52577b98fd53ec1ec769e5594a0838
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-11-08 14:17:34 +00:00
Dennis Tsiang
080d5d2bf7 Set default visiblity of functions to hidden
Reduce the number of functions that are exported by the layer. This
helps resolve dynamic linking issues where multiple functions are named
the same in different shared libraries. Also add function specifiers and
calling conventions to all extern "C" functions.

Change-Id: I07b33ff8d066e33c5dbdf0cbc13aa7835a78220b
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-11-08 13:42:20 +00:00
Iason Paraskevopoulos
937552cc18 Use device allocator for stage flags vector
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I2b7882e10eca2f4cfbd3668b6265d5b6093c4272
2021-11-05 11:40:45 +00:00
Iason Paraskevopoulos
b481ec0bd2 Move queue for frame events to the surface object
Moves the handling of frame done events from the swapchain object to the
surface object. This will prevent failures where a frame done event
arrives after the swapchain has been destructed but the surface hasn't.

Uses wayland_owners objects for managing the surface event queue and the
frame done event callback.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I61459440e7a6fe8d9447d13f65b797cfcf05f0ed
2021-11-05 11:39:38 +00:00
Matteo Franchin
454ce6c267 Add documentation for Wayland support
- Clarify requirement of Vulkan 1.1 support in Vulkan Loader and ICDs
- Add a list of Vulkan extensions required for Wayland
- Document option to provide a custom implementation of the wsialloc.h
  interface and to disable support for VK_EXT_headless_surface
- Fix link to Vulkan Loader documentation

Change-Id: I791577a49570855fde86b2ffb1ac8e966f2073d9
2021-11-02 18:11:03 +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
Normunds Rieksts
02203b8412 Add ability to specify custom wsialloc implementations
Adds the ability to link the project with a custom wsialloc
library.

This makes it possible to customize the format selection and
allocation to the target system, according to its capabilities.

Change-Id: Iade5cd27aa3515d3debb7fe1f2b96453776d77be
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-11-01 09:17:41 +00:00
Dennis Tsiang
b348247fbe Fix formatting issues
All files in the project should have an empty line at the EOF. Necessary
for some pre-processing tools.

Change-Id: Ic4502588f2733f669fc1edc898258f8589c484c6
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-10-29 08:51:25 +00:00
Fufu Fang
b96455b845 Remove the TODO on the max Wayland image size.
It is valid to create windows exceeding the display size. It is correct
to set the image size limits to the GPU limits.

Change-Id: I53d0865ad1a540cd2eb92137ef325f000bd76159
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2021-10-27 15:16:13 +01:00
Normunds Rieksts
00338d89f5 Add build option for headless extension
Adds a build option that provides the ability to build the layer
with or without headless extension support

Change-Id: Iedefbd38daf80d84f4763ea54117ca18c7fad088
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-10-26 10:07:14 +00:00
Iason Paraskevopoulos
5cc3b2f498 Always set use_presentation_thread flag in init_platform
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I1b917f5287c635dbb00b05607c5a36ce7b11767e
2021-10-15 13:34:37 +01:00
Iason Paraskevopoulos
65c5f1e4f1 Implement MAILBOX presentation for Wayland swapchains
Adds support for image presentation without relying on the page flipping
thread to communicate with the WSI backend.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I4fd2b937351fc484897dc7e9597aa6e81b37fbdf
2021-10-14 15:45:34 +00:00
Ben Davis
e00a2d8e40 Fix issues found by static analysis
Change-Id: I222ec3b352aa220b6c08df3a71de48178b67f06d
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-10-11 17:31:57 +00:00
Dennis Tsiang
bed55ba330 Synchronise access to the ring buffer pool
We need to synchronise access to the ring buffer pool in order to avoid
concurrency bugs as multiple threads can mutate the state of the ring
buffer and if we do not serialise these changes then they can result in
errors.

Change-Id: If96e1707716370bcf57416cd505d16aa75c0d68c
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-10-08 08:41:29 +00:00
Iason Paraskevopoulos
212a7314c3 Update json manifest
Updates the api_version to 1.2 in the json manifest. Also, adds the
entrypoints node in the device extensions as it is mandated by the
loader's documentation when an extension adds Vulkan API functions.

Removes support for intercepting vkEnumerateInstanceLayerProperties,
vkEnumerateInstanceExtensionProperties and
vkEnumerateDeviceExtensionProperties as the loader can get the
information they provide from the layer's json manifest in its
terminator functions.

Change-Id: I2c304d1d2ea17d3ea0c723694f8fc4c8a92054a0
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-10-07 13:22:00 +00:00
Rosen Zhelev
d74a006c7b wsi: Fix swapchain teardown causing hangs
The swapchain teardown waits for pending images incorrectly. The
regression caused the wait to complete before pending images were
processed as well as a hang when all images are acquired by the
application or pending presentation. In this case the swapchain
teardown would hang waiting on the last image presented by a compositor
that would never be released.

Fixing this exposes additional hangs when swapchain images update the
free semaphore after being marked as free. There are also potential
hangs if multiple threads are waiting for all pending images or
acquiring an image at the same time. These issues are addressed by
serializing those actions with a mutex.

Change-Id: I266c93a61333d59823f404ea6ba19fb343f46a13
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-10-05 17:09:09 +00:00
Iason Paraskevopoulos
ba54f0e9ca Remove destroy_image from unpresent function
Fixes an issue, where in Wayland the new swapchain hanged during its
first image presentation in the page flipping thread when it waited for
the old swapchain to finish presenting its pending images. As the new
swapchain had started presenting destroy_image was called during the
unpresent function for the old swapchain and the image's status was set
to INVALID instead of FREE. So free_image_found never returned true and
subsequently get_free_buffer was blocked in the loop. The issue is fixed
by removing the call to destroy_image in unpresent_image as it is
redundant and is done in swapchain teardown.

Change-Id: I192607f50eb5e5f0e4e9baf66aedf02221f20b63
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-10-05 14:48:09 +00:00
Dennis Tsiang
b4db2258ab Add support for some Vulkan 1.1 structs
This commit adds support for VkBindImageMemorySwapchainInfoKHR and
VkImageSwapchainCreateInfoKHR.

Change-Id: I3d87cd7df380e59ceb386f08437c5d6f09dcee1f
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-09-23 15:35:51 +01:00
David Harvey-Macaulay
8808cc35ba Return vkDestroyDevice from vkGetDeviceProcAddr
The vkDestroyDevice entrypoint was listed as a instance level
entrypoint, that is, to be returned by vkGetInstanceProcAddr; however,
vkDestroyDevice is a device level entrypoint. Consequently, the layer
implementation was not called by the loader upon application calls to
vkDestroyDevice and this caused memory leaks within the layer.

Change-Id: I9d5807ff17965281580cd80eb74b07fb038073b1
Signed-off-by: David Harvey-Macaulay <david.harvey-macaulay@arm.com>
2021-09-17 12:29:15 +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
Dennis Tsiang
1ae0397aaa Update layer to generate Wayland explicit sync files
CMakeLists.txt updated to extract the explicit sync code and header
files from linux-explicit-synchronization-unstable-v1.xml, which is a
Wayland extension that allow explicit synchronisation. This is needed to
support the MAILBOX presentation mode.

Change-Id: Id556b69748663796d14fa8b8ceaa0a9c03e9af6e
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
2021-08-26 13:42:25 +01:00
Dennis Tsiang
03bc497ea4 Add ring buffer utility
Add new utility class implementation ring_buffer and replace existing
struct implementation.

Change-Id: I725033738bff73d33f938e64cc96ca9acb8a910c
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: David Harvey-Macaulay <david.harvey-macaulay@arm.com>
2021-08-26 13:42:23 +01:00
Rosen Zhelev
6282185808 wayland: Add format negotiation
Replaces the default format used on swapchain image allocation. Instead
the format is negotiated between the supported formats by the Wayland
compositor the Vulkan ICD and any external system allocator.

Change-Id: I4b1261c8832391d54b2932a7cacd34a7a8b13085
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
2021-08-17 16:42:21 +01:00
Rosen Zhelev
24f18c6c44 wsi: Move common objects to the wayland wsi::surface
Moves data and Wayland objects such as the registry to the
wsi::wayland::surface implementation. This also fixes a few issues
with queries where the Wayland display's default queue was wrongly
used and minimizes leaking of server memory from registry creation.

Moves the ownership of the zwp_linux_dmabuf_interface object to the
wsi::wayland::surface as it can be shared between swapchains.

Fixes issues with casting VkSurfaces in the Wayland backend that can
fail when using other layers that wrap the object.

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