feat(vk_native): opt-in Linux direct-scanout present path (ST-5539, #755)#756
Draft
dfattal wants to merge 1 commit into
Draft
feat(vk_native): opt-in Linux direct-scanout present path (ST-5539, #755)#756dfattal wants to merge 1 commit into
dfattal wants to merge 1 commit into
Conversation
Reclaims the ~44% Xorg+gnome-shell presentation cost measured in ST-5539 by
acquiring the 3D-panel connector as a VkDisplayKHR (VK_EXT_acquire_xlib_display)
and scanning out to it directly, bypassing the desktop compositor.
Re-scope: on Linux the Leia plug-in weaves into a caller-provided target and
does NOT present (contract §3.3) — comp_vk_native owns the swapchain/present.
So this is a runtime-only change; no plug-in or srSDK change.
- comp_vk_native_window_direct.{c,h}: RandR output -> VkDisplayKHR -> acquire ->
display-plane surface (Monado comp_window_direct_randr model).
- Activate the dormant aux-layer VK_KHR_display helpers: VK_USE_PLATFORM_DISPLAY_KHR
and VK_USE_PLATFORM_XLIB_XRANDR_EXT were in xrt_config_vulkan.h.cmake_in but
never set() — new XRT_HAVE_XLIB_XRANDR (pkg x11+xrandr) drives them.
- null_compositor: request VK_KHR_display / direct_mode / acquire_xlib as OPTIONAL
instance exts -> graceful XCB fallback when absent.
- comp_vk_native_target: create_from_surface() consumes a pre-made (borrowed)
VkSurfaceKHR; external_surface guards teardown.
- compositor: fullscreen hosted path tries direct when DXR_LINUX_DIRECT_SCANOUT=1,
falls back silently to XCB on any failure; default path untouched.
Fullscreen-only (model-viewer, gauss). Compile-checked via Linux CI; needs
on-hardware validation on P1 + DS1 (Suki). Wayland/DRM-lease deferred.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes the presentation-overhead half of ST-5539 (sw-runtime-linux). Fixes #755.
What
Opt-in, fullscreen-only direct-scanout present path for the Linux Vulkan compositor: acquire the 3D-panel connector as a
VkDisplayKHR(VK_EXT_acquire_xlib_displayon Xorg) and scan out to it directly, bypassing Xorg + gnome-shell — the ~44% presentation cost Suki measured.Why it's runtime-only (re-scope from the report)
The report attributed the present to the Leia plug-in, but on Linux the plug-in weaves into a caller-provided target and does not own a swapchain or present (contract §3.3).
comp_vk_nativeowns the swapchain + present. No plug-in / srSDK change.Changes
comp_vk_native_window_direct.{c,h}— RandR output →VkDisplayKHR→ acquire → display-plane surface (Monadocomp_window_direct_randrmodel).VK_KHR_displaypath —VK_USE_PLATFORM_DISPLAY_KHR/_XLIB_XRANDR_EXTwere inxrt_config_vulkan.h.cmake_inbut neverset(); newXRT_HAVE_XLIB_XRANDR(pkgx11+xrandr) drives them. This is why the report saw "VK_KHR_display referenced but not wired."null_compositor— requests the display exts as optional → graceful XCB fallback.comp_vk_native_target—create_from_surface()consumes a pre-made (borrowed) surface;external_surfaceguards teardown.DXR_LINUX_DIRECT_SCANOUT=1, silently falls back to XCB on any failure. Default path untouched.Testing
libx11-dev+libxrandr-dev→XRT_HAVE_XLIB_XRANDRon).DXR_LINUX_DIRECT_SCANOUT=1+ a fullscreen app (model-viewer / gauss), confirm the connector is scanned out directly andintel_gpu_topshows the Xorg share drop.Notes
VK_EXT_acquire_drm_display) documented as the future path, not built here.🤖 Generated with Claude Code