dmabuf: implement linux_dmabuf extension
v2 changes:
- implement the revised protocol
- add basic sanity checks when creating buffer and check for support
- add way to attach user data to the dmabuf for renderer use
- bump max number of planes to 4 to follow DRM AddFb2 ioctl
- improve errors handling
- use separate linux_dmabuf_buffer fields for the different wl_resource
types
- as SERVER_ERROR code is no more, use a wl_display "generic" error for
emergency-disconneting a client we fail to process
- more documentation
- change y-invert from per-plane boolean to per-buffer flag
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
diff --git a/src/compositor.h b/src/compositor.h
index d1ca9ab..c4c81f0 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -57,6 +57,7 @@
struct weston_output;
struct input_method;
struct weston_pointer;
+struct linux_dmabuf_buffer;
enum weston_keyboard_modifier {
MODIFIER_CTRL = (1 << 0),
@@ -588,6 +589,10 @@
void *target, size_t size,
int src_x, int src_y,
int width, int height);
+
+ /** See weston_compositor_import_dmabuf() */
+ bool (*import_dmabuf)(struct weston_compositor *ec,
+ struct linux_dmabuf_buffer *buffer);
};
enum weston_capability {
@@ -1364,6 +1369,10 @@
const struct weston_compositor *compositor,
struct timespec *ts);
+bool
+weston_compositor_import_dmabuf(struct weston_compositor *compositor,
+ struct linux_dmabuf_buffer *buffer);
+
void
weston_compositor_shutdown(struct weston_compositor *ec);
void