Module Linux_dmabuf_unstable_v1_client.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, [ `Client ]) Wayland.Proxy.t

Version 1, 2

val create_params : [< `V1 | `V2 | `V3 | `V4 | `V5 ] as 'a t -> [[ `Zwp_linux_buffer_params_v1 ], 'b, [ `Client ]] Wayland.Proxy.Handler.t -> ([ `Zwp_linux_buffer_params_v1 ], 'c, [ `Client ]) Wayland.Proxy.t

Create a temporary object for buffer parameters.

This temporary object is used to collect multiple dmabuf handles into a single batch to create a wl_buffer. It can only be used once and should be destroyed after a 'created' or 'failed' event has been received.

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

Unbind the factory.

Objects created through this interface, especially wl_buffers, will remain valid.

Version 3

Version 4, 5

val get_surface_feedback : [< `V4 | `V5 ] as 'a t -> [[ `Zwp_linux_dmabuf_feedback_v1 ], 'b, [ `Client ]] Wayland.Proxy.Handler.t -> surface:([ `Wl_surface ], 'c, [ `Client ]) Wayland.Proxy.t -> ([ `Zwp_linux_dmabuf_feedback_v1 ], 'd, [ `Client ]) Wayland.Proxy.t

Get feedback for a surface.

This request creates a new wp_linux_dmabuf_feedback object for the specified wl_surface. This object will deliver feedback about dmabuf parameters to use for buffers attached to this surface.

If the surface is destroyed before the wp_linux_dmabuf_feedback object, the feedback object becomes inert.

val get_default_feedback : [< `V4 | `V5 ] as 'a t -> [[ `Zwp_linux_dmabuf_feedback_v1 ], 'b, [ `Client ]] Wayland.Proxy.Handler.t -> ([ `Zwp_linux_dmabuf_feedback_v1 ], 'c, [ `Client ]) Wayland.Proxy.t

Get default feedback.

This request creates a new wp_linux_dmabuf_feedback object not bound to a particular surface. This object will deliver feedback about dmabuf parameters to use if the client doesn't support per-surface feedback (see get_surface_feedback).

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.