platform/core/uifw/vulkan-wsi-tizen.git
3 years agoutil: add class for storing extensions strings
Joe Jenner-Bailey [Tue, 4 Aug 2020 11:25:34 +0000 (12:25 +0100)]
util: add class for storing extensions strings

This utility will be used in future commits.

Also add -Wno-undefined to the linker flags to prevent leaving
undefined symbols in the layer .so file. Fix issues highlighted while
using this flag.

Change-Id: I682e266f7b3f313742cb2da83e5ad2569fc72da3
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
3 years agoUse util::allocator in swapchain object
Matteo Franchin [Fri, 27 Nov 2020 09:59:18 +0000 (09:59 +0000)]
Use util::allocator in swapchain object

Change util::allocator's create and destroy methods so that they can
allocate multiple objects, in line with the allocate and deallocate
methods of std::allocator.

Also add documentation for util::allocator and its methods.

Finally, use util::allocator in swapchain.cpp, rather than allocating
memory directly via VkAllocationCallbacks.

Change-Id: I0bc25abe3cbc3af9608218411da8d70e04dd9749
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
3 years agoFix erroneous behaviour in error cases
Iason Paraskevopoulos [Thu, 26 Nov 2020 18:00:05 +0000 (18:00 +0000)]
Fix erroneous behaviour in error cases

Corrects error handling when image creation fails and fixes
shutdown behaviour in error cases.

Change-Id: I29b9fbd237b90f6007e4731d9019efb6b4c256ff
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
3 years agoImplement a vector utility that uses a custom allocator
Joe Jenner-Bailey [Fri, 10 Jul 2020 09:28:51 +0000 (10:28 +0100)]
Implement a vector utility that uses a custom allocator

Add util::vector to provide functionality similar to std::vector,
i.e. growable arrays. util::vector does its allocations via a custom
allocator provided via VkAllocationCallbacks and provides methods to
check whether the allocation fails, e.g. try_push_back() returns false
when the allocation fails and replaces std::vector's push_back() method
that would rather raise an exception to report an allocation failure.

Note that this commit switches on exceptions in the layer by removing
the flag -fno-exceptions.

util::vector is also used to store swapchain images.

Change-Id: I2bf2b24bd06e198c198c4f4aedd8f7fced96a346
Signed-off-by: Joe Jenner-Bailey <joe.jenner-bailey@arm.com>
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
3 years agoFix layer's memory errors
Iason Paraskevopoulos [Tue, 17 Nov 2020 09:27:44 +0000 (09:27 +0000)]
Fix layer's memory errors

Fixes the wrong allocation of extensions properties.

Adds a call to the dispacher's DestroyInstance function before the
destruction of the instance.

Change-Id: I169bb3ba670d89e30af1f6ce47c536477978c169
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
3 years agoFix failing assert in swapchain_base.cpp
Dennis Tsiang [Tue, 27 Oct 2020 11:12:00 +0000 (11:12 +0000)]
Fix failing assert in swapchain_base.cpp

Erroneous assert was left in swapchain_base.cpp after some refactoring
was done. This commit removes the assert and updates the CMakeLists.txt
file to turn on compiler warnings so that developers can spot these
leftover code earlier.

Change-Id: I7f4051c89a86f21f66f20b0e92f01bc101436c71
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
3 years agoheadless: Fix build with up-to-date Vulkan headers
Rosen Zhelev [Sun, 28 Jun 2020 20:41:21 +0000 (21:41 +0100)]
headless: Fix build with up-to-date Vulkan headers

Vulkan Headers removed VK_FORMAT_RANGE_SIZE. The VkFormat enum now
has valid values in multiple ranges for different extensions.

Fixes headless implementation for itterating over core Vulkan 1.0
formats.

Change-Id: I417cfd881e479e5fb243c0b775600504af3877b1
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
4 years agoRemove use of pthread_cancel in the swapchain page flip thread
Dennis Tsiang [Fri, 1 May 2020 12:25:30 +0000 (13:25 +0100)]
Remove use of pthread_cancel in the swapchain page flip thread

The WSI layer may call pthread_cancel and kill the page flip
thread while it's still being used in Vulkan-API calls. This can cause the
layer to fail to clean up internal resources of the associated device,
leading to memory leaks. To resolve this, the layer now instead checks
if the page flip thread needs to end on every loop iteration. The
m_page_flip_semaphore has also been changed to a timed_semaphore to avoid
hanging indefinitely. In addition, m_page_flip_thread is now type
std::thread, which follows the gradual move towards C++ standard code
and moved to a private member function of the class.

Change-Id: Iefbdd0d68e1f92fdf79bcebb7eaf33429fc61fd3
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
4 years agoMove WSI type specific calls
Rosen [Thu, 21 Nov 2019 15:23:59 +0000 (15:23 +0000)]
Move WSI type specific calls

Move all WSI type specific calls to WSI factory methods. This
removes headless references in layer/ and allows for simpler
support of multiple windowing systems.

Change-Id: I757a7a3bb4267783420b52cceb3bde8ce233297e
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
4 years agoAdd a simple build test to the Vulkan WSI Layer's CI
Matteo Franchin [Fri, 13 Sep 2019 18:34:18 +0000 (19:34 +0100)]
Add a simple build test to the Vulkan WSI Layer's CI

The test just ensures the code can be built. For now we start from a
Fedora image and install quite a number of packages. This is not very
friendly in terms of network bandwidth. We should address this by
uploading a custom image in the future.

Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Change-Id: I5c9fa86b081650ce12ef92e333475670a4daa5fb

4 years agoFix small issues in documentation and code
Matteo Franchin [Wed, 11 Sep 2019 13:26:22 +0000 (13:26 +0000)]
Fix small issues in documentation and code

A couple of details in the installation instructions needed updating.
Also fixed a warning message due to a missing return statement (the
return value is currently not used in calls to the function).

Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
Change-Id: I715b954579253e664ebe01f757587e0602ad82e7

5 years agoInitial sources for the vulkan-wsi-layer project
Matteo Franchin [Fri, 24 May 2019 14:57:50 +0000 (15:57 +0100)]
Initial sources for the vulkan-wsi-layer project

This commit adds the initial sources for the vulkan-wsi-layer project:
a Vulkan layer which implements some of the Vulkan window system
integration extensions such as VK_KHR_swapchain.
The layer is designed to be GPU vendor agnostic when used as part of the
Vulkan ICD/loader architecture.

The project currently implements support for VK_EXT_headless_surface and
its dependencies. We hope to extend support for further platforms such
as Wayland and direct-to-display rendering in the future.

This initial commit collects contributions from different individuals
employed by Arm.

More information on the project (building instructions, how to
contribute, etc.) can be found on the README.md file at the top of the
project tree.

Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>