int rotation;
tpl_bool_t rotation_capability;
tpl_bool_t vblank_done;
+ tpl_list_t *committed_buffers;
tdm_client_vblank *vblank;
tbm_surface_queue_h tbm_queue;
twe_wl_disp_source *disp_source;
else
TPL_ERR("Failed to tdm_client_vblank_wait. tdm_err(%d)", tdm_err);
}
+
+ if (surf_source->committed_buffers)
+ __tpl_list_push_back(surf_source->committed_buffers, tbm_surface);
}
static void
static void
_twe_thread_wl_surface_finalize(GSource *source)
{
- twe_wl_surf_source *wl_surf_source = (twe_wl_surf_source *)source;
+ twe_wl_surf_source *surf_source = (twe_wl_surf_source *)source;
+
+ if (surf_source->committed_buffers) {
+ while (!__tpl_list_is_empty(surf_source->committed_buffers)) {
+ tbm_surface_h tbm_surface =
+ (tbm_surface_h)__tpl_list_pop_front(
+ surf_source->committed_buffers,
+ NULL);
+ tbm_surface_internal_unref(tbm_surface);
+ }
+
+ __tpl_list_free(surf_source->committed_buffers, NULL);
+ surf_source->committed_buffers = NULL;
+ }
- g_source_remove_unix_fd(source, wl_surf_source->tag);
+ g_source_remove_unix_fd(source, surf_source->tag);
- TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
- source, wl_surf_source->event_fd);
- close(wl_surf_source->event_fd);
+ close(surf_source->event_fd);
+ TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)",
+ source, surf_source->event_fd);
return;
}
source->rotation_capability = TPL_FALSE;
source->vblank = _twe_surface_create_vblank(_twe_ctx->tdm_client);
source->vblank_done = TPL_TRUE;
+ source->committed_buffers = __tpl_list_alloc();
wl_egl_window->private = (void *)source;
wl_egl_window->resize_callback = (void *)__cb_resize_callback;
if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE)
TPL_ERR("tbm_surface(%p) tsq_err(%d)", tbm_surface, tsq_err);
+ if (surf_source->committed_buffers) {
+ __tpl_list_remove_data(surf_source->committed_buffers,
+ (void *)tbm_surface,
+ TPL_FIRST, NULL);
+ }
+
TPL_LOG_T("WL_EGL", "[REL] wl_buffer(%p) tbm_surface(%p) bo(%d)",
buf_info->wl_buffer, tbm_surface,
tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)));