tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
if (wl_egl_surface->vblank && wl_egl_surface->vblank->waiting_buffers) {
- wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_pop_front(
- wl_egl_surface->vblank->waiting_buffers,
- NULL);
-
- if (wl_egl_buffer)
- _thread_wl_surface_commit(wl_egl_surface, wl_egl_buffer);
+ while (!__tpl_list_is_empty(wl_egl_surface->vblank->waiting_buffers)) {
+ wl_egl_buffer = (tpl_wl_egl_buffer_t *)__tpl_list_pop_front(
+ wl_egl_surface->vblank->waiting_buffers,
+ NULL);
+ if (wl_egl_buffer)
+ _thread_wl_surface_commit(wl_egl_surface, wl_egl_buffer);
+
+ /* If tdm error such as TIEMOUT occured,
+ * flush all vblank waiting buffers of its wl_egl_surface.
+ * Otherwise, only one wl_egl_buffer will be commited per one vblank event.
+ */
+ if (error == TDM_ERROR_NONE) break;
+ }
}
tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
}