TBM_BO_RETURN_VAL_IF_FAIL(_tbm_bo_is_valid(bo), (tbm_bo_handle) NULL);
- if (bo->bufmgr->use_hal_tbm) {
- hal_tbm_bo_handle hbo_handle;
- hbo_handle = hal_tbm_bo_get_handle((hal_tbm_bo *)bo->bo_data, device, (hal_tbm_error *)&error);
- if (hbo_handle.ptr == NULL) {
- /* LCOV_EXCL_START */
- TBM_ERR("error: bo(%p) bo_handle(%p) error(%d)\n", bo, hbo_handle.ptr, error);
- _tbm_set_last_result(error);
- goto bo_handle_fail;
- /* LCOV_EXCL_STOP */
- }
- memcpy(&bo_handle.ptr, &hbo_handle.ptr, sizeof(tbm_bo_handle));
- } else if (bo->bufmgr->backend_module_data) {
- bo_handle = bo->bufmgr->bo_func->bo_get_handle(bo->bo_data, device, &error);
- if (bo_handle.ptr == NULL) {
- /* LCOV_EXCL_START */
- TBM_ERR("error: bo(%p) bo_handle(%p) error(%d)\n", bo, bo_handle.ptr, error);
- _tbm_set_last_result(error);
- goto bo_handle_fail;
- /* LCOV_EXCL_STOP */
- }
- } else {
- bo_handle = bo->bufmgr->backend->bo_get_handle(bo, device);
- if (bo_handle.ptr == NULL) {
- /* LCOV_EXCL_START */
- TBM_ERR("error: bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
- _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
- goto bo_handle_fail;
- /* LCOV_EXCL_STOP */
- }
+ bo_handle = tbm_module_bo_get_handle(bo->bufmgr->module, bo, bo->bo_data, device, &error);
+ if (bo_handle.ptr == NULL) {
+ /* LCOV_EXCL_START */
+ TBM_ERR("error: bo(%p) bo_handle(%p) error(%d)\n", bo, bo_handle.ptr, error);
+ _tbm_set_last_result(error);
+ _tbm_bufmgr_mutex_unlock();
+ return (tbm_bo_handle)NULL;
+ /* LCOV_EXCL_STOP */
}
TBM_TRACE_BO("bo(%p) bo_handle(%p)\n", bo, bo_handle.ptr);
_tbm_bufmgr_mutex_unlock();
return bo_handle;
-
-bo_handle_fail:
- _tbm_bufmgr_mutex_unlock();
- return (tbm_bo_handle) NULL;
}
tbm_key