Age | Commit message (Collapse) | Author | Files | Lines |
|
Add error handling to snprintf.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: Id0c0478254c57cb62af6f9cadde16f73b071f466
|
|
Vulkan spec mandates that if handleType of VkImportSemaphoreFdInfoKHR
refers to a handle type with copy payload transference semantics
(which VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT is), then flags
must contain VK_SEMAPHORE_IMPORT_TEMPORARY_BIT.
Change-Id: I426bc4749da48aa12aee55eaa3a1739c7226e8e8
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
|
|
fix build error with GCC 13:
```
wsi/swapchain_base.cpp:150:35: error: expected unqualified-id before ‘&’ token
150 | catch (const std::system_error &)
|
```
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
|
|
Signed-off-by: Jiyu Yang <jiyu.yang@nxp.com>
|
|
|
|
|
|
Changed log level type from long to int, since value is
expected to be a small integer in range [0-3].
Since codebase requires C++17 also replaced strtol with
std::from_chars(), which will parse string as int, and skip updating
the defaut value if VULKAN_WSI_DEBUG_LEVEL env var does not represent
int.
Signed-off-by: Daniel Levin <daniel.levin@amd.com>
|
|
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
|
|
VK_ERROR_DEVICE_LOST implies that the GPU device has entered an
unrecoverable state and further API usage is considered invalid. Thus,
it should be used sparingly. For the layer code, we were returning
VK_ERROR_DEVICE_LOST for implementation specific errors as sort of a
catch all, even when the GPU was still usable. Instead, it would be
better to return other error codes to denote a failure somewhere.
For the page_flip_thread, if we receive a VK_TIMEOUT waiting for the
image's present fence, then we continously retry. All
other error codes will still be propagated.
For the wayland swapchain, instead of returning VK_ERROR_DEVICE_LOST
when we encounter an error in the dispatch_queue call, return
VK_ERROR_SURFACE_LOST_KHR, as this is more suitable.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: Iccc3e75b60fe9296b10963e7f0b3041fbcd29198
|
|
|
|
This keeps it closer to where the rest of the external_memory
parameters are set.
Change-Id: Ibc46e90cebc6d715003772cc78294e164085cfa6
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
|
|
Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com>
Change-Id: I82fa871371bf025a5c181f3b55812a2bee80d566
|
|
strtol does not throw exceptions.
Change-Id: I6d6d3c32c2b61ed0307370bbfc3ce333adb5c504
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
|
|
Fixes a bug in queue submission where the wrong amount of
VkPipelineStageFlags were passed to vkQueueSubmit when the number of
semaphores to wait on were more than 1.
Change-Id: Ic66e0c6a5e4f60659a0fb31c64c565820d4708a8
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
|
|
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>
|
|
Fix CERT C/CPP issues flagged by static analysis tools.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I6758bb83bd0647e4e6b7ccbf84e94f05ba90e160
|
|
Change-Id: I1d3b9d51305d257c9c322caf4cf4d97667fb687b
Signed-off-by: Ben Davis <ben.davis@arm.com>
|
|
A lot of the steps involved in creating a VkImage, allocating backing
memory, and binding the VkImage to the memory do not rely specifically
on Wayland features and could be common to other WSI backends.
This commit attempts to decouple the create_and_bind_swapchain_image()
function in the wsi/wayland/swapchain.cpp from Wayland and wsialloc
specific parts, and instead move the independent parts related to
external memory management to a new external_memory class. This will
allow the independent code to be re-used in future WSI backends.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I8c13ccbbfaef0d345fcd06192e6de484dd53645f
|
|
|
|
To comply with ICDs that expose the
VK_KHR_shared_presentable_image extension, the Layer needs to
handle VkSharedPresentSurfaceCapabilitiesKHR struct (holds
sType=VK_STRUCTURE_TYPE_SHARED_PRESENT_SURFACE_CAPABILITIES_KHR)
for queries on the VkSurfaces managed by the Layer.
A simple implementation that sets the minimum required flags is
provided in this commit.
Since no WSI layer swapchain will support the shared presentable modes,
no other functionality is required. VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
must be included in the sharedPresentSupportedUsageFlags field but
implementations may support additional usages.
Signed-off-by: Lior Dekel <lior.dekel@arm.com>
Change-Id: I73b29e54a84376c663b3cada989c910d1ba27293
|
|
|
|
|
|
3 is not enough for performance testing. Let us double the maximum
number we can make.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I11a055ede33c9d10311109085e59d3f8c1fbcb7e
|
|
Signed-off-by: Aron Virginas-Tar <aron.virginas-tar@arm.com>
Change-Id: I37043259e349874a9a7eb495a0e3b939c144798f
|
|
Replaced call to unsafe function strcpy() with call to snprintf().
Signed-off-by: Aron Virginas-Tar <aron.virginas-tar@arm.com>
Change-Id: I0de5f869200e74b6d0c8224da2e41d6c4b8b6f4d
|
|
All of the issues that this patch fixes should not occur in practice,
but make the code a bit more robust. For example, this patch
default-initializes structures passed to Vulkan for initialization.
Normally, initialization should be done by the Vulkan entrypoint,
so it should be fine not initializing the structure as long as the
Vulkan API entrypoint exits with success status. It is still a good
idea to default-initialize anyway to make the behaviour deterministic
in cases where something is wrong in the system. All changes made
should have a negligible impact on performance for typical
applications.
Change-Id: Ia606ad2d3ea1627f9dfef0cadf93c7468ab568d8
Signed-off-by: Matteo Franchin <matteo.franchin@arm.com>
|
|
Signed-off-by: Lior Dekel <lior.dekel@arm.com>
Change-Id: Ia5053b202f4e64fd7a255ede513653a951ab3d41
|
|
Change-Id: Ifa3f945a1216677c9410c09f4b4341a70d918514
Signed-off-by: Rosen Zhelev <rosen.zhelev@arm.com>
|
|
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
|
|
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
|
|
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>
|
|
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
|
|
Adds support for the VK_KHR_get_surface_capabilities2 extension.
Change-Id: Iae882a41819baf413a0ba949ec44d6e722ebca5a
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
|
|
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>
|
|
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
|
|
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>
|
|
Users should use CMAKE_BUILD_TYPE to set the build type
Change-Id: I526b3a96f798a39ceca11674bf1e0b6964a3da7d
Signed-off-by: Ben Davis <ben.davis@arm.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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
|
|
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>
|
|
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>
|
|
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
|
|
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>
|
|
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>
|
|
Change-Id: I153e7a78609651bbfdf4fc0b6675d0ea97763905
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
|