tsq_err = tbm_surface_queue_enqueue(wayland_egl_surface->tbm_queue,
tbm_surface);
- if (tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE) {
- /*
- * If tbm_surface_queue has not been reset, tbm_surface_queue_enqueue
- * will return ERROR_NONE. Otherwise, queue has been reset
- * this tbm_surface may have only one ref_count. So we need to
- * unreference this tbm_surface after getting ERROR_NONE result from
- * tbm_surface_queue_enqueue in order to prevent destruction.
- */
+ if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) {
tbm_surface_internal_unref(tbm_surface);
- } else {
TPL_ERR("Failed to enqueue tbm_surface(%p). tsq_err=%d",
tbm_surface, tsq_err);
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
return TPL_ERROR_INVALID_OPERATION;
}
+ tbm_surface_internal_unref(tbm_surface);
+
TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
TPL_OBJECT_UNLOCK(wayland_egl_surface);