Struct wayland_protocols::wp::linux_explicit_synchronization::zv1::client::zwp_linux_surface_synchronization_v1::ZwpLinuxSurfaceSynchronizationV1
source · pub struct ZwpLinuxSurfaceSynchronizationV1 {
id: ObjectId,
version: u32,
data: Option<Arc<dyn ObjectData>>,
backend: WeakBackend,
}
Expand description
per-surface explicit synchronization support
This object implements per-surface explicit synchronization.
Synchronization refers to co-ordination of pipelined operations performed on buffers. Most GPU clients will schedule an asynchronous operation to render to the buffer, then immediately send the buffer to the compositor to be attached to a surface.
In implicit synchronization, ensuring that the rendering operation is complete before the compositor displays the buffer is an implementation detail handled by either the kernel or userspace graphics driver.
By contrast, in explicit synchronization, dma_fence objects mark when the asynchronous operations are complete. When submitting a buffer, the client provides an acquire fence which will be waited on before the compositor accesses the buffer. The Wayland server, through a zwp_linux_buffer_release_v1 object, will inform the client with an event which may be accompanied by a release fence, when the compositor will no longer access the buffer contents due to the specific commit that requested the release event.
Each surface can be associated with only one object of this interface at any time.
In version 1 of this interface, explicit synchronization is only guaranteed to be supported for buffers created with any version of the wp_linux_dmabuf buffer factory. Version 2 additionally guarantees explicit synchronization support for opaque EGL buffers, which is a type of platform specific buffers described in the EGL_WL_bind_wayland_display extension. Compositors are free to support explicit synchronization for additional buffer types.
This interface has no events.
Fields§
§id: ObjectId
§version: u32
§data: Option<Arc<dyn ObjectData>>
§backend: WeakBackend
Implementations§
source§impl ZwpLinuxSurfaceSynchronizationV1
impl ZwpLinuxSurfaceSynchronizationV1
sourcepub fn destroy(&self)
pub fn destroy(&self)
destroy synchronization object
Destroy this explicit synchronization object.
Any fence set by this object with set_acquire_fence since the last commit will be discarded by the server. Any fences set by this object before the last commit are not affected.
zwp_linux_buffer_release_v1 objects created by this object are not affected by this request.
sourcepub fn set_acquire_fence(&self, fd: BorrowedFd<'_>)
pub fn set_acquire_fence(&self, fd: BorrowedFd<'_>)
set the acquire fence
Set the acquire fence that must be signaled before the compositor may sample from the buffer attached with wl_surface.attach. The fence is a dma_fence kernel object.
The acquire fence is double-buffered state, and will be applied on the next wl_surface.commit request for the associated surface. Thus, it applies only to the buffer that is attached to the surface at commit time.
If the provided fd is not a valid dma_fence fd, then an INVALID_FENCE error is raised.
If a fence has already been attached during the same commit cycle, a DUPLICATE_FENCE error is raised.
If the associated wl_surface was destroyed, a NO_SURFACE error is raised.
If at surface commit time the attached buffer does not support explicit synchronization, an UNSUPPORTED_BUFFER error is raised.
If at surface commit time there is no buffer attached, a NO_BUFFER error is raised.
sourcepub fn get_release<U: Send + Sync + 'static, D: Dispatch<ZwpLinuxBufferReleaseV1, U> + 'static>(
&self,
qh: &QueueHandle<D>,
udata: U,
) -> ZwpLinuxBufferReleaseV1
pub fn get_release<U: Send + Sync + 'static, D: Dispatch<ZwpLinuxBufferReleaseV1, U> + 'static>( &self, qh: &QueueHandle<D>, udata: U, ) -> ZwpLinuxBufferReleaseV1
release fence for last-attached buffer
Create a listener for the release of the buffer attached by the client with wl_surface.attach. See zwp_linux_buffer_release_v1 documentation for more information.
The release object is double-buffered state, and will be associated with the buffer that is attached to the surface at wl_surface.commit time.
If a zwp_linux_buffer_release_v1 object has already been requested for the surface in the same commit cycle, a DUPLICATE_RELEASE error is raised.
If the associated wl_surface was destroyed, a NO_SURFACE error is raised.
If at surface commit time there is no buffer attached, a NO_BUFFER error is raised.
Trait Implementations§
source§impl Clone for ZwpLinuxSurfaceSynchronizationV1
impl Clone for ZwpLinuxSurfaceSynchronizationV1
source§fn clone(&self) -> ZwpLinuxSurfaceSynchronizationV1
fn clone(&self) -> ZwpLinuxSurfaceSynchronizationV1
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq<Weak<ZwpLinuxSurfaceSynchronizationV1>> for ZwpLinuxSurfaceSynchronizationV1
impl PartialEq<Weak<ZwpLinuxSurfaceSynchronizationV1>> for ZwpLinuxSurfaceSynchronizationV1
source§impl PartialEq for ZwpLinuxSurfaceSynchronizationV1
impl PartialEq for ZwpLinuxSurfaceSynchronizationV1
source§fn eq(&self, other: &ZwpLinuxSurfaceSynchronizationV1) -> bool
fn eq(&self, other: &ZwpLinuxSurfaceSynchronizationV1) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Proxy for ZwpLinuxSurfaceSynchronizationV1
impl Proxy for ZwpLinuxSurfaceSynchronizationV1
source§fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
fn data<U: Send + Sync + 'static>(&self) -> Option<&U>
source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
source§fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
fn send_request(&self, req: Self::Request<'_>) -> Result<(), InvalidId>
source§fn send_constructor<I: Proxy>(
&self,
req: Self::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>
fn send_constructor<I: Proxy>( &self, req: Self::Request<'_>, data: Arc<dyn ObjectData>, ) -> Result<I, InvalidId>
source§fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>
source§fn inert(backend: WeakBackend) -> Self
fn inert(backend: WeakBackend) -> Self
source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Event), DispatchError>
source§fn write_request<'a>(
&self,
conn: &Connection,
msg: Self::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: Self::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for ZwpLinuxSurfaceSynchronizationV1
Auto Trait Implementations§
impl Freeze for ZwpLinuxSurfaceSynchronizationV1
impl !RefUnwindSafe for ZwpLinuxSurfaceSynchronizationV1
impl Send for ZwpLinuxSurfaceSynchronizationV1
impl Sync for ZwpLinuxSurfaceSynchronizationV1
impl Unpin for ZwpLinuxSurfaceSynchronizationV1
impl !UnwindSafe for ZwpLinuxSurfaceSynchronizationV1
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§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
.source§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
.source§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.source§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.