Skip to content

wp_drm_lease_v1¤

wayland.wp_drm_lease_v1 ¤

A drm lease

A DRM lease object is used to transfer the DRM file descriptor to the client and manage the lifetime of the lease.

Some time after the wp_drm_lease_v1 object is created, the compositor will reply with the lease request's result. If the lease request is granted, the compositor will send a lease_fd event. If the lease request is denied, the compositor will send a finished event without a lease_fd event.

Methods:

events

lease_fd ¤

lease_fd(leased_fd: fd) -> None

Shares the drm file descriptor

This event returns a file descriptor suitable for use with DRM-related ioctls. The client should use drmModeGetLease to enumerate the DRM objects which have been leased to them. The compositor guarantees it will not use the leased DRM objects itself until it sends the finished event. If the compositor cannot or will not grant a lease for the requested connectors, it will not send this event, instead sending the finished event.

The compositor will send this event at most once during this objects lifetime.

Parameters:

  • leased_fd ¤

    (fd) –

    Leased drm file descriptor

finished ¤

finished() -> None

Sent when the lease has been revoked

The compositor uses this event to either reject a lease request, or if it previously sent a lease_fd, to notify the client that the lease has been revoked. If the client requires a new lease, they should destroy this object and submit a new lease request. The compositor will send no further events for this object after sending the finish event. Compositors should revoke the lease when any of the leased resources become unavailable, namely when a hot-unplug occurs or when the compositor loses DRM master. Compositors may advertise the connector for leasing again, if the resource is available, by sending the connector event through the wp_drm_lease_device_v1 interface.

destroy ¤

destroy() -> None

Destroys the lease object

The client should send this to indicate that it no longer wishes to use this lease. The compositor should use drmModeRevokeLease on the appropriate file descriptor, if necessary.

Upon destruction, the compositor should advertise the connector for leasing again by sending the connector event through the wp_drm_lease_device_v1 interface.

on_lease_fd ¤

on_lease_fd(leased_fd: fd) -> None

Shares the drm file descriptor.

Override to handle wayland.wp_drm_lease_v1.events.lease_fd.

on_finished ¤

on_finished() -> None

Sent when the lease has been revoked.

Override to handle wayland.wp_drm_lease_v1.events.finished.