* 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>
* Changes the image state of ACQUIRED once the image has been presented as in shared present modes they are always in an acquired state.
* Removes thread free image semaphore signalling logic for shared present modes as there is only single image available and is always in an acquired state.
* Removes the reliance on the presentation thread for the shared present modes as it shouldn't be necessary for them as the headless mode does not share the buffer resource with any consumers.
* Adds the ability for swapchain_image class to not signal present fence for presentation request. On shared presentation modes we do not need to use the present fence and it cannot be used as the swapchain only has a single image.
* Adds support for present timing extension for shared present modes.
* When shared preset mode is used, the timings returned are always
* undefined as image is always in a state of being presented.
Change-Id: I6a5a7c744fe0fc115001de55a305d253695faf9f Signed-off-by: Normunds Rieksts normunds.rieksts@arm.com
* 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
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
In this change, the return status from query pool reads for
QUEUE_OPERATIONS_END_BIT_EXT are checked and skipped when not ready.
To cater for correctness of any later reads, the value returned is
cached and compared. Additionally, a fix is added to avoid data
corruption with presentation feedback object in present timing when
vector was used.
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I5f26b6a3c81eb73eff8a4073be7d7ffc81f9eef8
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
* 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
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
Sets timestamps for `vkGetPastPresentationTimingEXT` for the remaining
present stages on headless:
- VK_PRESENT_STAGE_IMAGE_LATCHED_BIT_EXT
- VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_OUT_BIT_EXT
- VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT
These are all set to the same value: when swapchain::present_image is
called. It uses the best monotonic clock supported by the driver.
No need for slot member variables to be atomic any more because they
are only accessed while a lock on m_queue_mutex is held.
Signed-off-by: Alex Bates <alex.bates@arm.com>
Change-Id: I90ffc876890ee74620b7ba8da753794cae51dd36
- 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
Fixes a few issues with the vkGetPastPresentationTimingsEXT
implementation. In particular:
- Entries with presentId = 0 are used to match entries in the
internal queue that didn't have a presentId supplied in the
presentation request.
- pPresentationTimings is returned to the application without any
holes.
- The appropriate return code is returned.
Adds an m_set member in swapchain_presentation_timing in order to allow
marking entries as completed that didn't have a timestamp, e.g.
a presentation request was rejected by the presentation engine.
Adds a mutex for guarding accesses to the internal queue by functions
that can be called by the application.
Minor documentation updates.
Change-Id: Id56bfd039b341e7f540a5ed028e954c490d00dd5
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
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>
In this change, handling for the present timings stages are improved.
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I68e9ae67fa94d39e23504890d922a85bdce938cd
Fixes bugs with the vkGetSwapchainTimeDomainPropertiesEXT entrypoint:
- The time domains counter identifies the current list of available
time domains
- The time domain properties correctly reports the available time
domains and returns them to the application
Change-Id: Ic69578bd93804e823e27879f9f2ee1a5d49a01ce
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
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>