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
This commit is contained in:
Derek Foreman 2018-06-05 11:22:35 -05:00
parent e2d143d19e
commit 4ec261064f
1 changed files with 8 additions and 4 deletions

View File

@ -107,19 +107,23 @@ _evas_dmabuf_wl_buffer_from_dmabuf(Ecore_Wl2_Display *ewd, Ecore_Wl2_Buffer *db)
static void
_dmabuf_lock(Ecore_Wl2_Buffer *b)
{
int ret;
struct dma_buf_sync s;
s.flags = DMA_BUF_SYNC_START;
ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
s.flags = DMA_BUF_SYNC_START | DMA_BUF_SYNC_RW;
ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
if (ret) WRN("Failed to lock dmabuf");
}
static void
_dmabuf_unlock(Ecore_Wl2_Buffer *b)
{
int ret;
struct dma_buf_sync s;
s.flags = DMA_BUF_SYNC_START;
ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
s.flags = DMA_BUF_SYNC_END | DMA_BUF_SYNC_RW;
ret = ioctl(b->fd, DMA_BUF_IOCTL_SYNC, &s);
if (ret) WRN("Failed to unlock dmabuf");
}
static Buffer_Handle *