#include <glib-unix.h>
#include "tpl_utils.h"
+#include "tpl_internal.h"
#include "wayland-egl/wayland-egl-priv.h"
#include "tpl_wayland_egl_thread.h"
#include "tpl_utils.h"
int rotation;
tpl_bool_t rotation_capability;
tpl_bool_t vblank_done;
+ tpl_object_t obj; /* for mutex lock */
tpl_list_t *committed_buffers;
tdm_client_vblank *vblank;
tbm_surface_queue_h tbm_queue;
TPL_ERR("Failed to tdm_client_vblank_wait. tdm_err(%d)", tdm_err);
}
- if (surf_source->committed_buffers)
+ if (surf_source->committed_buffers) {
+ TPL_OBJECT_LOCK(&surf_source->obj);
__tpl_list_push_back(surf_source->committed_buffers, tbm_surface);
+ TPL_OBJECT_UNLOCK(&surf_source->obj);
+ }
}
static void
twe_wl_surf_source *surf_source = (twe_wl_surf_source *)source;
if (surf_source->committed_buffers) {
+ TPL_OBJECT_LOCK(&surf_source->obj);
while (!__tpl_list_is_empty(surf_source->committed_buffers)) {
tbm_surface_h tbm_surface =
(tbm_surface_h)__tpl_list_pop_front(
__tpl_list_free(surf_source->committed_buffers, NULL);
surf_source->committed_buffers = NULL;
+ TPL_OBJECT_UNLOCK(&surf_source->obj);
}
+ __tpl_object_fini(&surf_source->obj);
+
g_source_remove_unix_fd(source, surf_source->tag);
close(surf_source->event_fd);
source->vblank_done = TPL_TRUE;
source->committed_buffers = __tpl_list_alloc();
+ __tpl_object_init(&source->obj, TPL_OBJECT_SURFACE, NULL);
+
wl_egl_window->private = (void *)source;
wl_egl_window->resize_callback = (void *)__cb_resize_callback;
wl_egl_window->rotate_callback = (void *)__cb_rotate_callback;
TPL_ERR("tbm_surface(%p) tsq_err(%d)", tbm_surface, tsq_err);
if (surf_source->committed_buffers) {
+ TPL_OBJECT_LOCK(&surf_source->obj);
__tpl_list_remove_data(surf_source->committed_buffers,
(void *)tbm_surface,
TPL_FIRST, NULL);
+ TPL_OBJECT_UNLOCK(&surf_source->obj);
}
TPL_LOG_T("WL_EGL", "[REL] wl_buffer(%p) tbm_surface(%p) bo(%d)",