Documentation for <wlr/types/wlr_drm_lease_v1.h>

Back to index

Table of contents

struct wlr_drm_lease_connector_v1

struct wlr_drm_lease_connector_v1 {
	struct wl_list resources; // wl_resource_get_link()
	
	struct wlr_output *output;
	struct wlr_drm_lease_device_v1 *device;
	/** NULL if no client is currently leasing this connector */
	struct wlr_drm_lease_v1 *active_lease;
	
	struct wl_listener destroy;
	
	struct wl_list link; // wlr_drm_lease_device_v1.connectors
};

struct wlr_drm_lease_device_v1

struct wlr_drm_lease_device_v1 {
	struct wl_list resources;
	struct wl_global *global;
	
	struct wlr_drm_lease_v1_manager *manager;
	struct wlr_backend *backend;
	
	struct wl_list connectors; // wlr_drm_lease_connector_v1.link
	struct wl_list leases; // wlr_drm_lease_v1.link
	struct wl_list requests; // wlr_drm_lease_request_v1.link
	struct wl_list link; // wlr_drm_lease_v1_manager.devices
	
	struct wl_listener backend_destroy;
	
	void *data;
};

struct wlr_drm_lease_request_v1

struct wlr_drm_lease_request_v1 {
	struct wl_resource *resource;
	
	struct wlr_drm_lease_device_v1 *device;
	
	struct wlr_drm_lease_connector_v1 **connectors;
	size_t n_connectors;
	
	struct wl_resource *lease_resource;
	
	bool invalid;
	
	struct wl_list link; // wlr_drm_lease_device_v1.requests
};

wlr_drm_lease_request_v1_grant()

struct wlr_drm_lease_v1 *wlr_drm_lease_request_v1_grant(​struct wlr_drm_lease_request_v1 *request);

Grants a client's lease request. The lease device will then provision the DRM lease and transfer the file descriptor to the client. After calling this, each struct wlr_output leased is destroyed, and will be re-issued through wlr_backend.events.new_outputs when the lease is revoked.

This will return NULL without leasing any resources if the lease is invalid; this can happen for example if two clients request the same resources and an attempt to grant both leases is made.

wlr_drm_lease_request_v1_reject()

void wlr_drm_lease_request_v1_reject(​struct wlr_drm_lease_request_v1 *request);

Rejects a client's lease request. The output will still be available to lease until withdrawn by the compositor.

struct wlr_drm_lease_v1

struct wlr_drm_lease_v1 {
	struct wl_resource *resource;
	struct wlr_drm_lease *drm_lease;
	
	struct wlr_drm_lease_device_v1 *device;
	
	struct wlr_drm_lease_connector_v1 **connectors;
	size_t n_connectors;
	
	struct wl_list link; // wlr_drm_lease_device_v1.leases
	
	struct wl_listener destroy;
	
	void *data;
};

struct wlr_drm_lease_v1_manager

struct wlr_drm_lease_v1_manager {
	struct wl_list devices; // wlr_drm_lease_device_v1.link
	
	struct wl_display *display;
	struct wl_listener display_destroy;
	
	struct {
		/**
		 * Upon receiving this signal, call
		 * wlr_drm_lease_device_v1_grant_lease_request() to grant a lease of the
		 * requested DRM resources, or
		 * wlr_drm_lease_device_v1_reject_lease_request() to reject the request.
		 */
		struct wl_signal request;
	} events;
};

wlr_drm_lease_v1_manager_create()

struct wlr_drm_lease_v1_manager *wlr_drm_lease_v1_manager_create(​struct wl_display *display, struct wlr_backend *backend);

Creates a DRM lease manager. A DRM lease device will be created for each DRM backend supplied in case of a struct wlr_multi_backend.

Returns NULL if no DRM backend is supplied.

wlr_drm_lease_v1_manager_offer_output()

bool wlr_drm_lease_v1_manager_offer_output(​struct wlr_drm_lease_v1_manager *manager, struct wlr_output *output);

wlr_drm_lease_v1_manager_withdraw_output()

void wlr_drm_lease_v1_manager_withdraw_output(​struct wlr_drm_lease_v1_manager *manager, struct wlr_output *output);

Withdraws a previously offered output for lease. If the output is leased to a client, a finished event will be send and the lease will be terminated.

wlr_drm_lease_v1_revoke()

void wlr_drm_lease_v1_revoke(​struct wlr_drm_lease_v1 *lease);

Revokes a client's lease request. The output will still be available to lease until withdrawn by the compositor.