[PATCH v7] unstable/drm-lease: DRM lease protocol support

Philipp Zabel p.zabel at pengutronix.de
Fri Oct 18 15:06:55 UTC 2019


On Fri, 2019-10-18 at 10:43 -0400, Drew DeVault wrote:
> Regarding hotplugging, the Wayland compositor is probably keeping track
> of hotplugs itself and withdrawing/offering connectors as appropriate.
>
> Also, when the lease is issued, the compositor withdraws that connector.
> For the client, upon hotplug I imagine the DRM asks start to fail, and
> it handles that accordingly (presumably it'll close the lease, if the
> compositor hasn't already, and wait for it to come back, or just exit).

Right. Whether it waits or quits should be the decision of the client,
and I'd like there to be a good way to "wait for it to come back" (or to
appear, initially).
If the compositor sends a new zwp_drm_lease_manager_v1.connector event
after the HMD connector becomes leasable (again), that should be good
enough.

[...]
> > So Wayland display servers should make sure they have master themselves
> > before sending a supposedly non-master DRM fd to anyone else. I wonder
> > if the Wayland protocol extension needs to consider that the compositor
> > might not be able to send any fd soon. Being able to defer sending the
> > fd should probably be mentioned in the protocol spec, so that clients
> > do not expect a simple roundtrip to be enough to ensure the fd has
> > arrived.
> 
> When you VT switch away, the Wayland compositor is no longer necessarily
> able to lease those displays anyway - it's not the master anymore. So it
> should withdraw them, and in case of a race it'll reject the lease
> request.

Right. On VT switch away, revoking all leases and disabling those
connectors is the only sensible thing the compositor can do.

However, that is completely independent from the sending the drm_fd
event. The spec currently says: "The compositor will send this event
when the zwp_drm_lease_manager_v1 global is bound.". But if the client
binds the global while the compositor doesn't have DRM master privilege,
and if it is not possible to securely produce a non-master drm_fd to
send at this time, maybe the sentence should be changed to "The
compositor will send this event some time after the
zwp_drm_lease_manager_v1 global is bound."?

regards
Philipp



More information about the dri-devel mailing list