Commit graph

381 commits

Author SHA1 Message Date
Iason Paraskevopoulos
1e9cb8b1b3 Introduce swapchain_image_creator
Adds a new class named swapchain_image_creator, which will be
responsible for owning and extending image create info.

Change-Id: Icdda2304698e110d4c0d52caa6b7c1fe59c383a9
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
2025-04-25 15:03:42 +01:00
Avi Shif
873ce8885a Fix handling of missing display.
If the display doesn't exit in function
GetPhysicalDeviceDisplayPlanePropertiesKHR,
the function should return zero properties
but should not return error.

Signed-off-by: Avi Shif <avi.shif@arm.com>
Change-Id: I616669a3cd3db6294dae5250c7474ba6f58bd380
2025-04-24 12:12:39 +03:00
Iason Paraskevopoulos
a6de7b407e Merge 'Fix WSI version to suite the Vulkan header version' into 'main'
See merge request mesa/vulkan-wsi-layer!150
2025-04-23 11:20:19 +00:00
Iason Paraskevopoulos
2f36a7acb4 Merge 'VK_EXT_present_timing updates for Wayland' into 'main'
See merge request mesa/vulkan-wsi-layer!149
2025-04-15 10:33:01 +00:00
Fufu Fang
e765b38308 VK_EXT_present_timing updates for Wayland
This commit updates time domain used in the
VK_PRESENT_STAGE_IMAGE_FIRST_PIXEL_VISIBLE_BIT_EXT present stage
in the Wayland backend.

Change-Id: I0d158d0eea6608edd532fbebadb18713d5486d6b
Signed-off-by: Fufu Fang <fufu.fang@arm.com>
Signed-off-by: Alex Bates <alex.bates@arm.com>
2025-04-14 13:58:26 +00:00
shamao01
b813cf4145 Fix WSI version to suite the Vulkan header version
Signed-off-by: shamao01 <shai.maor@arm.com>
Change-Id: I2c509bdef00d300570ee20266ffd1fe0a78e3096
2025-04-14 08:38:30 +01:00
Iason Paraskevopoulos
6958c14113 Merge 'Add missing array include to present_timing_handler' into 'main'
See merge request mesa/vulkan-wsi-layer!148
2025-04-11 05:45:37 +00:00
shamao01
c95e1a9f96 Add missing array include to present_timing_handler
Change-Id: I0d01c29c1b115053aae3c4b606b8d24467ffe48c
Signed-off-by: shamao01 <shai.maor@arm.com>
2025-04-10 13:14:38 +00:00
Dennis Tsiang
5097740a45 Merge 'Support timestamp calibration for present stage local time domains' into 'main'
See merge request mesa/vulkan-wsi-layer!147
2025-04-10 09:36:08 +00:00
Ginu Jacob
4bd55986b3 Merge branch 'upstream/main' into gitlab/ginu.jacob/present_stage_time_domain_cal
Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I7185d7009412a684f023791427f4cac7c0ba3806
2025-04-08 17:10:26 +01:00
Iason Paraskevopoulos
a7c2a9181c Merge 'Make layer require VK_KHR_bind_memory2 extension and intercept KHR' into 'main'
See merge request mesa/vulkan-wsi-layer!146
2025-04-08 12:45:02 +00:00
Ginu Jacob
27aecc165e Support timestamp calibration for present stage local time domains
In this change, the support for present stage local time doimain
is enabled. The Vulkan entry-points vkGetCalibratedTimestampsEXT and
vkGetCalibratedTimestampsKHR are introduced. These entry-points are
intercepted for the structure VkSwapchainCalibratedTimestampInfoEXT
to calibrate any stage local time domains.

Internally, the stage local time domains are mapped to VK time
domains with an offset. On intercepting the APIs when the structure
VkSwapchainCalibratedTimestampInfoEXT is available, timestamps
are internally queried based on VK time domain from the driver and are
then converted to the corresponding stage local timestamps using the
internally maintained offset for the time domain.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: I635e1bc27dd40540cc5e016ab5f784f9d8ebd333
2025-04-03 16:11:31 +01:00
Dennis Tsiang
bd54fc460b Update entrypoint list documentation with the alias parameter
The comment explaining the format for the entrypoint entries are
updated to include the new alias parameter.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I34b0d1247a010b0e60b19bb284bb6bdaf32eab23
2025-04-03 11:55:02 +01:00
Dennis Tsiang
928514385b Make layer use non-KHR commands for promoted entrypoints
Some entrypoints when promoted lose the KHR suffix. Some ICDs only
provide the non-KHR versions and the KHR versions are unavailable
unless the associated extension is explicitly enabled. This change
makes the layer's dispatch table internally convert any promoted KHR
entrypoint calls to the non-KHR version when the the Vulkan API is of
sufficient level.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I556c9071b738e15ef5fd2f970a8443b1c5215b16
2025-04-02 18:44:47 +01:00
Iason Paraskevopoulos
87b58a39b4 Merge 'Handle VkPhysicalDevicePresentWaitFeaturesKHR' into 'main'
See merge request mesa/vulkan-wsi-layer!142
2025-04-01 09:29:51 +00:00
Alex Bates
4eb145cf8b Handle VkPhysicalDevicePresentWaitFeaturesKHR
Advertises support for present wait in vkGetPhysicalDeviceFeatures2KHR when all surface extensions are supported. If there are unsupported extensions, present wait feature advertisement is left to lower layers.
2025-04-01 09:29:51 +00:00
Iason Paraskevopoulos
97102b304f Merge 'Use wp_presentation_feedback to update the presented ID value' into 'main'
See merge request mesa/vulkan-wsi-layer!143
2025-04-01 09:27:18 +00:00
Dennis Tsiang
2d1b682129 Use wp_presentation_feedback to update the presented ID value 2025-04-01 09:27:18 +00:00
Dennis Tsiang
201914d7cc Make layer require VK_KHR_bind_memory2 extension and intercept KHR
Enables the layer to intercept vkBindImageMemory2KHR, and by requiring
the extension we ensure we can always call the entrypoint down the
chain as well.

Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
Change-Id: I1ec5f8c6ba648151e08101549cb795e990c84aeb
2025-03-31 13:42:18 +01:00
Rosen Zhelev
0562f6c433 Merge 'Fix the bugs with function dispatcher and swapchain handling' into 'main'
See merge request mesa/vulkan-wsi-layer!145
2025-03-14 16:15:36 +00:00
Normunds Rieksts
637b847465 Fix the bugs with function dispatcher and swapchain handling
Fixes two bugs:
  - The handling when swapchains are destroyed when VK_NULL_HANDLE is
    passed for the vkDestroySwapchain function to terminate early rather
    than forward it to any dispatch functions below us which could
    potentially not be exported by the layers/ICDs below us.
  - The dispatcher did not implement get_fn() correctly as if the
    function that we attempted to acquire was NULL, this function still
    returned a valid std::optional with the function pointer itself
    being set to NULL if no layers/ICDs under ours did not implement
    these entrypoints. This fixes other issues that could arise in the
    layer when this function is used.

Change-Id: If4fb67c246ef48a97f88914acfb8db3df734b133
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-03-13 17:47:43 +00:00
Rosen Zhelev
64175e7666 Merge 'Fix regression with swapchain_maintenance' into 'main'
See merge request mesa/vulkan-wsi-layer!144
2025-03-13 16:46:30 +00:00
Iason Paraskevopoulos
d8b094cf60 Merge 'Change the condition to add extensions to the layer' into 'main'
See merge request mesa/vulkan-wsi-layer!141
2025-03-12 10:25:28 +00:00
Dennis Tsiang
ce542a16a3 Change the condition to add extensions to the layer 2025-03-12 10:25:28 +00:00
Iason Paraskevopoulos
c2e4b32cbf Merge 'Fix issue with swapchain_time_domain not having virtual destructor' into 'main'
See merge request mesa/vulkan-wsi-layer!140
2025-03-10 16:12:27 +00:00
Normunds Rieksts
5885ad4836 Fix issue with swapchain_time_domain not having virtual destructor 2025-03-10 16:12:27 +00:00
Normunds Rieksts
ad47eb201f Fix regression with swapchain_maintenance
Fixes a regression with swapchain_maintenance1 extension after extension
refactor that did not communicate the changed presentation mode back to
the swapchain and improperly checked whether swapchain supports
presentation modes at swapchain creation time when this extension was
being used.

Change-Id: If06d3c72b44c8f3a06728b4c5c2455346c97ad63
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-03-07 17:51:20 +00:00
Rosen Zhelev
8f077c5c86 Merge 'Fix compiler warnings when building the layer' into 'main'
See merge request mesa/vulkan-wsi-layer!139
2025-02-25 13:05:17 +00:00
Normunds Rieksts
6ae7c7f452 Fix compiler warnings when building the layer
Fixes issues that generate warnings when building under specific
compiler versions.

Change-Id: I2a90429c7b56658be06ddd46fa8acfd660cafdd0
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-02-24 13:38:23 +00:00
Rosen Zhelev
3b48400fc4 Merge 'Introduce an extensions abstraction in the layer and expand VK_EXT_present_timing support' into 'main'
See merge request mesa/vulkan-wsi-layer!134
2025-02-19 16:35:41 +00:00
Normunds Rieksts
279896dda6 Merge branch 'main' of upstream into 'ext_refactor'
Merges upstream 'main' into 'ext_refactor' branch and fix merge
conflict.

Change-Id: I718ec54cb11b7f456d713728b976c61ea7811eb0
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-02-17 15:49:21 +00:00
Rosen Zhelev
2cb94e7047 Merge 'Fix surface_maintenance1 being documented as device extension' into 'main'
See merge request mesa/vulkan-wsi-layer!137
2025-02-13 13:40:03 +00:00
Normunds Rieksts
16d1f2d5cb Fix surface_maintenance1 being documented as device extension 2025-02-13 13:40:02 +00:00
Iason Paraskevopoulos
f649d0e8e3 Merge 'Document *_maintenance1 as supported by the layer' into 'main'
See merge request mesa/vulkan-wsi-layer!136
2025-02-13 10:50:27 +00:00
Normunds Rieksts
dc81527ecc Document *_maintenance1 as supported by the layer 2025-02-13 10:50:26 +00:00
Rosen Zhelev
68c6625fa5 Merge 'Remove guards on swapchain maintenance features' into 'main'
See merge request mesa/vulkan-wsi-layer!135
2025-02-12 15:59:35 +00:00
Normunds Rieksts
67fb41be2d Fix bugs with vkGetSwapchainTimeDomainPropertiesEXT entrypoint
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>
2025-02-11 16:48:00 +00:00
Normunds Rieksts
a92fa2a8d9 Add support for querying swapchain timing properties
Adds initial support to the headless and Wayland backends to query
swapchain timing properties. This patch also moves all present timing
backend specific code into its own file and refactors the private_data
code that is specific to present timing entrypoints into a more common
format.

Change-Id: I377197a6e14b3cbd968e35735d43060d19dfe5bc
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
2025-02-11 16:47:42 +00:00
Angeliki Agathi Tsintzira
03804c74fe Remove guards on swapchain maintenance features
The development of the swapchain maintenance features
has been finalized. As a result, the temporary guards
used during development have been removed, as they are
no longer necessary.

Change-Id: I768358d4b650ba13c84af1a65ff407f2c44b2283
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
2025-02-06 21:51:35 +00:00
Ginu Jacob
02ae04d08f Introduce an extensions abstraction in the layer
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>
2025-01-31 17:31:32 +00:00
Rosen Zhelev
6fef4eea25 Merge 'Fix the error caused in release builds due to unused variables' into 'main'
See merge request mesa/vulkan-wsi-layer!132
2025-01-31 12:58:34 +00:00
Ginu Jacob
a8f7bb40e1 Fix the error caused in release builds due to unused variables
The variables 'physicalDevice' and 'planeIndex' are unused in release
builds in the following APIs causing build error:
GetDisplayPlaneCapabilitiesKHR
GetDisplayPlaneSupportedDisplaysKHR
GetPhysicalDeviceDisplayPlanePropertiesKHR
GetPhysicalDeviceDisplayPropertiesKHR

This issue is fixed in this change.

Signed-off-by: Ginu Jacob <ginu.jacob@arm.com>
Change-Id: Id34f5162204249b5c1604a1eb4ba198b60393bee
2025-01-30 14:11:04 +00:00
Rosen Zhelev
17ec9b5411 Merge 'Add DRM support for ABGR210101010 format' into 'main'
See merge request mesa/vulkan-wsi-layer!131
2025-01-28 17:07:50 +00:00
Normunds Rieksts
2924e17553 Add DRM support for ABGR210101010 format 2025-01-28 17:07:50 +00:00
Rosen Zhelev
196af34b9f Merge 'Add -Wextra flag and fix warnings' into 'main'
See merge request mesa/vulkan-wsi-layer!130
2025-01-21 13:47:22 +00:00
Angeliki Agathi Tsintzira
5c3d3a9d7c Add -Wextra flag and fix warnings
With the addition of the -Wextra flag, additional compiler warnings
are enabled, which help identify potential issues in the code.
However, enabling -Wextra caused compilation failures due to the
-Werror flag, which treats warnings as errors. This commit enables
-Wextra and addresses all the warnings produced, ensuring the
code compiles successfully while maintaining higher code quality standards.

Change-Id: I0bbaead9b2b15530d2565a3dddf1ed676901269b
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
2025-01-20 10:19:25 +00:00
Rosen Zhelev
1771fed103 Merge 'Check for unsupported surfaces in the layer' into 'main'
See merge request mesa/vulkan-wsi-layer!129
2025-01-15 11:45:20 +00:00
Angeliki Agathi Tsintzira
1f37310208 Check for unsupported surfaces in the layer
Change-Id: I64eca7bf0f5f095c4dbc916c84377ae17350b3ec
Signed-off-by: Angeliki Agathi Tsintzira <angelikiagathi.tsintzira@arm.com>
2025-01-13 10:53:31 +00:00
Rosen Zhelev
8b18c35cb3 Merge 'Re-add assertion to check for valid synchronisation primitives' into 'main'
See merge request mesa/vulkan-wsi-layer!128
2024-12-02 16:23:05 +00:00
Rosen Zhelev
cb1a50cf7e Merge 'Fix the VK_KHR_DISPLAY implementation within the WSI Layer' into 'main'
See merge request mesa/vulkan-wsi-layer!127
2024-11-25 11:32:34 +00:00