}
/* LCOV_EXCL_STOP */
bo->bo_data = bo_data;
- bo->allocated_hal_tbm_bo = 1;
} else if (bufmgr->backend_module_data) {
bo_data = bufmgr->bufmgr_func->bufmgr_alloc_bo(bufmgr->bufmgr_data, (unsigned int)size, flags, &error);
if (!bo_data) {
bo_priv = bufmgr->backend->bo_alloc(bo, size, flags);
if (!bo_priv) {
/* LCOV_EXCL_START */
-
_tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
goto alloc_fail;
/* LCOV_EXCL_STOP */
/* LCOV_EXCL_START */
if (!bufmgr->use_hal_tbm) {
if (!bufmgr->backend_module_data || !bufmgr->bufmgr_func->bufmgr_alloc_bo_with_format) {
-
TBM_ERR("error: not supported tbm_bo_alloc_with_format\n");
_tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
goto bo_alloc_fail;
}
goto bo_alloc_fail;
}
+ bo->bo_data = bo_data;
} else {
bo_data = bufmgr->bufmgr_func->bufmgr_alloc_bo_with_format(bufmgr->bufmgr_data, format, bo_idx,
width, height, flags, error);
_tbm_set_last_result(*error);
goto bo_alloc_fail;
}
+ bo->bo_data = bo_data;
}
- bo->bo_data = bo_data;
_tbm_bo_init(bufmgr, bo, flags);
_tbm_bufmgr_mutex_unlock();
}
goto bo_alloc_fail;
}
+ bo->bo_data = bo_data;
} else {
bo_data = bufmgr->bufmgr_func->bufmgr_alloc_bo_with_tiled_format(bufmgr->bufmgr_data, width, height,
bpp, format, flags, bo_idx, error);
_tbm_set_last_result(*error);
goto bo_alloc_fail;
}
+ bo->bo_data = bo_data;
}
- bo->bo_data = bo_data;
_tbm_bo_init(bufmgr, bo, flags);
_tbm_bufmgr_mutex_unlock();
_tbm_util_check_bo_cnt(bufmgr);
+ bo->get_from_hal_surface = 1;
bo->bo_data = bo_data;
_tbm_bo_init(bufmgr, bo, flags);
/* call the bo_free */
if (bo->bufmgr->use_hal_tbm) {
// call hal_tbm_bo_free when bo is created by tbm_bo_alloc api.
- if (bo->allocated_hal_tbm_bo) {
+ if (!bo->get_from_hal_surface) {
+ bo->get_from_hal_surface = 0;
+
hal_tbm_bo_free(bo->bo_data);
bo->bo_data = NULL;
- bo->allocated_hal_tbm_bo = 0;
}
} else if (bo->bufmgr->backend_module_data) {
bo->bufmgr->bo_func->bo_free(bo->bo_data);