summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-03-09 14:33:13 -0600
committerDerek Foreman <derekf@osg.samsung.com>2018-04-20 13:00:28 -0500
commit6b3f999cf48f87212a48e236def0a852b24a327e (patch)
tree692924f1cba35ecc0c6254e0e6115d70ef4eb7be /src/lib/ecore_wl2
parent1fddfdfaae2d9a09e2b84ac73abd4fec825ea744 (diff)
ecore_wl2: Add dma_buf lock/unlock ioctls
These should help with coherency later when we don't unmap for every surface post.
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_buffer.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index 7db37035a4..d680e05f7b 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -17,6 +17,7 @@
17#include <sys/mman.h> 17#include <sys/mman.h>
18#include <sys/ioctl.h> 18#include <sys/ioctl.h>
19 19
20#include <linux/dma-buf.h>
20#include "linux-dmabuf-unstable-v1-client-protocol.h" 21#include "linux-dmabuf-unstable-v1-client-protocol.h"
21 22
22#define SYM(lib, xx) \ 23#define SYM(lib, xx) \
@@ -103,6 +104,24 @@ _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db)
103 return buf; 104 return buf;
104} 105}
105 106
107static void
108_dmabuf_lock(Ecore_Wl2_Buffer *b)
109{
110 struct dma_buf_sync s;
111
112 s.flags = DMA_BUF_SYNC_START;
113 ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
114}
115
116static void
117_dmabuf_unlock(Ecore_Wl2_Buffer *b)
118{
119 struct dma_buf_sync s;
120
121 s.flags = DMA_BUF_SYNC_START;
122 ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
123}
124
106static Buffer_Handle * 125static Buffer_Handle *
107_intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd) 126_intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd)
108{ 127{
@@ -194,6 +213,8 @@ _intel_buffer_manager_setup(int fd)
194 buffer_manager->map = _intel_map; 213 buffer_manager->map = _intel_map;
195 buffer_manager->unmap = _intel_unmap; 214 buffer_manager->unmap = _intel_unmap;
196 buffer_manager->discard = _intel_discard; 215 buffer_manager->discard = _intel_discard;
216 buffer_manager->lock = _dmabuf_lock;
217 buffer_manager->unlock = _dmabuf_unlock;
197 buffer_manager->manager_destroy = _intel_manager_destroy; 218 buffer_manager->manager_destroy = _intel_manager_destroy;
198 buffer_manager->dl_handle = drm_intel_lib; 219 buffer_manager->dl_handle = drm_intel_lib;
199 220
@@ -300,6 +321,8 @@ _exynos_buffer_manager_setup(int fd)
300 buffer_manager->map = _exynos_map; 321 buffer_manager->map = _exynos_map;
301 buffer_manager->unmap = _exynos_unmap; 322 buffer_manager->unmap = _exynos_unmap;
302 buffer_manager->discard = _exynos_discard; 323 buffer_manager->discard = _exynos_discard;
324 buffer_manager->lock = _dmabuf_lock;
325 buffer_manager->unlock = _dmabuf_unlock;
303 buffer_manager->manager_destroy = _exynos_manager_destroy; 326 buffer_manager->manager_destroy = _exynos_manager_destroy;
304 buffer_manager->dl_handle = drm_exynos_lib; 327 buffer_manager->dl_handle = drm_exynos_lib;
305 return EINA_TRUE; 328 return EINA_TRUE;
@@ -530,6 +553,8 @@ _vc4_buffer_manager_setup(int fd)
530 buffer_manager->map = _vc4_map; 553 buffer_manager->map = _vc4_map;
531 buffer_manager->unmap = _vc4_unmap; 554 buffer_manager->unmap = _vc4_unmap;
532 buffer_manager->discard = _vc4_discard; 555 buffer_manager->discard = _vc4_discard;
556 buffer_manager->lock = _dmabuf_lock;
557 buffer_manager->unlock = _dmabuf_unlock;
533 buffer_manager->manager_destroy = NULL; 558 buffer_manager->manager_destroy = NULL;
534 buffer_manager->dl_handle = drm_lib; 559 buffer_manager->dl_handle = drm_lib;
535 return EINA_TRUE; 560 return EINA_TRUE;