if (sync_fence)
*sync_fence = -1;
+ TPL_OBJECT_UNLOCK(surface);
+ while (!tbm_surface_queue_can_dequeue(wayland_egl_surface->tbm_queue, 0)) {
+ /* waiting for dequeueable */
+ }
+ TPL_OBJECT_LOCK(surface);
+
+ /* After the can dequeue state, call twe_display_lock to prevent other
+ * events from being processed in wayland_egl_thread
+ * during below dequeue procedure. */
+ lock_ret = twe_display_lock(wayland_egl_display->twe_display);
+
/* wayland client can check their states (ACTIVATED or DEACTIVATED) with
* below function [wayland_tbm_client_queue_check_activate()].
* This function has to be called before tbm_surface_queue_dequeue()
"[DEQ]~[ENQ] BO_NAME:%d",
tbm_bo_export(tbm_surface_internal_get_bo(
surface->frontbuffer, 0)));
+ if (lock_ret == TPL_ERROR_NONE)
+ twe_display_unlock(wayland_egl_display->twe_display);
return surface->frontbuffer;
} else
surface->frontbuffer = NULL;
surface->frontbuffer = NULL;
}
- TPL_OBJECT_UNLOCK(surface);
- while (!tbm_surface_queue_can_dequeue(wayland_egl_surface->tbm_queue, 0)) {
-
- }
- TPL_OBJECT_LOCK(surface);
-
- lock_ret = twe_display_lock(wayland_egl_display->twe_display);
-
tsq_err = tbm_surface_queue_dequeue(wayland_egl_surface->tbm_queue,
&tbm_surface);
if (!tbm_surface) {
TPL_ERR("Failed to get tbm_surface from tbm_surface_queue | tsq_err = %d",
tsq_err);
- if (lock_ret) twe_display_unlock(wayland_egl_display->twe_display);
+ if (lock_ret == TPL_ERROR_NONE)
+ twe_display_unlock(wayland_egl_display->twe_display);
return NULL;
}