tpl_surface_vblank_t *vblank;
/* surface information */
- int render_done_cnt;
unsigned int serial;
int width;
wl_egl_surface->frontbuffer_activated = TPL_FALSE;
wl_egl_surface->latest_transform = -1;
- wl_egl_surface->render_done_cnt = 0;
wl_egl_surface->serial = 0;
wl_egl_surface->vblank = NULL;
TPL_CHECK_ON_NULL_RETURN_VAL(tbm_surface, TPL_FALSE);
TPL_CHECK_ON_FALSE_RETURN_VAL(tbm_surface_internal_is_valid(tbm_surface), TPL_FALSE);
- wl_egl_surface->render_done_cnt++;
-
TRACE_ASYNC_END(wl_egl_buffer->acquire_fence_fd, "FENCE WAIT fd(%d)",
wl_egl_buffer->acquire_fence_fd);
TPL_LOG_D("[RENDER DONE]", "wl_egl_surface(%p) wl_egl_buffer(%p) tbm_surface(%p)",
wl_egl_surface, wl_egl_buffer, tbm_surface);
+ tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
tpl_gmutex_lock(&wl_egl_buffer->mutex);
+
wl_egl_buffer->status = WAITING_VBLANK;
TPL_LOG_D("[FINALIZE]", "wl_egl_surface(%p) wl_egl_buffer(%p) wait_source(%p) fence_fd(%d)",
wl_egl_buffer->acquire_fence_fd = -1;
wl_egl_buffer->waiting_source = NULL;
- tpl_gmutex_unlock(&wl_egl_buffer->mutex);
-
- tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
-
- if (!wl_egl_surface->vblank_enable || wl_egl_surface->vblank_done)
+ if (!wl_egl_surface->vblank_enable || wl_egl_surface->vblank_done) {
_thread_wl_surface_commit(wl_egl_surface, wl_egl_buffer);
- else {
+ tpl_gcond_signal(&wl_egl_buffer->cond);
+ } else {
tpl_gmutex_lock(&wl_egl_surface->vblank->mutex);
__tpl_list_push_back(wl_egl_surface->vblank->waiting_buffers,
wl_egl_buffer);
tpl_gmutex_unlock(&wl_egl_surface->vblank->mutex);
}
+ tpl_gmutex_unlock(&wl_egl_buffer->mutex);
tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
return TPL_FALSE;
}
}
- tpl_gmutex_unlock(&wl_egl_buffer->mutex);
-
- if (ready_to_commit)
+ if (ready_to_commit) {
_thread_wl_surface_commit(wl_egl_surface, wl_egl_buffer);
+ tpl_gcond_signal(&wl_egl_buffer->cond);
+ }
+
+ tpl_gmutex_unlock(&wl_egl_buffer->mutex);
}
return TPL_ERROR_NONE;
if (!wl_egl_buffer) break;
+ tpl_gmutex_lock(&wl_egl_buffer->mutex);
_thread_wl_surface_commit(wl_egl_surface, wl_egl_buffer);
+ tpl_gcond_signal(&wl_egl_buffer->cond);
+ tpl_gmutex_unlock(&wl_egl_buffer->mutex);
/* If tdm error such as TIMEOUT occured,
* flush all vblank waiting buffers of its wl_egl_surface.
TRACE_ASYNC_BEGIN((intptr_t)wl_egl_buffer->tbm_surface, "[COMMIT ~ RELEASE] BO(%d)",
wl_egl_buffer->bo_name);
- tpl_gmutex_lock(&wl_egl_buffer->mutex);
-
wl_egl_buffer->need_to_commit = TPL_FALSE;
wl_egl_buffer->status = COMMITTED;
if (wl_egl_surface->last_enq_buffer == wl_egl_buffer->tbm_surface)
wl_egl_surface->last_enq_buffer = NULL;
- tpl_gcond_signal(&wl_egl_buffer->cond);
-
- tpl_gmutex_unlock(&wl_egl_buffer->mutex);
-
TPL_LOG_T("WL_EGL",
"[COMMIT] wl_egl_buffer(%p) wl_buffer(%p) tbm_surface(%p) bo(%d)",
wl_egl_buffer, wl_egl_buffer->wl_buffer, wl_egl_buffer->tbm_surface,
tpl_wl_egl_surface_t *wl_egl_surface = wl_egl_buffer->wl_egl_surface;
tpl_wl_egl_display_t *wl_egl_display = wl_egl_surface->wl_egl_display;
- TPL_INFO("[BUFFER_FREE]", "wl_egl_surface(%p) wl_egl_buffer(%p) tbm_surface(%p) bo(%d)",
- wl_egl_surface, wl_egl_buffer, wl_egl_buffer->tbm_surface, wl_egl_buffer->bo_name);
+ TPL_INFO("[BUFFER_FREE]", "wl_egl_surface(%p) wl_egl_buffer(%p)",
+ wl_egl_surface, wl_egl_buffer);
+ TPL_INFO("[BUFFER_FREE]", "tbm_surface(%p) bo(%d)",
+ wl_egl_buffer->tbm_surface, wl_egl_buffer->bo_name);
tpl_gmutex_lock(&wl_egl_surface->buffers_mutex);
if (wl_egl_surface->buffers) {