forked from enlightenment/efl
ecore_wl2: Add dma_buf lock/unlock ioctls
These should help with coherency later when we don't unmap for every surface post.
This commit is contained in:
parent
1fddfdfaae
commit
6b3f999cf4
|
@ -17,6 +17,7 @@
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#include <linux/dma-buf.h>
|
||||||
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
#include "linux-dmabuf-unstable-v1-client-protocol.h"
|
||||||
|
|
||||||
#define SYM(lib, xx) \
|
#define SYM(lib, xx) \
|
||||||
|
@ -103,6 +104,24 @@ _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db)
|
||||||
return buf;
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_dmabuf_lock(Ecore_Wl2_Buffer *b)
|
||||||
|
{
|
||||||
|
struct dma_buf_sync s;
|
||||||
|
|
||||||
|
s.flags = DMA_BUF_SYNC_START;
|
||||||
|
ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_dmabuf_unlock(Ecore_Wl2_Buffer *b)
|
||||||
|
{
|
||||||
|
struct dma_buf_sync s;
|
||||||
|
|
||||||
|
s.flags = DMA_BUF_SYNC_START;
|
||||||
|
ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
|
||||||
|
}
|
||||||
|
|
||||||
static Buffer_Handle *
|
static Buffer_Handle *
|
||||||
_intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd)
|
_intel_alloc(Buffer_Manager *self, const char *name, int w, int h, unsigned long *stride, int32_t *fd)
|
||||||
{
|
{
|
||||||
|
@ -194,6 +213,8 @@ _intel_buffer_manager_setup(int fd)
|
||||||
buffer_manager->map = _intel_map;
|
buffer_manager->map = _intel_map;
|
||||||
buffer_manager->unmap = _intel_unmap;
|
buffer_manager->unmap = _intel_unmap;
|
||||||
buffer_manager->discard = _intel_discard;
|
buffer_manager->discard = _intel_discard;
|
||||||
|
buffer_manager->lock = _dmabuf_lock;
|
||||||
|
buffer_manager->unlock = _dmabuf_unlock;
|
||||||
buffer_manager->manager_destroy = _intel_manager_destroy;
|
buffer_manager->manager_destroy = _intel_manager_destroy;
|
||||||
buffer_manager->dl_handle = drm_intel_lib;
|
buffer_manager->dl_handle = drm_intel_lib;
|
||||||
|
|
||||||
|
@ -300,6 +321,8 @@ _exynos_buffer_manager_setup(int fd)
|
||||||
buffer_manager->map = _exynos_map;
|
buffer_manager->map = _exynos_map;
|
||||||
buffer_manager->unmap = _exynos_unmap;
|
buffer_manager->unmap = _exynos_unmap;
|
||||||
buffer_manager->discard = _exynos_discard;
|
buffer_manager->discard = _exynos_discard;
|
||||||
|
buffer_manager->lock = _dmabuf_lock;
|
||||||
|
buffer_manager->unlock = _dmabuf_unlock;
|
||||||
buffer_manager->manager_destroy = _exynos_manager_destroy;
|
buffer_manager->manager_destroy = _exynos_manager_destroy;
|
||||||
buffer_manager->dl_handle = drm_exynos_lib;
|
buffer_manager->dl_handle = drm_exynos_lib;
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
@ -530,6 +553,8 @@ _vc4_buffer_manager_setup(int fd)
|
||||||
buffer_manager->map = _vc4_map;
|
buffer_manager->map = _vc4_map;
|
||||||
buffer_manager->unmap = _vc4_unmap;
|
buffer_manager->unmap = _vc4_unmap;
|
||||||
buffer_manager->discard = _vc4_discard;
|
buffer_manager->discard = _vc4_discard;
|
||||||
|
buffer_manager->lock = _dmabuf_lock;
|
||||||
|
buffer_manager->unlock = _dmabuf_unlock;
|
||||||
buffer_manager->manager_destroy = NULL;
|
buffer_manager->manager_destroy = NULL;
|
||||||
buffer_manager->dl_handle = drm_lib;
|
buffer_manager->dl_handle = drm_lib;
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
|
|
Loading…
Reference in New Issue