From a98287a68178f91969a3b41903add0a037546447 Mon Sep 17 00:00:00 2001 From: Fufu Fang Date: Tue, 3 Jun 2025 13:05:16 +0100 Subject: [PATCH] Fix refresh duration comment for headless backend Signed-off-by: Fufu Fang Change-Id: I9e37ea162197dd8fbb75679663fa9b4b5e9e9694 --- wsi/headless/present_timing_handler.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wsi/headless/present_timing_handler.cpp b/wsi/headless/present_timing_handler.cpp index 61bf9f6..3152293 100644 --- a/wsi/headless/present_timing_handler.cpp +++ b/wsi/headless/present_timing_handler.cpp @@ -123,7 +123,12 @@ util::unique_ptr wsi_ext_present_timing_headles VkResult wsi_ext_present_timing_headless::get_swapchain_timing_properties( uint64_t &timing_properties_counter, VkSwapchainTimingPropertiesEXT &timing_properties) { - /* Use a reasonable approximate (5ms) that most devices should be able to match. */ + /* + * The headless backend does not have a limit on how fast the swapchain can be presented. + * We set the refresh duration to 1, because on some platforms, 0 is returned until after + * at least one image had been presented. On these platforms, 0 is used to indicate timing + * properties are currently unavailable. + */ const uint64_t fixed_refresh_duration_ns = 1; timing_properties_counter = 1; @@ -132,4 +137,4 @@ VkResult wsi_ext_present_timing_headless::get_swapchain_timing_properties( return VK_SUCCESS; } -#endif \ No newline at end of file +#endif