summaryrefslogtreecommitdiff
path: root/src/lib/efl_wl/dmabuf.h
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-06-30 14:59:21 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-06-30 14:59:55 -0400
commitc2fde93c9ef1108c0809a538cf2ec482ed8369a9 (patch)
treed9879e4ebea4d25cda1a6cc1268461ad0d669c3b /src/lib/efl_wl/dmabuf.h
parent3775a9645da7e92599babccfe8454304cec367b7 (diff)
efl_wl: a multiseat wayland compositor in an evas smart object
build when wayland support is enabled and provide two test/demo cases beta api @feature Reviewed-By: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/efl_wl/dmabuf.h')
-rw-r--r--src/lib/efl_wl/dmabuf.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/lib/efl_wl/dmabuf.h b/src/lib/efl_wl/dmabuf.h
new file mode 100644
index 0000000000..c1da1e3abf
--- /dev/null
+++ b/src/lib/efl_wl/dmabuf.h
@@ -0,0 +1,92 @@
1/* Shamelessly stolen from weston and modified, original license boiler plate
2 * follows.
3 */
4/*
5 * Copyright © 2014, 2015 Collabora, Ltd.
6 *
7 * Permission to use, copy, modify, distribute, and sell this software and
8 * its documentation for any purpose is hereby granted without fee, provided
9 * that the above copyright notice appear in all copies and that both that
10 * copyright notice and this permission notice appear in supporting
11 * documentation, and that the name of the copyright holders not be used in
12 * advertising or publicity pertaining to distribution of the software
13 * without specific, written prior permission. The copyright holders make
14 * no representations about the suitability of this software for any
15 * purpose. It is provided "as is" without express or implied warranty.
16 *
17 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
18 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
20 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
21 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
22 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
23 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
24 */
25
26#ifndef WESTON_LINUX_DMABUF_H
27#define WESTON_LINUX_DMABUF_H
28
29#include <stdint.h>
30
31#define MAX_DMABUF_PLANES 4
32
33struct linux_dmabuf_buffer;
34typedef void (*dmabuf_user_data_destroy_func)(
35 struct linux_dmabuf_buffer *buffer);
36
37struct dmabuf_attributes {
38 int version;
39 int32_t width;
40 int32_t height;
41 uint32_t format;
42 uint32_t flags; /* enum zlinux_buffer_params_flags */
43 int n_planes;
44 int fd[MAX_DMABUF_PLANES];
45 uint32_t offset[MAX_DMABUF_PLANES];
46 uint32_t stride[MAX_DMABUF_PLANES];
47 uint64_t modifier[MAX_DMABUF_PLANES];
48};
49
50struct linux_dmabuf_buffer {
51 struct wl_resource *buffer_resource;
52 struct wl_resource *params_resource;
53 void *compositor;
54 struct dmabuf_attributes attributes;
55
56 void *user_data;
57 dmabuf_user_data_destroy_func user_data_destroy_func;
58
59 /* XXX:
60 *
61 * Add backend private data. This would be for the backend
62 * to do all additional imports it might ever use in advance.
63 * The basic principle, even if not implemented in drivers today,
64 * is that dmabufs are first attached, but the actual allocation
65 * is deferred to first use. This would allow the exporter and all
66 * attachers to agree on how to allocate.
67 *
68 * The DRM backend would use this to create drmFBs for each
69 * dmabuf_buffer, just in case at some point it would become
70 * feasible to scan it out directly. This would improve the
71 * possibilities to successfully scan out, avoiding compositing.
72 */
73};
74
75int
76linux_dmabuf_setup(struct wl_display *display, void *comp);
77
78struct linux_dmabuf_buffer *
79linux_dmabuf_buffer_get(struct wl_resource *resource);
80
81void
82linux_dmabuf_buffer_set_user_data(struct linux_dmabuf_buffer *buffer,
83 void *data,
84 dmabuf_user_data_destroy_func func);
85void *
86linux_dmabuf_buffer_get_user_data(struct linux_dmabuf_buffer *buffer);
87
88void
89linux_dmabuf_buffer_send_server_error(struct linux_dmabuf_buffer *buffer,
90 const char *msg);
91
92#endif /* WESTON_LINUX_DMABUF_H */