return error;
}
+tbm_backend_surface_data *
+tbm_module_alloc_surface_data(tbm_module *module, int width, int height, int format, int flags, tbm_error_e *error)
+{
+ tbm_backend_surface_data *surface_data = NULL;
+
+ TBM_RETURN_VAL_SET_ERR_IF_FAIL(module, NULL, *error, TBM_ERROR_INVALID_PARAMETER);
+ TBM_RETURN_VAL_SET_ERR_IF_FAIL(module->type == TBM_MODULE_TYPE_HAL_TBM, NULL, *error, TBM_ERROR_INVALID_OPERATION);
+
+ surface_data = calloc(1, sizeof(struct _tbm_backend_surface_data));
+ if (!surface_data) {
+ TBM_ERR("memory allocation failed.");
+ *error = TBM_ERROR_OUT_OF_MEMORY;
+ return NULL;
+ }
+
+ surface_data->hal_surface = hal_tbm_bufmgr_alloc_surface(module->hal_bufmgr,
+ (uint32_t)width,
+ (uint32_t)height,
+ (hal_tbm_format)format,
+ (hal_tbm_bo_memory_type)flags,
+ NULL,
+ 0,
+ (hal_tbm_error *)error);
+ if (!surface_data->hal_surface) {
+ TBM_ERR("hal_tbm_bufmgr_alloc_surface failed.");
+ *error = TBM_ERROR_INVALID_OPERATION;
+ free(surface_data);
+ return NULL;
+ }
+
+ surface_data->module = module;
+
+ return surface_data;
+}
+
tbm_backend_bo_data *
tbm_module_alloc_bo_data(tbm_module *module, tbm_bo bo, int size, int flags, tbm_error_e *error)
{
}
return ret;
-}
\ No newline at end of file
+}
tbm_error_e tbm_module_bind_native_display(tbm_module *module, void *native_display);
tbm_error_e tbm_module_get_supported_formats(tbm_module *module, uint32_t **formats, uint32_t *num);
tbm_error_e tbm_module_get_plane_data(tbm_module *module, int format, int plane_idx, uint32_t w, uint32_t h, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
+
+tbm_backend_surface_data *tbm_module_alloc_surface_data(tbm_module *module, int width, int height, int format, int flags, tbm_error_e *error);
+
tbm_backend_bo_data *tbm_module_alloc_bo_data(tbm_module *module, tbm_bo bo, int size, int flags, tbm_error_e *error);
tbm_backend_bo_data *tbm_module_alloc_bo_data_with_format(tbm_module *module, int format, int bo_idx, int width, int height, int bpp, tbm_bo_memory_type flags, tbm_error_e *error);
tbm_backend_bo_data *tbm_module_import_bo_data_with_fd(tbm_module *module, tbm_bo bo, tbm_fd fd, tbm_error_e *error);