tbm_surface_internal: remove direct alls of backend functions 89/259889/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 15 Jun 2021 03:25:35 +0000 (12:25 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Tue, 15 Jun 2021 12:03:10 +0000 (21:03 +0900)
The tbm_bo_alloc_with_format calls tbm_module_bo_alloc_with_format.
The tbm_module_bo_alloc_with_format calls the backend functions.

Change-Id: Ic5cac77257e95e567367b6f16c395c55dd22beba

src/tbm_surface_internal.c

index d4fab86..3b88a08 100644 (file)
@@ -703,57 +703,13 @@ _tbm_surface_internal_create_surface(tbm_bufmgr bufmgr, int width, int height, i
                                bo_size += surf->info.planes[j].size;
                }
 
-               if (bufmgr->use_hal_tbm) {
-                       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) {
-                               surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags);
-                               if (!surf->bos[i]) {
-                                       TBM_ERR("fail to alloc bo idx:%d\n", i);
-                                       *error = tbm_get_last_error();
-                                       goto alloc_bo_fail;
-                               }
-                       }
-               } 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, surf->info.bpp/8, flags, error);
-                               if (!surf->bos[i]) {
-                                       TBM_ERR("fail to tbm_bo_alloc_with_format idx:%d\n", i);
-                                       *error = tbm_get_last_error();
-                                       goto alloc_bo_fail;
-                               }
-                               /* LCOV_EXCL_STOP */
-                       } else if (bufmgr->bufmgr_func->bufmgr_alloc_bo_with_tiled_format && (flags & TBM_BO_TILED)) {
-                               /* LCOV_EXCL_START */
-                               TBM_ERR("NOT SUPPORTED. idx:%d", i);
-                               *error = TBM_ERROR_NOT_SUPPORTED;
+               surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp/8, flags, error);
+               if (!surf->bos[i]) {
+                       surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags);
+                       if (!surf->bos[i]) {
+                               TBM_ERR("fail to alloc bo idx:%d\n", i);
+                               *error = tbm_get_last_error();
                                goto alloc_bo_fail;
-                               /* LCOV_EXCL_STOP */
-                       } else {
-                               surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags);
-                               if (!surf->bos[i]) {
-                                       TBM_ERR("fail to alloc bo idx:%d\n", i);
-                                       *error = tbm_get_last_error();
-                                       goto alloc_bo_fail;
-                               }
-                       }
-               } else {
-                       if (bufmgr->backend->surface_bo_alloc) {
-                               /* LCOV_EXCL_START */
-                               surf->bos[i] = tbm_bo_alloc_with_surface(bufmgr, width, height, format, flags, i);
-                               if (!surf->bos[i]) {
-                                       TBM_ERR("fail to tbm_bo_alloc_with_surface idx:%d\n", i);
-                                       *error = tbm_get_last_error();
-                                       goto alloc_bo_fail;
-                               /* LCOV_EXCL_STOP */
-                               }
-                       } else {
-                               surf->bos[i] = tbm_bo_alloc(bufmgr, bo_size, flags);
-                               if (!surf->bos[i]) {
-                                       TBM_ERR("fail to alloc bo idx:%d\n", i);
-                                       *error = tbm_get_last_error();
-                                       goto alloc_bo_fail;
-                               }
                        }
                }