derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9632c7b56cc41cef3c1811b745e207599d427607

commit 9632c7b56cc41cef3c1811b745e207599d427607
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Tue Jan 30 16:29:32 2018 -0600

    wl2_surface_dmabuf: improve surface flush
    
    We used to abandon all buffers even if they were locked. This can't
    actually free them until they're all released by the compositor.
    
    Instead just free any buffer the compositor doesn't have locked, so we can
    still re-use them when they're released without needing a full redraw.
    
    There's probably room for additional cleverness here.  If we get a new
    frame event before the buffer release we may want to keep it, and if we
    get the release first we may want to abandon it.
---
 src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c 
b/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
index a2ddb9119a..2be8ded399 100644
--- a/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
+++ b/src/lib/ecore_wl2/ecore_wl2_surface_module_dmabuf.c
@@ -193,7 +193,14 @@ _evas_dmabuf_surface_flush(Ecore_Wl2_Surface *surface 
EINA_UNUSED, void *priv_da
    p = priv_data;
 
    EINA_LIST_FREE(p->buffers, b)
-     ecore_wl2_buffer_destroy(b);
+     {
+        if (!ecore_wl2_buffer_busy_get(b))
+          {
+             if (p->current == b)
+               p->current = NULL;
+             ecore_wl2_buffer_destroy(b);
+          }
+     }
 }
 
 static Ecore_Wl2_Surface_Interface dmabuf_smanager =

-- 


Reply via email to