From: joonbum.ko Date: Thu, 6 Oct 2016 05:45:16 +0000 (+0900) Subject: tpl_wayland_egl: Do unreference the attached buffers when the flushing of buffer... X-Git-Tag: accepted/tizen/3.0/ivi/20161028.151244^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F50%2F91150%2F3;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git tpl_wayland_egl: Do unreference the attached buffers when the flushing of buffer is occured. it uses the list of attached_buffers. Change-Id: Iaf880e86807af33e75ad7ee41e682628db4216e1 Signed-off-by: joonbum.ko --- diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 99b957f..0323dfc 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -1357,6 +1357,23 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, } tbm_surface_queue_flush(wayland_egl_surface->tbm_queue); + + /* Only when client call tpl_surface_dequeue_buffer(), client can do + * unreference tbm_surface although there are release events in the event queue, + * After tbm_surface_queue_flush, queue has no tbm_surface, client can do + * unreference attached buffers using the list of attached_buffers. + * Then, client does not need to wait for release_callback to unreference + * attached buffer. + */ + if (wayland_egl_surface->attached_buffers) { + TPL_OBJECT_LOCK(&wayland_egl_surface->base); + while (!__tpl_list_is_empty(wayland_egl_surface->attached_buffers)) { + tbm_surface_h tbm_surface = + __tpl_list_pop_front(wayland_egl_surface->attached_buffers, NULL); + tbm_surface_internal_unref(tbm_surface); + } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + } } static const struct tizen_surface_shm_flusher_listener