ecore_wl2: Don't unmap buffers at unlock
authorDerek Foreman <derekf@osg.samsung.com>
Fri, 9 Mar 2018 22:12:44 +0000 (16:12 -0600)
committerWonki Kim <wonki_.kim@samsung.com>
Wed, 30 May 2018 04:46:51 +0000 (13:46 +0900)
We should be using dmabuf sync ioctls instead of mmap/munmap every draw,
this makes that happen.  The surface code continues to do what its always
done, and map/unlock.

src/lib/ecore_wl2/ecore_wl2_buffer.c

index ced18c1..3b55981 100644 (file)
@@ -655,7 +655,7 @@ ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf, int *w, int *h, int *stride)
 
    EINA_SAFETY_ON_NULL_RETURN_VAL(buf, NULL);
 
-   if (buf->locked)
+   if (buf->mapping)
      {
         out = buf->mapping;
      }
@@ -674,6 +674,9 @@ ecore_wl2_buffer_map(Ecore_Wl2_Buffer *buf, int *w, int *h, int *stride)
    if (w) *w = buf->w;
    if (h) *h = buf->h;
    if (stride) *stride = (int)buf->stride;
+
+   if (!buf->locked) ecore_wl2_buffer_lock(buf);
+
    return out;
 }
 
@@ -704,8 +707,6 @@ ecore_wl2_buffer_unlock(Ecore_Wl2_Buffer *b)
 {
    if (!b->locked) ERR("Buffer already unlocked\n");
    if (buffer_manager->unlock) buffer_manager->unlock(b);
-   ecore_wl2_buffer_unmap(b);
-   b->mapping = NULL;
    b->locked = EINA_FALSE;
 }