From: SooChan Lim Date: Fri, 19 Mar 2021 01:27:13 +0000 (+0900) Subject: tbm_bo : use hal_tbm_bufmgr_alloc_bo_with_format instead of hal_tbm_bufmgr_alloc_bo_w... X-Git-Tag: submit/tizen/20210319.034626~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Flibtbm.git;a=commitdiff_plain;h=efa51586ab7ea4911f2f26712a861d9a433cb4e2 tbm_bo : use hal_tbm_bufmgr_alloc_bo_with_format instead of hal_tbm_bufmgr_alloc_bo_with_tiled_format At hal_tbm, the backend consider if this tbm_bo is the tiled memory or not with hal_tbm_bo_memory_type. Therefore, remove the use of hal_tbm_bufmgr_alloc_bo_with_tiled_format api. This api is deprecated at hal tbm. Change-Id: I86a7561845312a0a5fccfddf9fce9ca39593a50c --- diff --git a/src/tbm_bo.c b/src/tbm_bo.c index b5d5b53..4e380ca 100644 --- a/src/tbm_bo.c +++ b/src/tbm_bo.c @@ -424,7 +424,7 @@ alloc_fail: /* LCOV_EXCL_START */ tbm_bo tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, - int height, tbm_bo_memory_type flags, tbm_error_e *error) + int height, int bpp, tbm_bo_memory_type flags, tbm_error_e *error) { tbm_bo bo; tbm_backend_bo_data *bo_data; @@ -458,7 +458,7 @@ tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, if (bufmgr->use_hal_tbm) { hal_tbm_error ret; bo_data = (tbm_backend_bo_data *)hal_tbm_bufmgr_alloc_bo_with_format(bufmgr->hal_bufmgr, - format, bo_idx, width, height, (hal_tbm_bo_memory_type)flags, &ret); + format, bo_idx, width, height, bpp, (hal_tbm_bo_memory_type)flags, &ret); if (error) *error = (tbm_error_e)ret; if (ret != HAL_TBM_ERROR_NONE) { @@ -528,7 +528,7 @@ tbm_bo_alloc_with_tiled_format(tbm_bufmgr bufmgr, int width, int height, int bpp if (bufmgr->use_hal_tbm) { hal_tbm_error ret; - bo_data = (tbm_backend_bo_data *)hal_tbm_bufmgr_alloc_bo_with_tiled_format(bufmgr->hal_bufmgr, + bo_data = (tbm_backend_bo_data *)hal_tbm_bufmgr_alloc_bo_with_format(bufmgr->hal_bufmgr, width, height, bpp, format, (hal_tbm_bo_memory_type)flags, bo_idx, &ret); if (error) *error = (tbm_error_e)ret; diff --git a/src/tbm_bufmgr_int.h b/src/tbm_bufmgr_int.h index fdbb16c..f2287d3 100644 --- a/src/tbm_bufmgr_int.h +++ b/src/tbm_bufmgr_int.h @@ -314,7 +314,7 @@ void _tbm_set_last_result(tbm_error_e err); void _tbm_bufmgr_mutex_lock(void); void _tbm_bufmgr_mutex_unlock(void); -tbm_bo tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, +tbm_bo tbm_bo_alloc_with_format(tbm_bufmgr bufmgr, int format, int bo_idx, int width, int bpp, int height, tbm_bo_memory_type flags, tbm_error_e *error); tbm_bo tbm_bo_alloc_with_tiled_format(tbm_bufmgr bufmgr, int width, int height, int bpp, int format, tbm_bo_memory_type flags, int bo_idx, tbm_error_e *error); diff --git a/src/tbm_surface_internal.c b/src/tbm_surface_internal.c index c104298..0618fe4 100644 --- a/src/tbm_surface_internal.c +++ b/src/tbm_surface_internal.c @@ -850,21 +850,9 @@ tbm_surface_internal_create_with_flags(int width, int height, } if (bufmgr->use_hal_tbm) { - surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, flags, &error); + surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp/8, flags, &error); if (error == TBM_ERROR_NOT_SUPPORTED) { - if (flags & TBM_BO_TILED) { - surf->bos[i] = tbm_bo_alloc_with_tiled_format(bufmgr, width, height, surf->info.bpp/8, format, flags, i, &error); - if (error == TBM_ERROR_NOT_SUPPORTED) { - surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags); - } else if (error != TBM_ERROR_NONE) { - TBM_ERR("fail to alloc bo idx:%d\n", i); - goto alloc_bo_fail; - } - } else { - surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags); - } - - if (!surf->bos[i]) { + if (error != TBM_ERROR_NONE) { TBM_ERR("fail to alloc bo idx:%d\n", i); goto alloc_bo_fail; } @@ -875,7 +863,7 @@ tbm_surface_internal_create_with_flags(int width, int height, } else if (bufmgr->backend_module_data) { if (bufmgr->bufmgr_func->bufmgr_alloc_bo_with_format) { /* LCOV_EXCL_START */ - surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, flags, &error); + surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp/8, flags, &error); if (!surf->bos[i]) { TBM_ERR("fail to tbm_bo_alloc_with_format idx:%d\n", i); goto alloc_bo_fail;