add ds_linux_dmabuf_v1
[platform/core/uifw/libds.git] / include / libds / linux_dmabuf_v1.h
1 #ifndef LIBDS_LINUX_DMABUF_V1_H
2 #define LIBDS_LINUX_DMABUF_V1_H
3
4 #include <wayland-server.h>
5 #include <libds/buffer.h>
6
7 #define LINUX_DMABUF_MAX_PLANES 4
8
9 struct ds_linux_dmabuf_v1;
10
11 struct ds_linux_dmabuf_v1_buffer;
12
13 struct ds_linux_dmabuf_v1_attributes {
14     int32_t width;
15     int32_t height;
16     uint32_t format;
17     uint32_t flags;
18     int num_planes;
19     int fd[LINUX_DMABUF_MAX_PLANES];
20     uint32_t offset[LINUX_DMABUF_MAX_PLANES];
21     uint32_t stride[LINUX_DMABUF_MAX_PLANES];
22     uint64_t modifier[LINUX_DMABUF_MAX_PLANES];
23 };
24
25 struct ds_linux_dmabuf_v1_format {
26     uint32_t format;
27     uint64_t *modifiers;
28     int num_modifiers;
29 };
30
31 struct ds_linux_dmabuf_v1 *
32 ds_linux_dmabuf_v1_create(struct wl_display *display,
33         const struct ds_linux_dmabuf_v1_format *supported_formats, int num_formats);
34
35 struct ds_linux_dmabuf_v1_buffer *
36 ds_linux_dmabuf_v1_buffer_from_buffer(struct ds_buffer *ds_buffer);
37
38 const struct ds_linux_dmabuf_v1_attributes *
39 ds_linux_dmabuf_v1_buffer_get_attributes(struct ds_linux_dmabuf_v1_buffer *dmabuf_buffer);
40
41 #endif