* Wshadow warns when a variable shadows another
* Wconversion warns on implicit int conversions
* Fixes warnings generated by them
Signed-off-by: Alex Bates <alex.bates@arm.com>
Extends the unsupported_surfaces_ext_array to contain surfaces
supported by the layer, when the layer is built without supporting them.
Also handles the presentWait2 feature similar to presentWait.
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: I2e61d56425ff657de949797be86436c9675d1b1f
The Vulkan spec allows passing a NULL VkInstance to
vkGetInstanceProcAddr when querying global (pre-instance) function pointers, but these functions must be resolved only through the loader, not through layers.
This change ensures that the layer correctly handles NULL instance and
prevents such incorrect behavior comming from upper layers.
Signed-off-by: Muhamad Sammar <muhamad.sammar@arm.com>
Change-Id: Icd67fa4fb819a6f5ab4c5f40d73514ba79174c05
* Updated present timing logic and corrected macros to match Vulkan specification values.
* Added support for vkGetPhysicalDeviceCalibrateableTimeDomainsKHR to include stage-local time domains.
* Updated handling of VK_TIME_DOMAIN_DEVICE_KHR to return timestamps in nanoseconds.
* Modified vkGetPastPresentationTimingEXT to allow retrieval of records without requiring presentIds.
* Improved vkQueuePresentKHR to terminate early when the present timing queue is full.
* Fixed VkPastPresentationTimingEXT::presentStageCount to correctly report the number of stages containing definitive results.
Signed-off-by: Ginu Jacob ginu.jacob@arm.com
Decouples the swapchain images and their memory binder/allocator logic into separate classes. This allows us to reduce code duplication across different backends that use the same type of allocation logic and also allows us to make use of RAII to release the resources for swapchain images.
The swapchain_base and other swapchain classes have been refactored to handle the new swapchain images.
The patch makes the following adjustments:
* Introduces a new swapchain_image class that holds all swapchain image resources
* Introduces a swapchain image factory class that constructs swapchain images
* Introduces a Vulkan image handle class that is responsible for constructing VkImage handles
* Introduces a new interface that describes how swapchain backing memory is being allocated
* As part of this backing memory interface, introduces device and external (wsialloc) backing memory classes
* Introduces a new interface that holds swapchain image data like wl_buffers
* Refactors lots of swapchain image parts out of the base swapchain class and moves it into the respective backends to simplify the swapchain classes.
Support the promoted present_mode_fifo_latest_ready extension.
Change-Id: I92d27aa39553707cd36d7fb7067ffae82f2d95cd
Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
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>
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
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
The present_timing extension depends on present_id2. The dependency
handling is incorrect and is fixed in this change.
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: Id645450eeb5b22551f328a860ffec75ebdbfbc79
1. Update the README file.
2. Remove the guards from the code.
Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: Idf65baee25d09a3b4bc3b563455468bac4d5bddf
- Add support for VK_KHR_swapchain_mutable_format extension to the Layer.
- Expose support for the VK_KHR_swapchain_mutable_format extension.
- Improve find_extension helper API to be spec-correct, const-correct,
and clearer by using the right base type (VkBaseInStructure for input,
VkBaseOutStructure for output),
and concise docs explaining it returns the first matching struct or nullptr.
- Correctly use image_create_info instead of m_image_create_info in
create_swapchain_image function for Wayland.
Signed-off-by: Maged Elnaggar <maged.elnaggar@arm.com>
Change-Id: Id40b28977e63ba76012d3a8f693327f757d75dcd
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
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
Add support for present wait2 ext. for physical, surface and sc.
Signed-off-by: Nir.Ekhauz <nir.ekhauz@arm.com>
Change-Id: I0f7cdadb2d3ea0ecbc32b8b2efe9fc3bb4ba0369
Add support for present id2 ext. for physical, surface and sc.
Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com>
Change-Id: I934d5d8ef7e0fde2de8682bb54696a4044edb047
- Refactor vkGetSwapchainTimeDomainPropertiesEXT to follow spec
- Ensure all time values are returned in nanoseconds
according to the active time domain
Signed-off-by: Maged Elnaggar <maged.elnaggar@arm.com>
Change-Id: Id4c6b86577bd509ec7bb5a946785dbe6642cfb1c
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
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>
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>
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>
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
The check that determines device extension entrypoint visibility
was changed in order to fix CTS failures.
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
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