Xwayland delays Present frame submissions
I'm trying to fix the following issue:
- An X11 Vulkan client uses a
MAILBOX
present mode. - The Vulkan WSI sends a
PresentPixmap
request with a zerotarget-msc
. - Xwayland receives the request (in
present_wnmd_pixmap
), but doesn't forward it to the parent Wayland compositor. Instead, it waits for awl_surface.frame
callback. - When the
wl_surface.frame
callback is done, Xwayland attaches the new buffer and commits the surface.
Here is a visualization of the Xwayland events. The pink vertical lines are vblanks.
This behavior is an issue because it introduces a whole vblank worth of latency. The X11 client just wants to display a frame at the next vblank, but because Xwayland waits for wl_surface.frame`, it ends up being displayed two vblanks later.
Couldn't Xwayland submit the frame as soon as the client issues the PresentPixmap
request?
This would require some changes in the present_wnmd
code, but it seems doable.
Note, this issue is different from #971 (even if it's related). #971 is about using presentation-time to provide proper feedback to X11 clients. This issue is about the frame submission timing only.