linux-dmabuf-v1: implement v4

Implement a basic version of linux-dmabuf-unstable-v1 version 4.
Only default hints are implemented.

The new wlr_linux_dmabuf_feedback_v1 data structure will allow
compositors to define their own custom hints in the future. This
data structure makes it easy to describe feedback metadata.

It's converted to a "compiled" form suitable for marshalling over
the Wayland socket via feedback_compile.
This commit is contained in:
Simon Ser 2018-11-13 12:35:08 +01:00
parent 77d811a21b
commit 1d8340754b
3 changed files with 283 additions and 5 deletions

View file

@ -10,6 +10,7 @@
#define WLR_TYPES_WLR_LINUX_DMABUF_H
#include <stdint.h>
#include <sys/stat.h>
#include <wayland-server-core.h>
#include <wlr/types/wlr_buffer.h>
#include <wlr/render/dmabuf.h>
@ -38,6 +39,18 @@ bool wlr_dmabuf_v1_resource_is_buffer(struct wl_resource *buffer_resource);
struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_buffer_resource(
struct wl_resource *buffer_resource);
struct wlr_linux_dmabuf_feedback_v1 {
dev_t main_device;
size_t tranches_len;
const struct wlr_linux_dmabuf_feedback_v1_tranche *tranches;
};
struct wlr_linux_dmabuf_feedback_v1_tranche {
dev_t target_device;
uint32_t flags; // bitfield of enum zwp_linux_dmabuf_feedback_v1_tranche_flags
const struct wlr_drm_format_set *formats;
};
/* the protocol interface */
struct wlr_linux_dmabuf_v1 {
struct wl_global *global;
@ -49,6 +62,8 @@ struct wlr_linux_dmabuf_v1 {
// private state
struct wlr_linux_dmabuf_feedback_v1_compiled *default_feedback;
struct wl_listener display_destroy;
struct wl_listener renderer_destroy;
};