wl_egl_surface->reset = TPL_FALSE;
wl_egl_surface->is_activated = TPL_FALSE;
- wl_egl_surface->need_to_enqueue = TPL_FALSE;
+ wl_egl_surface->need_to_enqueue = TPL_TRUE;
wl_egl_surface->prerotation_capability = TPL_FALSE;
wl_egl_surface->vblank_done = TPL_TRUE;
wl_egl_surface->use_render_done_fence = TPL_FALSE;
/* If wl_egl_buffer->release_fence_fd is -1,
* the tbm_surface can be used immediately.
* If not, user(EGL) have to wait until signaled. */
- if (release_fence && wl_egl_surface->surface_sync) {
- *release_fence = wl_egl_buffer->release_fence_fd;
- TPL_DEBUG("wl_egl_surface(%p) wl_egl_buffer(%p) release_fence_fd(%d)",
- wl_egl_surface, wl_egl_buffer, *release_fence);
+ if (release_fence) {
+ if (wl_egl_surface->surface_sync) {
+ *release_fence = wl_egl_buffer->release_fence_fd;
+ TPL_DEBUG("wl_egl_surface(%p) wl_egl_buffer(%p) release_fence_fd(%d)",
+ wl_egl_surface, wl_egl_buffer, *release_fence);
+ } else {
+ *release_fence = -1;
+ }
}
if (surface->is_frontbuffer_mode && is_activated)
TRACE_ASYNC_END(wl_egl_buffer->acquire_fence_fd, "FENCE WAIT fd(%d)",
wl_egl_buffer->acquire_fence_fd);
+ TPL_DEBUG("[RENDER DONE] wl_egl_buffer(%p) tbm_surface(%p)",
+ wl_egl_buffer, tbm_surface);
+
tpl_gmutex_lock(&wl_egl_buffer->mutex);
tpl_gcond_signal(&wl_egl_buffer->cond);
wl_egl_buffer->status = WAITING_VBLANK;
tbm_surface_h tbm_surface = NULL;
TRACE_ASYNC_END((int)wl_egl_surface, "WAIT_VBLANK");
+ TPL_DEBUG("[VBLANK] wl_egl_surface(%p)", wl_egl_surface);
if (error == TDM_ERROR_TIMEOUT)
TPL_WARN("[TDM_ERROR_TIMEOUT] It will keep going. wl_egl_surface(%p)",
tbm_surface = (tbm_surface_h)__tpl_list_pop_front(
wl_egl_surface->vblank_waiting_buffers,
NULL);
- _thread_wl_surface_commit(wl_egl_surface, tbm_surface);
+ if (tbm_surface)
+ _thread_wl_surface_commit(wl_egl_surface, tbm_surface);
tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
}
/* -- END -- tdm_client vblank callback function */
wl_egl_buffer, wl_egl_buffer->wl_buffer, wl_egl_buffer->tbm_surface);
tpl_gmutex_lock(&wl_egl_surface->buffers_mutex);
- if (wl_egl_buffer->idx > 0 && wl_egl_surface->buffers[wl_egl_buffer->idx]) {
+ if (wl_egl_buffer->idx >= 0 && wl_egl_surface->buffers[wl_egl_buffer->idx]) {
wl_egl_surface->buffers[wl_egl_buffer->idx] = NULL;
wl_egl_surface->buffer_cnt--;