xwayland: add support for wp_linux_drm_syncobj_v1

This protocol allows for explicit synchronization of GPU operations by
Wayland clients and the compositor. Xwayland can make use of this to
ensure any rendering it initiates has completed before the target image
is accessed by the compositor, without having to rely on kernel-level
implicit synchronization.

Furthermore, for X11 clients that also support explicit synchronization
using the mechanisms exposed in the DRI3 and Present extensions, this
Wayland protocol allows us to simply forward the timeline, acquire, and
release points directly to the compositor, ideally avoiding any
premature stalls in the presentation pipeline.

Signed-off-by: Erik Kurzinger <ekurzinger@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967>
This commit is contained in:
Erik Kurzinger
2023-08-15 15:32:47 -07:00
committed by Olivier Fourdan
parent 6f85ce4d4e
commit 87bf2cafcc
11 changed files with 323 additions and 12 deletions

View File

@@ -79,7 +79,10 @@ present_execute_wait(present_vblank_ptr vblank, uint64_t crtc_msc)
}
#ifdef DRI3
if (vblank->acquire_syncobj &&
/* Defer execution of explicitly synchronized copies.
* Flip synchronization is managed by the driver.
*/
if (!vblank->flip && vblank->acquire_syncobj &&
!vblank->acquire_syncobj->is_signaled(vblank->acquire_syncobj,
vblank->acquire_point)) {
vblank->efd = eventfd(0, EFD_CLOEXEC);