DRM Lease Protocol Support

Wayland is a communication protocol that specifies the communication between a display server and its clients, as well as a C library implementation of that protocol.

The months-long effort for adding DRM lease support to Wayland via a new protocol has now been merged into Wayland Protocols as a new staging addition. The "drm_lease_v1" is principally motivated for improving the virtual reality head-mounted dispkay support under Wayland. 

Going back to 2017 was the work around DRM leases that was spearheaded by Keith Packard working under contract for Valve. That DRM leasing is about allowing the DRM (GPU) resources to be leased/sub-allocated to a client for its exclusive control. The primary use-case and why Valve funded the work is about allowing DRM leases for the VR head-mounted displays so they can have direct control over the respective output in a performant manner. 

While the DRM leases has worked out in the X.Org Server world, Wayland has lacked the necessary protocol for standardizing that hand-off and handling of the leases. There has been the merge request the past half-year for introducing the DRM lease (drm-lease) protocol to Wayland and finally this week it's been merged. 

This protocol is used by Wayland compositors which act as Direct Renderering Manager (DRM) masters to lease DRM resources to Wayland clients. The compositor will advertise one wp_drm_lease_device_v1 global for each DRM node. Some time after a client binds to the wp_drm_lease_device_v1 global, the compositor will send a drm_fd event followed by zero, one or more connector events. After all currently available connectors have been sent, the compositor will send a wp_drm_lease_device_v1.done event.

Currently the protocol is still marked for staging/testing but with enough testing/usage will hopefully be declared stable in short order.

As part of its efforts, the Wayland project also develops a reference implementation of a Wayland compositor called Weston.