aboutsummaryrefslogtreecommitdiff
path: root/include/wlr/render/dmabuf.h
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-31 12:33:27 +0100
committeremersion <contact@emersion.fr>2018-05-31 12:33:27 +0100
commit21928cbe615184a81d157ccc68e503282efff83c (patch)
treee2523e48aadc69a109909ee37af18c76d88e4859 /include/wlr/render/dmabuf.h
parentc844eaa1b32894417263ce2b5030033bdd7c7851 (diff)
parent32013abae63f1c31598ac716acd7e73c24fadae1 (diff)
Merge branch 'master' into screencontent
Diffstat (limited to 'include/wlr/render/dmabuf.h')
-rw-r--r--include/wlr/render/dmabuf.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/wlr/render/dmabuf.h b/include/wlr/render/dmabuf.h
new file mode 100644
index 00000000..78f8c2eb
--- /dev/null
+++ b/include/wlr/render/dmabuf.h
@@ -0,0 +1,36 @@
+#ifndef WLR_RENDER_DMABUF_H
+#define WLR_RENDER_DMABUF_H
+
+#include <stdint.h>
+
+// So we don't have to pull in linux specific drm headers
+#ifndef DRM_FORMAT_MOD_INVALID
+#define DRM_FORMAT_MOD_INVALID ((1ULL<<56) - 1)
+#endif
+
+#define WLR_DMABUF_MAX_PLANES 4
+
+enum wlr_dmabuf_attributes_flags {
+ WLR_DMABUF_ATTRIBUTES_FLAGS_Y_INVERT = 1,
+ WLR_DMABUF_ATTRIBUTES_FLAGS_INTERLACED = 2,
+ WLR_DMABUF_ATTRIBUTES_FLAGS_BOTTOM_FIRST = 4,
+};
+
+struct wlr_dmabuf_attributes {
+ int32_t width, height;
+ uint32_t format;
+ uint32_t flags; // enum wlr_dmabuf_attributes_flags
+ uint64_t modifier;
+
+ int n_planes;
+ uint32_t offset[WLR_DMABUF_MAX_PLANES];
+ uint32_t stride[WLR_DMABUF_MAX_PLANES];
+ int fd[WLR_DMABUF_MAX_PLANES];
+};
+
+/**
+ * Closes all file descriptors in the DMA-BUF attributes.
+ */
+void wlr_dmabuf_attributes_finish(struct wlr_dmabuf_attributes *attribs);
+
+#endif