mesa/src
Mario Kleiner d7b23e9f3a wsi/display: Deal with vblank-less systems for VK_EXT_present_timing.
Some hw + kms driver combos do not support vblank related functions
at all, ie. no drmCrtc[Get/Queue]Sequence() ioctl, no crtc sequence
events, no vblank of pageflip completion reported in pageflip events.

Most notable under the present_timing supported Vulkan drivers is
Asahi Linux on Apple Silicon Macs, with no such support: Only pageflip
events with a valid flip timestamp are supported.

To deal with this, we detect lack of vblank support and instead
use the current "vrr timing" path, which doesn't use vblanks, but
absolute time and timed waits. This also required a slight restructuring
of the setup logic.

Also fix semantics of requested relative timed presents via
VK_PRESENT_TIMING_INFO_PRESENT_AT_RELATIVE_TIME_BIT_EXT. The
spec states that the given target time should be relative to
the most recently presented image on a swapchain, and that if
no such image was presented yet (during the first present on
a swapchain), the relative target present time should be ignored.
Take care of this by tracking vblank count and time of the most
recent completed swapchain present separately from the most recent
known vblank count and time of the connector. Choose the swapchain
most recent present vblank data as baseline for relative timed
presents, to optimally implement spec semantics, but the connectors
vblank data for absolute timed presents to minimize rounding errors
and drift when converting between time and vblank cycle counts.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Fixes: 5e2814c8a4 ("wsi/display: Implement present timing on KHR_display.")
Reviewed-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41168>
2026-06-05 10:21:51 +00:00
..
amd ac/parse_ib: initialize data variables to 0 2026-06-05 09:16:57 +00:00
android_stub android_stub: purge unused log utils 2026-05-01 20:23:23 +00:00
asahi hk: Add heap_memory_percent driconf support 2026-06-01 17:32:50 +00:00
broadcom v3dv: enable lowered shaderFloat16/Int16/Int8 + VK_KHR_shader_float16_int8 2026-06-04 13:29:39 +00:00
c11
compiler vtn/opencl: fix edge case behavior for tanpi 2026-06-04 21:39:02 +00:00
drm-shim drm-shim: Include the hex of the driver ioctl for unimplemented ioctls. 2026-06-04 20:17:34 +00:00
egl egl/gbm: Eliminate max_age local variable 2026-05-29 16:38:01 +00:00
etnaviv etnaviv/ml: derive stride-2 destriding offsets from padding 2026-06-02 08:13:11 +00:00
freedreno tu/kgsl: initialize dump bo state in kgsl_bo_init sooner 2026-06-05 09:39:36 +00:00
gallium radeonsi: use aux context locks in si_destroy_screen 2026-06-05 09:16:57 +00:00
gbm gbm: Replace VER_MIN with common MIN2 2026-04-30 13:00:03 +00:00
getopt
gfxstream gfxstream/platform: add missing inc_include to platform_virtgpu build 2026-06-03 21:35:50 +00:00
glx glx/windows: Drop static from driwindowsCreateScreen() 2026-05-18 13:33:35 +00:00
gtest
imagination pvr: Fix load-op shader when loading from a 2d image view of a 3d image 2026-06-03 11:12:42 +00:00
imgui imgui: update copy and port all tools using it 2026-04-30 10:59:45 +00:00
intel anv: declare common VK drirc options using the helper 2026-06-05 09:14:45 +02:00
kosmickrisp kk: Advertise additional tessellation dynamic state 2026-06-04 12:29:14 +00:00
loader loader: check if the kernel driver is amdgpu 2026-05-27 10:19:50 +00:00
mesa mesa/st: run the lower_opcodes pass for draw shaders 2026-06-04 19:29:57 +00:00
microsoft vulkan: implement VK_EXT_debug_marker 2026-06-01 15:31:38 +00:00
nouveau nak: Simplify our SmallVec usage 2026-06-03 18:50:43 +00:00
panfrost panvk: report DRM format modifiers through List2EXT 2026-06-03 14:21:00 +00:00
poly poly: Fix range used for index unroll bounds checks 2026-05-26 10:39:00 +00:00
tool pps: Re-emit time clock_sync more regularly 2026-05-06 21:37:15 +00:00
util util/drirc_gen: add a function to declare commmon VK options 2026-06-05 09:14:45 +02:00
virtio venus: let resource_create_blob wait for mem alloc 2026-06-04 16:33:02 +00:00
vulkan wsi/display: Deal with vblank-less systems for VK_EXT_present_timing. 2026-06-05 10:21:51 +00:00
x11 meson: Add support for buidling zink + Turnip/KGSL 2026-03-31 15:00:29 +00:00
.clang-format intel: add Jay 2026-04-10 18:21:21 +00:00
meson.build gallium/dril: Don't use gbm if there is no gbm configured 2026-02-17 08:24:02 +00:00