Module Linux_dmabuf_unstable_v1_server.Zwp_linux_dmabuf_v1

Factory for creating dmabuf-based wl_buffers.

Following the interfaces from: https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt and the Linux DRM sub-system's AddFb2 ioctl.

This interface offers ways to create generic dmabuf-based wl_buffers.

Clients can use the get_surface_feedback request to get dmabuf feedback for a particular surface. If the client wants to retrieve feedback not tied to a surface, they can use the get_default_feedback request.

The following are required from clients:

The underlying graphics stack must ensure the following:

However, when the underlying graphics stack fails to deliver the promise, because of e.g. a device hot-unplug which raises internal errors, after the wl_buffer has been successfully created the compositor must not raise protocol errors to the client when dmabuf import later fails.

To create a wl_buffer from one or more dmabufs, a client creates a zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params request. All planes required by the intended format are added with the 'add' request. Finally, a 'create' or 'create_immed' request is issued, which has the following outcome depending on the import success.

The 'create' request,

For the 'create_immed' request,

For all DRM formats and unless specified in another protocol extension, pre-multiplied alpha is used for pixel values.

Unless specified otherwise in another protocol extension, implicit synchronization is used. In other words, compositors and clients must wait and signal fences implicitly passed via the DMA-BUF's reservation mechanism.

Disclaimer: This protocol extension has been marked stable. This copy is no longer used and only retained for backwards compatibility. The canonical version can be found in the stable/ directory.

type 'v t = ([ `Zwp_linux_dmabuf_v1 ], 'v, [ `Server ]) Wayland.Proxy.t

Version 1, 2

val format : [< `V1 | `V2 | `V3 | `V4 | `V5 ] t -> format:int32 -> unit

Supported buffer format.

This event advertises one buffer format that the server supports. All the supported formats are advertised once when the client binds to this interface. A roundtrip after binding guarantees that the client has received all supported formats.

For the definition of the format codes, see the zwp_linux_buffer_params_v1::create request.

Starting version 4, the format event is deprecated and must not be sent by compositors. Instead, use get_default_feedback or get_surface_feedback.

Version 3

val modifier : [< `V3 | `V4 | `V5 ] t -> format:int32 -> modifier_hi:int32 -> modifier_lo:int32 -> unit

Supported buffer format modifier.

This event advertises the formats that the server supports, along with the modifiers supported for each format. All the supported modifiers for all the supported formats are advertised once when the client binds to this interface. A roundtrip after binding guarantees that the client has received all supported format-modifier pairs.

For legacy support, DRM_FORMAT_MOD_INVALID (that is, modifier_hi == 0x00ffffff and modifier_lo == 0xffffffff) is allowed in this event. It indicates that the server can support the format with an implicit modifier. When a plane has DRM_FORMAT_MOD_INVALID as its modifier, it is as if no explicit modifier is specified. The effective modifier will be derived from the dmabuf.

A compositor that sends valid modifiers and DRM_FORMAT_MOD_INVALID for a given format supports both explicit modifiers and implicit modifiers.

For the definition of the format and modifier codes, see the zwp_linux_buffer_params_v1::create and zwp_linux_buffer_params_v1::add requests.

Starting version 4, the modifier event is deprecated and must not be sent by compositors. Instead, use get_default_feedback or get_surface_feedback.

Version 4, 5

Handlers

Note: Servers will always want to use v1.

class virtual +'a v1 : object ... end

Handler for a proxy with version >= 1.

class virtual +'a v2 : object ... end

Handler for a proxy with version >= 2.

class virtual +'a v3 : object ... end

Handler for a proxy with version >= 3.

class virtual +'a v4 : object ... end

Handler for a proxy with version >= 4.

class virtual +'a v5 : object ... end

Handler for a proxy with version >= 5.