Skip to content

wp_drm_lease_device_v1¤

wayland.wp_drm_lease_device_v1 ¤

Lease device

This protocol is used by Wayland compositors which act as Direct Rendering 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.

When the list of connectors available for lease changes the compositor will send wp_drm_lease_device_v1.connector events for added connectors and wp_drm_lease_connector_v1.withdrawn events for removed connectors, followed by a wp_drm_lease_device_v1.done event.

The compositor will indicate when a device is gone by removing the global via a wl_registry.global_remove event. Upon receiving this event, the client should destroy any matching wp_drm_lease_device_v1 object.

To destroy a wp_drm_lease_device_v1 object, the client must first issue a release request. Upon receiving this request, the compositor will immediately send a released event and destroy the object. The client must continue to process and discard drm_fd and connector events until it receives the released event. Upon receiving the released event, the client can safely cleanup any client-side resources.

Warning! The protocol described in this file is currently in the testing phase. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes can only be done by creating a new major version of the extension.

Methods:

events

drm_fd ¤

drm_fd(fd: fd) -> None

Open a non-master fd for this drm node

The compositor will send this event when the wp_drm_lease_device_v1 global is bound, although there are no guarantees as to how long this takes - the compositor might need to wait until regaining DRM master. The included fd is a non-master DRM file descriptor opened for this device and the compositor must not authenticate it. The purpose of this event is to give the client the ability to query DRM and discover information which may help them pick the appropriate DRM device or select the appropriate connectors therein.

Parameters:

  • fd ¤

    (fd) –

    Drm file descriptor

connector ¤

connector(id: wp_drm_lease_connector_v1) -> None

Advertise connectors available for leases

The compositor will use this event to advertise connectors available for lease by clients. This object may be passed into a lease request to indicate the client would like to lease that connector, see wp_drm_lease_request_v1.request_connector for details. While the compositor will make a best effort to not send disconnected connectors, no guarantees can be made.

The compositor must send the drm_fd event before sending connectors. After the drm_fd event it will send all available connectors but may send additional connectors at any time.

done ¤

done() -> None

Signals grouping of connectors

The compositor will send this event to indicate that it has sent all currently available connectors after the client binds to the global or when it updates the connector list, for example on hotplug, drm master change or when a leased connector becomes available again. It will similarly send this event to group wp_drm_lease_connector_v1.withdrawn events of connectors of this device.

released ¤

released() -> None

The compositor has finished using the device

This event is sent in response to the release request and indicates that the compositor is done sending connector events. The compositor will destroy this object immediately after sending the event and it will become invalid. The client should release any resources associated with this device after receiving this event.

create_lease_request ¤

create_lease_request() -> wp_drm_lease_request_v1

Create a lease request object

Creates a lease request object.

See the documentation for wp_drm_lease_request_v1 for details.

Returns:

release ¤

release() -> None

Release this object

Indicates the client no longer wishes to use this object. In response the compositor will immediately send the released event and destroy this object. It can however not guarantee that the client won't receive connector events before the released event. The client must not send any requests after this one, doing so will raise a wl_display error. Existing connectors, lease request and leases will not be affected.

on_drm_fd ¤

on_drm_fd(fd: fd) -> None

Open a non-master fd for this drm node.

Override to handle wayland.wp_drm_lease_device_v1.events.drm_fd.

on_connector ¤

on_connector(id: wp_drm_lease_connector_v1) -> None

Advertise connectors available for leases.

Override to handle wayland.wp_drm_lease_device_v1.events.connector.

on_done ¤

on_done() -> None

Signals grouping of connectors.

Override to handle wayland.wp_drm_lease_device_v1.events.done.

on_released ¤

on_released() -> None

The compositor has finished using the device.

Override to handle wayland.wp_drm_lease_device_v1.events.released.