---
name: "wayland_server_zwp_linux_surface_synchronization_v1_t"
section: "3"
platform: "linux"
package: "waylandpp-dev"
version: "1.0.0-6+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/wayland_server_zwp_linux_surface_synchronization_v1_t"
---

# wayland\_server\_zwp\_linux\_surface\_synchronization\_v1\_t(3)

per-surface explicit synchronization support

## NAME

wayland::server::zwp\_linux\_surface\_synchronization\_v1\_t - per-surface explicit synchronization support

## SYNOPSIS

`#include <wayland-server-protocol-unstable.hpp>`

Inherits wayland::server::resource\_t.

### Public Member Functions

std::function\< void()\> & **on\_destroy** ()\
 destroy synchronization object  std::function\< void(int)\> & **on\_set\_acquire\_fence** ()\
 set the acquire fence  std::function\< void(**zwp\_linux\_buffer\_release\_v1\_t**)\> & **on\_get\_release** ()\
 release fence for last-attached buffer  void **post\_invalid\_fence** (std::string const &msg)\
 Post error: the fence specified by the client could not be imported.  void **post\_duplicate\_fence** (std::string const &msg)\
 Post error: multiple fences added for a single surface commit.  void **post\_duplicate\_release** (std::string const &msg)\
 Post error: multiple releases added for a single surface commit.  void **post\_no\_surface** (std::string const &msg)\
 Post error: the associated wl\_surface was destroyed.  void **post\_unsupported\_buffer** (std::string const &msg)\
 Post error: the buffer does not support explicit synchronization.  void **post\_no\_buffer** (std::string const &msg)\
 Post error: no buffer was attached.  bool **proxy\_has\_object** () const\
 Check whether this wrapper actually wraps an object.  void **post\_no\_memory** () const\
 uint32\_t **get\_id** () const\
 client\_t **get\_client** () const\
 unsigned int **get\_version** () const\
 std::string **get\_class** ()\

## Detailed 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.

Definition at line **2455** of file **wayland-server-protocol-unstable.hpp**.

## Member Function Documentation

### std::string wayland::server::resource\_t::get\_class ()` [inherited]`

Retrieve the interface name (class) of a resource object.

**Returns**

Interface name of the resource object.

### client\_t wayland::server::resource\_t::get\_client () const` [inherited]`

Get the associated client

**Returns**

the client that owns the resource.

### uint32\_t wayland::server::resource\_t::get\_id () const` [inherited]`

Get the internal ID of the resource

**Returns**

the internal ID of the resource

### unsigned int wayland::server::resource\_t::get\_version () const` [inherited]`

Get interface version

**Returns**

Interface version this resource has been constructed with.

### std::function\< void()\> & zwp\_linux\_surface\_synchronization\_v1\_t::on\_destroy ()

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.

Definition at line **5250** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void(zwp\_linux\_buffer\_release\_v1\_t)\> & zwp\_linux\_surface\_synchronization\_v1\_t::on\_get\_release ()

release fence for last-attached buffer

**Parameters**

*release* new zwp\_linux\_buffer\_release\_v1 object

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.

Definition at line **5262** of file **wayland-server-protocol-unstable.cpp**.

### std::function\< void(int)\> & zwp\_linux\_surface\_synchronization\_v1\_t::on\_set\_acquire\_fence ()

set the acquire fence

**Parameters**

*fd* acquire fence fd

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.

Definition at line **5256** of file **wayland-server-protocol-unstable.cpp**.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_duplicate\_fence (std::string const & msg)

Post error: multiple fences added for a single surface commit.

Definition at line **5273** of file **wayland-server-protocol-unstable.cpp**.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_duplicate\_release (std::string const & msg)

Post error: multiple releases added for a single surface commit.

Definition at line **5278** of file **wayland-server-protocol-unstable.cpp**.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_invalid\_fence (std::string const & msg)

Post error: the fence specified by the client could not be imported.

Definition at line **5268** of file **wayland-server-protocol-unstable.cpp**.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_no\_buffer (std::string const & msg)

Post error: no buffer was attached.

Definition at line **5293** of file **wayland-server-protocol-unstable.cpp**.

### void wayland::server::resource\_t::post\_no\_memory () const` [inherited]`

Post 'not enough memory' error to the client

If the compositor has not enough memory to fulfill a certail request of the client, this function can be called to notify the client of this circumstance.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_no\_surface (std::string const & msg)

Post error: the associated wl\_surface was destroyed.

Definition at line **5283** of file **wayland-server-protocol-unstable.cpp**.

### void zwp\_linux\_surface\_synchronization\_v1\_t::post\_unsupported\_buffer (std::string const & msg)

Post error: the buffer does not support explicit synchronization.

Definition at line **5288** of file **wayland-server-protocol-unstable.cpp**.

### bool wayland::server::resource\_t::proxy\_has\_object () const` [inherited]`

Check whether this wrapper actually wraps an object.

**Returns**

true if there is an underlying object, false if this wrapper is empty

## Author

Generated automatically by Doxygen for Wayland++ from the source code.
