Data Structures | Macros | Functions
The zwp_linux_dmabuf_v1 interface

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

Data Structures

struct  zwp_linux_dmabuf_v1_listener
 
struct  zwp_linux_dmabuf_v1_interface
 

Macros

#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION   1
 
#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION   3
 
#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION   1
 
#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION   1
 
#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION   1
 
#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION   3
 
#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION   1
 
#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION   1
 

Functions

static int zwp_linux_dmabuf_v1_add_listener (struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, const struct zwp_linux_dmabuf_v1_listener *listener, void *data)
 
static void zwp_linux_dmabuf_v1_set_user_data (struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, void *user_data)
 
static void * zwp_linux_dmabuf_v1_get_user_data (struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
 
static void zwp_linux_dmabuf_v1_destroy (struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
 Objects created through this interface, especially wl_buffers, will remain valid.
 
static struct zwp_linux_buffer_params_v1 * zwp_linux_dmabuf_v1_create_params (struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
 This temporary object is used to collect multiple dmabuf handles into a single batch to create a wl_buffer. More...
 
static void zwp_linux_dmabuf_v1_send_format (struct wl_resource *resource_, uint32_t format)
 Sends an format event to the client owning the resource. More...
 
static void zwp_linux_dmabuf_v1_send_modifier (struct wl_resource *resource_, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
 Sends an modifier event to the client owning the resource. More...
 

Detailed Description

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

This interface offers ways to create generic dmabuf-based wl_buffers. Immediately after a client binds to this interface, the set of supported formats and format modifiers is sent with 'format' and 'modifier' events.

The following are required from clients:

The underlying graphics stack must ensure the following:

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,

Warning! The protocol described in this file is experimental and backward incompatible changes may be made. Backward compatible changes may be added together with the corresponding interface version bump. Backward incompatible changes are done by bumping the version number in the protocol and interface names and resetting the interface version. Once the protocol is to be declared stable, the 'z' prefix and the version number in the protocol and interface names are removed and the interface version number is reset.

Function Documentation

◆ zwp_linux_dmabuf_v1_create_params()

static struct zwp_linux_buffer_params_v1* zwp_linux_dmabuf_v1_create_params ( struct zwp_linux_dmabuf_v1 *  zwp_linux_dmabuf_v1)
inlinestatic

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.

◆ zwp_linux_dmabuf_v1_send_format()

static void zwp_linux_dmabuf_v1_send_format ( struct wl_resource *  resource_,
uint32_t  format 
)
inlinestatic

Sends an format event to the client owning the resource.

Parameters
resource_The client's resource
formatDRM_FORMAT code

◆ zwp_linux_dmabuf_v1_send_modifier()

static void zwp_linux_dmabuf_v1_send_modifier ( struct wl_resource *  resource_,
uint32_t  format,
uint32_t  modifier_hi,
uint32_t  modifier_lo 
)
inlinestatic

Sends an modifier event to the client owning the resource.

Parameters
resource_The client's resource
formatDRM_FORMAT code
modifier_hihigh 32 bits of layout modifier
modifier_lolow 32 bits of layout modifier