tpl_bool_t need_worker_clear;
int present_mode;
+
+ tpl_bool_t need_reset;
};
struct _tpl_tbm_buffer {
return TPL_ERROR_NONE;
}
+static void
+__cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue,
+ void *data)
+{
+ tpl_tbm_surface_t *tpl_tbm_surface = (tpl_tbm_surface_t *)data;
+
+ if (!tpl_tbm_surface) {
+ TPL_ERR("Invalid parameter. tpl_tbm_surface(%p)", tpl_tbm_surface);
+ return;
+ }
+
+ TPL_LOG_B("TBM", "tbm_queue(%p) has been reset!", tbm_queue);
+
+ tpl_tbm_surface->need_reset = TPL_TRUE;
+}
+
static tpl_result_t
__tpl_tbm_surface_init(tpl_surface_t *surface)
{
surface->backend.data = (void *)tpl_tbm_surface;
+ tpl_tbm_surface->need_reset = TPL_FALSE;
+
if (surface->type == TPL_SURFACE_TYPE_WINDOW) {
if (__tpl_tbm_display_get_window_info(surface->display,
surface->native_handle, &surface->width,
__tpl_tbm_surface_queue_notify_cb,
surface);
+ /* Set reset_callback to tbm_queue */
+ tbm_surface_queue_add_reset_cb((tbm_surface_queue_h)surface->native_handle,
+ __cb_tbm_queue_reset_callback,
+ (void *)tpl_tbm_surface);
+
TPL_LOG_B("TBM", "[INIT] tpl_surface(%p) tpl_tbm_surface_t(%p) tbm_surface_queue(%p)",
surface, tpl_tbm_surface, surface->native_handle);
static tpl_bool_t
__tpl_tbm_surface_validate(tpl_surface_t *surface)
{
- TPL_IGNORE(surface);
+ tpl_tbm_surface_t *tpl_tbm_surface = (tpl_tbm_surface_t *)surface->backend.data;
+ tpl_bool_t ret = TPL_TRUE;
+
+ ret = !tpl_tbm_surface->need_reset;
- return TPL_TRUE;
+ return ret;
}
static tbm_surface_h
tbm_surface_queue_h tbm_queue = NULL;
tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_INVALID_QUEUE;
tpl_tbm_buffer_t *tpl_tbm_buffer = NULL;
+ tpl_tbm_surface_t *tpl_tbm_surface = (tpl_tbm_surface_t *)surface->backend.data;
TPL_ASSERT(surface);
TPL_ASSERT(surface->native_handle);
/* It will be dec when before tbm_surface_queue_enqueue called */
tbm_surface_internal_ref(tbm_surface);
+ tpl_tbm_surface->need_reset = TPL_FALSE;
+
TPL_LOG_B("TBM", "[DEQ] tpl_surface(%p) tbm_queue(%p) tbm_surface(%p) bo(%d)",
surface, tbm_queue, tbm_surface,
tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)));