summaryrefslogtreecommitdiff
path: root/src/lib/ecore_wl2
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-06-19 13:43:54 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-19 13:43:55 -0400
commitee3df4efc384d71b7b83b7538423bf9d9019f6eb (patch)
treeca95ffce3c223121352b8ebf3a78fd8df0869543 /src/lib/ecore_wl2
parent023a9ca2ee32529849e770f057f58592956dee47 (diff)
ecore_wl2: Better error handling for dmabuf sync ioctls
Summary: Turns out these can fail with EINTR or EAGAIN, and we're supposed to try again. Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6250
Diffstat (limited to 'src/lib/ecore_wl2')
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_buffer.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/ecore_wl2/ecore_wl2_buffer.c b/src/lib/ecore_wl2/ecore_wl2_buffer.c
index 498e3091f5..8e2e164546 100644
--- a/src/lib/ecore_wl2/ecore_wl2_buffer.c
+++ b/src/lib/ecore_wl2/ecore_wl2_buffer.c
@@ -111,7 +111,11 @@ _dmabuf_lock(Ecore_Wl2_Buffer *b)
111 struct dma_buf_sync s; 111 struct dma_buf_sync s;
112 112
113 s.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW; 113 s.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
114 ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); 114 do
115 {
116 ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
117 } while (ret && ((errno == EAGAIN) || (errno == EINTR)));
118
115 if (ret) WRN("Failed to lock dmabuf"); 119 if (ret) WRN("Failed to lock dmabuf");
116} 120}
117 121
@@ -122,7 +126,11 @@ _dmabuf_unlock(Ecore_Wl2_Buffer *b)
122 struct dma_buf_sync s; 126 struct dma_buf_sync s;
123 127
124 s.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW; 128 s.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
125 ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s); 129 do
130 {
131 ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
132 } while (ret && ((errno == EAGAIN) || (errno == EINTR)));
133
126 if (ret) WRN("Failed to unlock dmabuf"); 134 if (ret) WRN("Failed to unlock dmabuf");
127} 135}
128 136