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).
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:
MetaDrmTimelineabstracts away the timeline primitive (drm syncobj) and manages the fds and sync points
MetaWaylandSyncobjSurfaceprovides the per-surface explicit sync handling
MetaWaylandDrmSyncobjSourcechecks 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.
MetaWaylandDrmSyncobjManageronly 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.