tpl_bool_t rotated; /* TRUE if need to call wl_surface_set_buffer_transform */
tpl_bool_t reset; /* TRUE if queue reseted by external */
tpl_bool_t is_new; /* for frontbuffer mode */
+ tpl_bool_t need_to_release; /* for checking need release */
struct wl_proxy *wl_proxy; /* wl_buffer proxy */
};
wl_surface_commit(wl_egl_window->surface);
+ wayland_egl_buffer->need_to_release = TPL_TRUE;
+
wl_display_flush(wayland_egl_display->wl_dpy);
TPL_LOG_B("WL_EGL",
__tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface);
if (wayland_egl_buffer) {
- wayland_egl_surface = wayland_egl_buffer->wayland_egl_surface;
-
- if (wayland_egl_surface->attached_buffers) {
- TPL_OBJECT_LOCK(&wayland_egl_surface->base);
- /* Stop tracking of this released tbm_surface. */
- __tpl_list_remove_data(wayland_egl_surface->attached_buffers,
- (void *)tbm_surface, TPL_FIRST, NULL);
- TPL_OBJECT_UNLOCK(&wayland_egl_surface->base);
+ if (wayland_egl_buffer->need_to_release) {
+ wayland_egl_surface = wayland_egl_buffer->wayland_egl_surface;
+
+ if (wayland_egl_surface->attached_buffers) {
+ TPL_OBJECT_LOCK(&wayland_egl_surface->base);
+ /* Stop tracking of this released tbm_surface. */
+ __tpl_list_remove_data(wayland_egl_surface->attached_buffers,
+ (void *)tbm_surface, TPL_FIRST, NULL);
+ TPL_OBJECT_UNLOCK(&wayland_egl_surface->base);
+ }
+ /* If tbm_surface_queue was reset before release_cb called out,
+ * tbm_surface_queue_release doesn't have to be done. */
+ if (wayland_egl_buffer->reset == TPL_FALSE)
+ tbm_surface_queue_release(wayland_egl_surface->tbm_queue,
+ tbm_surface);
+
+ wayland_egl_buffer->need_to_release = TPL_FALSE;
+
+ tbm_surface_internal_unref(tbm_surface);
+ } else {
+ TPL_WARN("No need to release buffer | wl_buffer(%p) tbm_surface(%p) bo(%d)",
+ proxy, tbm_surface,
+ tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)));
}
- /* If tbm_surface_queue was reset before release_cb called out,
- * tbm_surface_queue_release doesn't have to be done. */
- if (wayland_egl_buffer->reset == TPL_FALSE)
- tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface);
}
-
- tbm_surface_internal_unref(tbm_surface);
}
}