}
static tbm_error_e
-_tbm_surface_internal_set_data(struct _tbm_surface *surf, int flags, int is_surface_data)
+_tbm_surface_internal_set_data(struct _tbm_surface *surf, int flags, int can_share_surface)
{
tbm_error_e error;
uint32_t size = 0, offset = 0, stride = 0, bo_size = 0;;
int memory_types;
// set data with surface
- if (is_surface_data) {
+ if (can_share_surface) {
// set infomation of planes
for (i = 0; i < surf->info.num_planes; i++) {
error = tbm_surface_data_get_plane_data(surf->surface_data, i, &size, &offset, &stride, &bo_idx);
return TBM_ERROR_NONE;
failed:
- if (is_surface_data) {
+ if (can_share_surface) {
for (j = 0; j < num_bos; j++) {
if (bo_data_array[j]) {
free(bo_data_array[j]);
_tbm_surface_internal_create_surface(tbm_bufmgr bufmgr, int width, int height, int format, int flags, tbm_error_e *error)
{
struct _tbm_surface *surf;
- int is_surface_data = 0;
+ int can_share_surface = 0;
surf = _tbm_surface_internal_alloc(bufmgr, width, height, format, error);
if (!surf) {
/* LCOV_EXCL_STOP */
}
- is_surface_data = tbm_module_support_surface_data(bufmgr->module);
- if (is_surface_data) {
+ can_share_surface = tbm_bufmgr_internal_support_capabilites(bufmgr, TBM_BUFMGR_CAPABILITY_SHARE_SURFACE);
+ if (can_share_surface) {
// alloc surface_data
surf->surface_data = tbm_module_alloc_surface_data(bufmgr->module, width, height, format, flags, error);
if (!surf->surface_data) {
}
// set the surface data
- *error = _tbm_surface_internal_set_data(surf, flags, is_surface_data);
+ *error = _tbm_surface_internal_set_data(surf, flags, can_share_surface);
if (*error != TBM_ERROR_NONE) {
tbm_surface_data_free(surf->surface_data);
surf->surface_data = NULL;
TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION);
// this function supports when the module suppport surface_data.
- TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
+ TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_bufmgr_internal_support_capabilites(bufmgr, TBM_BUFMGR_CAPABILITY_SHARE_SURFACE), NULL, error, TBM_ERROR_NOT_SUPPORTED);
TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(_tbm_surface_internal_is_valid(surface), NULL, error, TBM_ERROR_INVALID_PARAMETER);
TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(bufmgr != NULL, NULL, error, TBM_ERROR_INVALID_OPERATION);
// this function supports when the module suppport surface_data.
- TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_module_support_surface_data(bufmgr->module), NULL, error, TBM_ERROR_NOT_SUPPORTED);
+ TBM_SURFACE_RETURN_VAL_SET_ERR_NO_LOG_IF_FAIL(tbm_bufmgr_internal_support_capabilites(bufmgr, TBM_BUFMGR_CAPABILITY_SHARE_SURFACE), NULL, error, TBM_ERROR_NOT_SUPPORTED);
TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info != NULL, NULL, error, TBM_ERROR_INVALID_PARAMETER);
TBM_SURFACE_RETURN_VAL_SET_ERR_IF_FAIL(surface_info->width > 0, NULL, error, TBM_ERROR_INVALID_PARAMETER);