Commit graph

47 commits

Author SHA1 Message Date
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
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
9608f70237 Add clang-tidy linting to merge requests CI
Introduce a new clang_tidy job that runs on merge requests
and the default branch. The job configures CMake to export
compile_commands.json and runs run-clang-tidy restricted to
repo files. Any warnings or errors cause the job to fail.

Artifacts include clang-tidy.log and compile_commands.json
to aid local reproduction. Shared Vulkan Loader setup was
factored into a YAML anchor for reuse across jobs.

Signed-off-by: Maged Elnaggar <maged.elnaggar@arm.com>
Change-Id: I61b48656e68e0e83725500ae1b37f8626f9a248c
2025-09-10 14:31:35 +01:00
Iason Paraskevopoulos
b02e682d30 Update present timing types
Updates the present timing implementation and types to be aligned with
the latest commit.

Fixes an issue, where the queue used for the presentation feedback
events was destroyed before getting the last events.

Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I1dba2fd0e4ad9ec8c02d71c58c93edceaa75d07e
2025-09-04 17:48:10 +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
Normunds Rieksts
dfe88e3c1c The patch changes the following:
* Implement scheduling support for headless present stages.
* Fix a bug where present query stages were added to the internal queue when application did not request any.
* Change the implementation of present timing extension to store device_private_data rather than VkDevice as all queries require it.
* Document the shortcomings of implenting scheduling support for Wayland backends.

Change-Id: I050cc700a88bce476b350caf8cc23dfb551f4a0c 
Signed-off-by: Normunds Rieksts normunds.rieksts@arm.com
2025-07-30 12:27:09 +00:00
Ginu Jacob
d807a089c3 Timestamp for VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT in Wayland
In this change, support for the presentation stage
VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT is added for the Wayland
backend.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I866f8c55cfb6b69ba03761706d838ea17acf9651
2025-07-24 08:39:09 +00: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
Alex Bates
441d95f1bb Adds support for present timing on Wayland even if the compositor does not support wp_presentation. Previously, support for wp_presentation was assumed.
If the time domain used by the compositor matches one of the time domains supported by the ICD:

* Advertise `VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT` in `VkPresentTimingSurfaceCapabilitiesEXT`
* List `VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT` in `swapchain_time_domains`

Also handles the case where neither `VK_TIME_DOMAIN_CLOCK_MONOTONIC_KHR` or `VK_TIME_DOMAIN_CLOCK_MONOTONIC_RAW_KHR` is supported for all backends.

Additionally fixes the issue where Wayland protocol was not dispatched correctly which resulted in Clock_ID event not being communicated back to the layer.

Signed-off-by: Alex Bates <alex.bates@arm.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-06-18 12:15:41 +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
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
Iason Paraskevopoulos
281049aa78 Merge remote-tracking branch 'main' into add_swapchain_image_creator
Change-Id: I22a4c697c8b1181127242848f37ea081243f0d03
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-04-25 15:30:01 +01:00
Iason Paraskevopoulos
ca3820a0ba Add external memory extension
Adds a swapchain create info extension for creating an image using
external memory. This removes the need for modifying the
image_create_info in the display and wayland backends. There is still
code duplication left in these backends though, because swapchain
allocation needs to know the selected format. This will be removed when
the swapchain images will be created from the swapchain image creator.

Moves the definition of drm_format_pair to drm_utils.

Removes two step initialization from swapchain_wsi_allocator.

Change-Id: I0c937a59cc62e7e3134f0af4728fdda3739237bd
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-04-25 15:28:39 +01:00
Fufu Fang
e765b38308 VK_EXT_present_timing updates for Wayland
This commit updates time domain used in the
VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT present stage
in the Wayland backend.

Change-Id: I0d158d0eea6608edd532fbebadb18713d5486d6b
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Signed-off-by: Alex Bates <alex.bates@arm.com>
2025-04-14 13:58:26 +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
5c3d3a9d7c Add -Wextra flag and fix warnings
With the addition of the -Wextra flag, additional compiler warnings
are enabled, which help identify potential issues in the code.
However, enabling -Wextra caused compilation failures due to the
-Werror flag, which treats warnings as errors. This commit enables
-Wextra and addresses all the warnings produced, ensuring the
code compiles successfully while maintaining higher code quality standards.

Change-Id: I0bbaead9b2b15530d2565a3dddf1ed676901269b
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
2025-01-20 10:19:25 +00:00
Dennis Tsiang
3f9d76b9fa Fix build issue with newer Wayland headers 2024-10-14 11:21:53 +00:00
ginujacob
0cee10aa6f Advertise VK_EXT_present_timing features.
Enabling the VK_EXT_present_timing features
VkPhysicalDevicePresentTimingFeaturesEXT and
VkPresentTimingSurfaceCapabilitiesEXT.

The feature values are updated based on the backend.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: Ie322f58118108c656530128b18ec905bd6815c63
2024-09-17 11:31:46 +01:00
Dennis Tsiang
7f428885e1 Refactor compatible present mode functionality
Refactor the compatible present mode functionality into a new class
compatible_present_modes.

Change-Id: I801f41ba16d9c5693f1aaa1e95e9eb2c9c4f5b59
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:27:55 +01:00
Dennis Tsiang
05e98f4d17 Support switching presentation modes
Add support for handling VkSwapchainPresentModeInfoEXT and
VkSwapchainPresentModesCreateInfoEXT when supplied as part of the
pNext chain of VkPresentInfoKHR and VkSwapchainCreateInfoKHR
respectively.

Since the headless backend has no effect when switching between FIFO
and FIFO_RELAXED, and the wayland backend does not support switching
presentation modes between MAILBOX and FIFO, the only real thing we
can do is check that the presentation mode requested is one that is
supported by the swapchain and is compatible with the current
presentation mode.

Change-Id: I8d5506e9b1a8fba079e2f9d6ee133038feb27dca
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:27:55 +01:00
Dennis Tsiang
bb31e7fba0 Add support for scaling capabilities
Add support for handling VkSwapchainPresentScalingCreateInfoEXT and
VkSurfacePresentScalingCapabilitiesEXT, as part of the
swapchain_maintenance1 and surface_maintenance1 features.

On Wayland, we will report support for ONE_TO_ONE scaling (i.e. no
scaling) and a default gravity of top left. On Headless, we report 0
scaling support as there's no presentation engine anyway.

Change-Id: Ife41e7e06109bd917fa480b07e447008c9a4f9e1
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:27:55 +01:00
Dennis Tsiang
8e02a7ffe3 Add support for present mode compatibility
This commit adds support for querying a surface's compatible
presentation modes via VkSurfacePresentModeEXT and
VkSurfacePresentModeCompatibilityEXT, as part of the
VK_EXT_surface_maintenance1 extension.

A new struct present_mode_compatibility has been created to capture
this new functionality.

Our headless implementation supports compability between FIFO and
FIFO_RELAXED. On Wayland, we do not allow compatibility between FIFO
and MAILBOX presentation.

Change-Id: I53659cb2f2aa0ac41e37975cc34aee3ce8317a73
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2024-08-13 19:26:54 +01:00
Angeliki Agathi Tsintzira
188ffe6a26 Enable instance extensions
Modify the layer so that instance extensions needed for Wayland are only enabled when Wayland is selected.

In the past, the layer was changed to explicitly enable the instance extensions it needs in the intercepted calls to vkCreateInstance. Therefore, the layers always enabled the extension VK_KHR_external_memory_capabilities, despite this is only required by Wayland.

In this patch, this extension is only enabled when Wayland is enabled, i.e. when VK_KHR_wayland_surface is part of the extensions passed to vkCreateInstance.

Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
Change-Id: I57e98b36e42012ba46769e9dd760a628a09b9ba5
2023-09-28 09:35:19 +01:00
Normunds Rieksts
566a6ee68d Extend TRY macro to print out error messages
Extends the TRY macros exposed by the helper header to be able to print
out error messages.

Change-Id: I61c607376304ba744a95dd6782bb29653235096a
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2022-11-24 11:24:34 +00:00
Lior Dekel
91583f1af2 Create common functions in surface_capabilities class
Signed-off-by: Lior Dekel <lior.dekel@arm.com>
Change-Id: Ia5053b202f4e64fd7a255ede513653a951ab3d41
2022-07-13 14:14:51 +00: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
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
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
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
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
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
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
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
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
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
Normunds Rieksts
d63261cce5 Remove usages of generic allocator in the layer
Remove all the leftover instances in layer that still use the
generic allocator rather than the VkAllocationCallbacks

Add additional memory utility that allows to release memory
allocated by custom allocators using RAII

Change-Id: I43594ddd3c506048ca0f02e31b64597a7abc481b
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-07-22 19:05:26 +01:00
Fufu Fang
b64498c021 Refactoring of extension_list
Unused methods removed. Specialised methods moved out
of the extension_list utility and closer to the point
of usage.

Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Change-Id: I8e6d2786881b5306de21797cfdda46d0e678da8d
2021-07-06 10:37:40 +01:00
Normunds Rieksts
af2af23333 Ensure allocations happen through custom allocators
Document instance_private_data and device_private_data.

Add additional utility containers (util::unordered_set,
util::unordered_map) that ensure that the storage containers
we use allow the use of the Vulkan allocation callbacks.
Additionally, ensure that these allocations don't throw in
case host runs out of memory but rather return the appropriate
Vulkan error code.
Also keep a copy the allocators so they can be used in other layer
functionality to facilitate following the Vulkan specification around
memory allocation.

Add additional utility util::optional that currently makes it easier
to handle errors in the containers described above.

Fix some small issues with the vkCreateInstance/vkCreateDevice
handling and ensure that vkDestroyDevice is called in the layer
handler.

Change-Id: Ic9d8ece405c82e743a2c016cc3dabf984cf77fc1
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-06-28 11:51:33 +01:00
Fufu Fang
f514b0571d Creating logging mechanism for debugging
Introduce a logging mechanism in the layer for replacing the
old ones used in individual files.

Change-Id: I7559f8a99396eeb0b9da6e5ef58cc4b7bd5a82af
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
2021-04-29 16:11:48 +01:00
Ben Davis
8236f8aaaa Remove to-do to check if FIFO is ok on Wayland
Although Mailbox mode is recommended for use on Wayland, FIFO is
required by the Vulkan spec and after investigation our implementation
seems to be compliant with the spec.

Change-Id: Ib3230e31c4dd516bc40dc50c9e920fb145506145
Signed-off-by: Ben Davis <ben.davis@arm.com>
2021-04-21 13:24:19 +01:00
Iason Paraskevopoulos
7c3a626118 Use zwp_linux_dmabuf_v1 interface to query supported formats
Adds functionality to query supported formats of a surface using the
Linux dmabuf extension (zwp_linux_dmabuf_v1).

Removes extern "C" before wayland headers includes.

Introduces Wayland object owners to remove the need of destroying
manually Wayland objects.

Change-Id: I60dc8562bac8746197fff8a0ae059d4edc58cd9a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-03-30 16:54:21 +01:00
Normunds Rieksts
646a7a814b Fixes segfaults in the layer due to uninitialized pointer
The layer would segfault when running due to pointer being left
uninitialized when attempting to query device extensions

Change-Id: If72d822a36224034bf27bef5035015cdb0bffb07
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2021-03-04 13:05:18 +00:00
Iason Paraskevopoulos
8dc4d923ff Adds initial support for VK_KHR_wayland_surface.
Very basic Wayland support is implemented by importing
memory with VK_EXT_image_drm_format_modifiers.
The current implementation requires an external system
memory allocator. An API for this allocator is defined
in util/wsialloc/wsialloc.h and an implementation using
the ION memory allocator is included.

Outstanding issues:
 * This is an initial prototype for Wayland support and
   has many outstanding TODOs which need addressing to
   properly use the Wayland protocol.
 * Using ICD Exported memory instead of a system allocator
   is not implemented.

Wayland support is still experimental and outstanding issues
will be fixed in future commits.

Change-Id: I1b0d5991e15ff1cf25ebbab3392a631b021e8c17
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2021-02-09 18:22:09 +00:00