Struct wayland_protocols::wp::drm_lease::v1::server::wp_drm_lease_device_v1::WpDrmLeaseDeviceV1
source · pub struct WpDrmLeaseDeviceV1 { /* private fields */ }
Expand description
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.
See also the Request enum for this interface.
Implementations§
source§impl WpDrmLeaseDeviceV1
impl WpDrmLeaseDeviceV1
sourcepub fn drm_fd(&self, fd: BorrowedFd<'_>)
pub fn drm_fd(&self, fd: BorrowedFd<'_>)
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.
sourcepub fn connector(&self, id: &WpDrmLeaseConnectorV1)
pub fn connector(&self, id: &WpDrmLeaseConnectorV1)
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.
sourcepub fn done(&self)
pub fn done(&self)
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.
sourcepub fn released(&self)
pub fn released(&self)
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.
Trait Implementations§
source§impl Borrow<ObjectId> for WpDrmLeaseDeviceV1
impl Borrow<ObjectId> for WpDrmLeaseDeviceV1
source§impl Clone for WpDrmLeaseDeviceV1
impl Clone for WpDrmLeaseDeviceV1
source§fn clone(&self) -> WpDrmLeaseDeviceV1
fn clone(&self) -> WpDrmLeaseDeviceV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WpDrmLeaseDeviceV1
impl Debug for WpDrmLeaseDeviceV1
source§impl Hash for WpDrmLeaseDeviceV1
impl Hash for WpDrmLeaseDeviceV1
source§impl PartialEq<Weak<WpDrmLeaseDeviceV1>> for WpDrmLeaseDeviceV1
impl PartialEq<Weak<WpDrmLeaseDeviceV1>> for WpDrmLeaseDeviceV1
source§impl PartialEq for WpDrmLeaseDeviceV1
impl PartialEq for WpDrmLeaseDeviceV1
source§impl Resource for WpDrmLeaseDeviceV1
impl Resource for WpDrmLeaseDeviceV1
source§fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>
source§fn handle(&self) -> &WeakHandle
fn handle(&self) -> &WeakHandle
source§fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>
source§fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>
source§fn parse_request(
conn: &DisplayHandle,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Request), DispatchError>
fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Request), DispatchError>
source§fn write_event<'a>(
&self,
conn: &DisplayHandle,
msg: Self::Event<'a>,
) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a>, ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>
source§fn is_alive(&self) -> bool
fn is_alive(&self) -> bool
impl Eq for WpDrmLeaseDeviceV1
Auto Trait Implementations§
impl Freeze for WpDrmLeaseDeviceV1
impl !RefUnwindSafe for WpDrmLeaseDeviceV1
impl Send for WpDrmLeaseDeviceV1
impl Sync for WpDrmLeaseDeviceV1
impl Unpin for WpDrmLeaseDeviceV1
impl !UnwindSafe for WpDrmLeaseDeviceV1
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.