diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2018-06-05 11:22:35 -0500 |
---|---|---|
committer | Derek Foreman <derekf@osg.samsung.com> | 2018-06-05 11:40:37 -0500 |
commit | 4ec261064f00fdc9b232b05f74dbbfd1424cac16 (patch) | |
tree | d2ef28c654550a99cfa963b7a0b19d3c085331ba /src/lib/ecore_wl2/ecore_wl2_buffer.c | |
parent | e2d143d19ed7e70480d40bbb8c6a6db29a3ab677 (diff) |
ecore_wl2: Fix dmabuf locking
Summary:
The ioctls weren't properly used so no locking took place at all, leading
to rendering anomalies when placing dmabuf buffers in hardware planes.
Also, forgetting to check error returns left no indication that the
ioctl was failing, so we now emit a warning if the ioctl fails.
Reviewers: zmike
Reviewed By: zmike
Subscribers: devilhorns, cedric, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6237
Diffstat (limited to 'src/lib/ecore_wl2/ecore_wl2_buffer.c')
-rw-r--r-- | src/lib/ecore_wl2/ecore_wl2_buffer.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c index 3b55981468..498e3091f5 100644 --- a/src/lib/ecore_wl2/ecore_wl2_buffer.c +++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c | |||
@@ -107,19 +107,23 @@ _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db) | |||
107 | static void | 107 | static void |
108 | _dmabuf_lock(Ecore_Wl2_Buffer *b) | 108 | _dmabuf_lock(Ecore_Wl2_Buffer *b) |
109 | { | 109 | { |
110 | int ret; | ||
110 | struct dma_buf_sync s; | 111 | struct dma_buf_sync s; |
111 | 112 | ||
112 | s.flags = DMA_BUF_SYNC_START; | 113 | s.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW; |
113 | ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); | 114 | ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); |
115 | if (ret) WRN("Failed to lock dmabuf"); | ||
114 | } | 116 | } |
115 | 117 | ||
116 | static void | 118 | static void |
117 | _dmabuf_unlock(Ecore_Wl2_Buffer *b) | 119 | _dmabuf_unlock(Ecore_Wl2_Buffer *b) |
118 | { | 120 | { |
121 | int ret; | ||
119 | struct dma_buf_sync s; | 122 | struct dma_buf_sync s; |
120 | 123 | ||
121 | s.flags = DMA_BUF_SYNC_START; | 124 | s.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW; |
122 | ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); | 125 | ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); |
126 | if (ret) WRN("Failed to unlock dmabuf"); | ||
123 | } | 127 | } |
124 | 128 | ||
125 | static Buffer_Handle * | 129 | static Buffer_Handle * |