tbm_bufmgr: change tbm_bo_alloc_with_format name
[platform/core/uifw/libtbm.git] / src / tbm_surface_internal.c
index 3f292d7..8c6fc39 100644 (file)
@@ -320,7 +320,6 @@ _tbm_surface_internal_query_plane_data(tbm_surface_h surface,
 
        struct _tbm_surface *surf = (struct _tbm_surface *)surface;
        struct _tbm_bufmgr *bufmgr = surf->bufmgr;
-       int ret = 0;
        tbm_error_e error;
 
        TBM_RETURN_VAL_IF_FAIL(bufmgr != NULL, 0);
@@ -328,54 +327,13 @@ _tbm_surface_internal_query_plane_data(tbm_surface_h surface,
        TBM_RETURN_VAL_IF_FAIL(surf->info.height > 0, 0);
        TBM_RETURN_VAL_IF_FAIL(surf->info.format > 0, 0);
 
-       if (bufmgr->use_hal_tbm) {
-               error = (tbm_error_e)hal_tbm_bufmgr_get_plane_data(bufmgr->hal_bufmgr, (hal_tbm_format)surf->info.format,
-                                                               plane_idx, surf->info.width, surf->info.height, size, offset, pitch, bo_idx);
-               /* LCOV_EXCL_START */
-               if (error == TBM_ERROR_NOT_SUPPORTED) {
-                       _tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
-                       return 0;
-               } else if (error != TBM_ERROR_NONE) {
-                       TBM_ERR("Fail to surface_get_plane_data. surface(%p) error(%d)\n", surface, error);
-                       _tbm_set_last_result(error);
-                       return 0;
-               }
-               /* LCOV_EXCL_STOP */
-               ret = 1;
-       } else if (bufmgr->backend_module_data) {
-               if (!bufmgr->bufmgr_func->bufmgr_get_plane_data) {
-                       _tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
-                       return 0;
-               }
-
-               error = bufmgr->bufmgr_func->bufmgr_get_plane_data(bufmgr->bufmgr_data, surf->info.format, plane_idx,
-                                               surf->info.width, surf->info.height, size, offset, pitch, bo_idx);
-               if (error != TBM_ERROR_NONE) {
-                       /* LCOV_EXCL_START */
-                       TBM_ERR("Fail to surface_get_plane_data. surface(%p) error(%d)\n", surface, error);
-                       _tbm_set_last_result(error);
-                       return 0;
-                       /* LCOV_EXCL_STOP */
-               }
-               ret = 1;
-       } else {
-               if (!bufmgr->backend->surface_get_plane_data) {
-                       _tbm_set_last_result(TBM_ERROR_NOT_SUPPORTED);
-                       return 0;
-               }
-
-               ret = bufmgr->backend->surface_get_plane_data(surf->info.width,
-                               surf->info.height, surf->info.format, plane_idx, size, offset, pitch, bo_idx);
-               if (!ret) {
-                       /* LCOV_EXCL_START */
-                       TBM_ERR("Fail to surface_get_plane_data. surface(%p)\n", surface);
-                       _tbm_set_last_result(TBM_ERROR_INVALID_OPERATION);
-                       return 0;
-                       /* LCOV_EXCL_STOP */
-               }
+       error = tbm_module_bufmgr_get_plane_data(bufmgr->module, surf->info.format, plane_idx, surf->info.width, surf->info.height, size, offset, pitch, bo_idx);
+       if (error != TBM_ERROR_NONE) {
+               _tbm_set_last_result(error);
+               return 0;
        }
 
-       return ret;
+       return 1;
 }
 
 static void
@@ -703,7 +661,7 @@ _tbm_surface_internal_create_surface(tbm_bufmgr bufmgr, int width, int height, i
                                bo_size += surf->info.planes[j].size;
                }
 
-               surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp/8, flags, error);
+               surf->bos[i] = tbm_bufmgr_internal_alloc_bo_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]) {
@@ -848,7 +806,7 @@ _tbm_surface_internal_hal_tbm_create_surface(tbm_bufmgr bufmgr, int width, int h
                                        bo_size += surf->info.planes[j].size;
                        }
 
-                       surf->bos[i] = tbm_bo_alloc_with_format(bufmgr, format, i, width, height, surf->info.bpp / 8, flags, error);
+                       surf->bos[i] = tbm_bufmgr_internal_alloc_bo_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]) {