if (surf_source->in_use_buffers) {
TPL_OBJECT_LOCK(&surf_source->obj);
__tpl_list_push_back(surf_source->in_use_buffers,
- (void *)buf_info);
+ (void *)tbm_surface);
TPL_OBJECT_UNLOCK(&surf_source->obj);
}
if (surf_source->in_use_buffers) {
TPL_OBJECT_LOCK(&surf_source->obj);
__tpl_list_push_back(surf_source->in_use_buffers,
- (void *)buf_info);
+ (void *)tbm_surface);
TPL_OBJECT_UNLOCK(&surf_source->obj);
}
TPL_OBJECT_LOCK(&surf_source->obj);
/* Stop tracking of this canceled tbm_surface */
__tpl_list_remove_data(surf_source->in_use_buffers,
- (void *)buf_info, TPL_FIRST, NULL);
+ (void *)tbm_surface, TPL_FIRST, NULL);
TPL_OBJECT_UNLOCK(&surf_source->obj);
}
}
__tpl_list_push_back(surf_source->committed_buffers, tbm_surface);
/* Stop tracking of this released tbm_surface. */
__tpl_list_remove_data(surf_source->in_use_buffers,
- (void *)buf_info, TPL_FIRST, NULL);
+ (void *)tbm_surface, TPL_FIRST, NULL);
TPL_OBJECT_UNLOCK(&surf_source->obj);
}
}
return TPL_ERROR_INVALID_PARAMETER;
}
- /* Should be waited until all in_use_buffers has been retrieved. */
+ TPL_OBJECT_LOCK(&surf_source->obj);
while (!__tpl_list_is_empty(surf_source->in_use_buffers)) {
- sched_yield();
+ tbm_surface_h tbm_surface = (tbm_surface_h)__tpl_list_pop_front(
+ surf_source->in_use_buffers,
+ NULL);
+ tbm_surface_internal_unref(tbm_surface);
}
- TPL_OBJECT_LOCK(&surf_source->obj);
__tpl_list_free(surf_source->in_use_buffers, NULL);
TPL_OBJECT_UNLOCK(&surf_source->obj);