Draft: Implement linux-drm-syncobj-v1

Austin Shafer requested to merge ashafer/mutter:main into main

This implements the linux-drm-syncobj-v1 wayland protocol to handle the global migration to explicit sync. At a high level this hooks up the fds passed through the explicit sync wayland protocol to the wayland transaction infrastructure from !1880 (merged).

Protocol: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4262

Design

This protocol creates per-surface synchronization objects which can have specific points in a timeline attached to them which must be signaled before using the buffer. This is handled by a couple components:

  • MetaDrmTimeline abstracts away the timeline primitive (drm syncobj) and manages the fds and sync points
  • MetaWaylandSyncobjSurface provides the per-surface explicit sync handling
  • MetaWaylandDrmSyncobjSource checks to make sure the sync fd for the acquire point set is readable. This controls if the transaction is allowed to take effect.

The general flow is that the client specifies a timeline and a sync point, we import all of that and create an fd for it, and finally we can check that the sync fd is readable before applying the surface transaction and using the buffer.

Remaining problems

  • MetaWaylandDrmSyncobjManager only has one DRM fd for now, eventually we probably want multi-GPU support for this? It might make sense to land the initial explicit sync patches without this and add it as a follow up?
  • This currently records the release points but does not actually signal the release timeline at any point. This definitely needs to be implemented before this can land.
Edited by Austin Shafer

Merge request reports