In submit_wait_request we were passing the memory location of the
pointer to submission_pnext instead of the actual pointer. This commit
fixes it to pass the actual pointer. Additionally when creating the
frame boundary, set the pNext explicitly to nullptr.
Change-Id: I61ab9c898c3af4b3f401a3de6fdf7201fd2553ac
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Enabling the support for wp_presentation in
Wayland surface. A handle to the interface is
stored in the Wayland surface. The handle is
initialized for each VKSurface.
Signed-off-by: ginujacob <ginu.jacob@arm.com>
Change-Id: I9a2239b3047720fdeb857e23bb529c0f0fce9575
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
The feature is still experimental so we should guard it with the flag
until it's ready to be used.
Change-Id: I3f10f730ca916374241fdcdceaf332672788040d
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Compiler warning was being flagged between the integer comparisons as
we were comparing a int with a size_t. This commit resolves the
warning by updating the int to a size_t.
Change-Id: Ibcb72ac9abb6c8e18bc8aa1e33efadc9ef79a564
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Adds support for handling the present IDs privided by the VkPresentIdKHR
structure that is exposed by the VK_KHR_present_id extension.
Change-Id: If2dfe2cf942f376729b5c0dec79bcfa0c0b49738
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Reorganizes the wayland::surface's member variables in a way that
the objects attached to the queue are destroyed before the queue.
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Change-Id: Ifbc3f285005ae01b0cc75d2827e424db58c392e1
Layer updated to advertise support for the VK_KHR_present_id
extension. vkGetPhysicalDeviceFeatures2KHR and vkCreateDevice updated
to handle the new struct.
Also add the extensions enabled by the layer to the
instance_data and device_data objects so that the layer can correctly
check which extensions have been enabled.
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I71ae2b28c94d3f16b485a06094712d6c3f6c7e77
Adding the entry-points and definitions required for the
VK_EXT_present_timing feature.
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I5f388b50d12fe32556676c4de0d37c95e1ff611b
Previously, the number of planes was incorrectly calculated.
The number of planes for non-linear images was the format
planes from wsialloc instead of the memory planes expected
by the implementation.
Additionally, the VK_IMAGE_CREATE_DISJOINT_BIT was based on
the format planes during image creation, instead of using the
allocation planes from wsialloc.
This commit corrects these issues by ensuring the plane count
and disjoint bit is set based on the appropriate memory planes.
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
Change-Id: I47ca4a0c710cdf21d94705c57f08de4f04b3a761
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>
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>
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>
Adds support for VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT,
by deferring calling create_and_bind_swapchain_image in
acquire_next_image. Also, adds a function for checking if a swapchain
image can be bound to memory when deferred has been selected.
Change-Id: I22e40260d6b06091cc704bca3bf2baa80370c589
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Extends queue_submit to handle the fences passed by the application
through VkSwapchainPresentFenceInfoEXT.
Change-Id: If3f44e2634cc771ee7d01589a59a95d0f86f99df
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Adds a helper function in synchronization.hpp, which makes an empty
vkQueueSubmit in order to chain wait with signal semaphores and fences.
This function is used in submit_wait_request and
fence_sync::set_payload.
Introduces queue_submit_semaphores for grouping the signal and wait
semaphores.
Change-Id: I6107a29f3410fad8250f998b0e4c2052ed1923b8
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Adds the vkReleaseSwapchainImagesEXT entrypoint in the WSI layer which
allows applications to release the acquired images back to the swapchain
without presenting them.
Change-Id: I52900547f95661e6ec40cb586b035da0ca2d266f
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
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>
Check for VkPhyscialDeviceSwapchainMaintenance1FeaturesEXT struct in
the pNext chains of VkCreateDeviceInfo and VkPhysicalDeviceFeatures2
Change-Id: I540b800d882855c6782043ca6c88bafc850c4bcd
Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Add support for format modifiers in framebuffers using
drmModeAddFB2WithModifiers.
Add compilation flag to force VK_KHR_display to not support format
modifiers for framebuffers.
Change-Id: Ie8eb2e96e543a15ab3534a7e73425f277a4b7d58
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Implementation of VK_KHR_display swapchain class. VK_KHR_display is
another WSI backend that provides surfaces to render directly to a
display. The swapchain class is responsible for creating and managing a
swapchain based on the specific type of surface provided by
VK_KHR_display.
Change-Id: I9b103c20c3444b1ca75f3df7edf6b66fc87a0992
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Make the drm_display class a singleton and automatically initialize the
display. Add environment variable for configuring display device.
Change-Id: I869fbf7414bc4a2270b3583577050b7cd8c5b184
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Implementation of the surface_properties interface for VK_KHR_display.
Change-Id: Idd3b53bec0d0a829478d51b4263db767c872d0e5
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Extends wsialloc_alloc to return whether or not the allocation will be
disjoint.
Groups wsialloc_alloc's return values to a struct.
Change-Id: I7542e37d8af16ce7989ab235c02305d562f3c667
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
Support for VK_KHR_shared_presentable image added in swapchain_base.
Headless backend will report support for it through
vkGetPhysicalDeviceSurfacePresentModesKHR.
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Change-Id: Ibbbab0b8c8137fdd41df9889d7e183a8259c83ba
Fixes issues reported by the
create_instance_device_intentional_alloc_fail.basic CTS test. One of the
issues can happen if allocation fails at the time when dispatch table is
allocated at device/instance creation time which can result in dispatch
table being a null pointer which later is used to resolve Vulkan entrypoints.
This patch also makes sure that dispatch table is passed around the
{instance/device}_private_data::associate functions as a value-type
rather than a pointer which forces the user of the table to use the move
operator as otherwise the ownership transfer from the user to
the{instance/device}_private_data classes was not obvious and the user
could continue to invoke dispatch table functions erroneously.
Fixes the issue of the layer making use of the dispatch table when its
initialization has failed in the cases when calls to
dispatch_table::populate returned an error.
Any calls to vkDestroyInstance within vkCreateInstance
have been removed as the Vulkan loader handles the unloading of the
instance which would otherwise result in a double-free exception being
thrown.
Change-Id: I36bb7219db9d852bc31f09c8154b2f93776c162f
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
For maintenance6, VkBindImageMemory2KHR should not return on
the first failure, but rather store the result and return it
after everything is bound.
Signed-off-by: Embla Flatlandsmo <embla.flatlandsmo@arm.com>
Change-Id: I2578d0ad0e6330ed9c091794e05cf5f24c876fb1
Add functionality to the dispatch tables enabling the layer to hide
entrypoints from user. Add filtering to
vkGetDeviceProcAddr/vkGetInstanceProcAddr to only return pointers to
entrypoints which belongs to user enabled extensions.
Signed-off-by: Dennis Wildmark <dennis.wildmark@arm.com>
Change-Id: Ieec305cc9479363de0b8e1618c671c08f7af3997
When fences are imported with a handle type with copy payload transference semantics then the flags must contain VK_FENCE_IMPORT_TEMPORARY_BIT
Change-Id: I950a01465ed68e7c5b35ea17a778ee7327639108
Signed-off-by: Normunds Rieksts normunds.rieksts@arm.com
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>