typedef struct _tbm_module {
tbm_module_type type;
+ int support_surface_data;
void *module_data; /* backend module */
tbm_bufmgr_backend backend; /* bufmgr backend (will be DEPRECATED) */
hal_tbm_bufmgr *hal_bufmgr; /* hal-api-tbm bufmgr */
} tbm_module;
-typedef struct _tbm_backend_surface_data {
+typedef struct _tbm_surface_data {
tbm_module *module;
hal_tbm_surface *hal_surface;
-} tbm_backend_surface_data;
+} tbm_surface_data;
+
+typedef struct _tbm_bo_data {
+ tbm_module *module;
+ hal_tbm_bo *hal_bo;
+ tbm_backend_bo_data *backend_bo_data;
+ void *priv;
+} tbm_bo_data;
/* tbm_module functions */
tbm_module *tbm_module_load(int fd);
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_surface_data *tbm_module_import_surface_data(tbm_module *module, int width, int height, int format, tbm_surface_buffer_data *buffer_data, 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);
-tbm_backend_bo_data *tbm_module_import_bo_data_with_key(tbm_module *module, tbm_bo bo, tbm_key key, tbm_error_e *error);
-
-void tbm_surface_data_free(tbm_backend_surface_data *surface_data);
-
-void tbm_module_bo_free(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int get_from_hal_surface);
-int tbm_module_bo_get_size(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, tbm_error_e *error);
-int tbm_module_bo_get_memory_types(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, tbm_error_e *error);
-tbm_bo_handle tbm_module_bo_get_handle(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int device, tbm_error_e *error);
-tbm_bo_handle tbm_module_bo_map(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int device, int opt, tbm_error_e *error);
-tbm_error_e tbm_module_bo_unmap(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data);
-tbm_error_e tbm_module_bo_lock(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, int device, int opt);
-tbm_error_e tbm_module_bo_unlock(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data);
-tbm_fd tbm_module_bo_export_fd(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, tbm_error_e *error);
-tbm_key tbm_module_bo_export_key(tbm_module *module, tbm_bo bo, tbm_backend_bo_data *bo_data, tbm_error_e *error);
+int tbm_module_support_surface_data(tbm_module *module);
+
+tbm_surface_data *tbm_module_alloc_surface_data(tbm_module *module, int width, int height, int format, int flags, tbm_error_e *error);
+tbm_surface_data *tbm_module_import_surface_data(tbm_module *module, int width, int height, int format, tbm_surface_buffer_data *buffer_data, tbm_error_e *error);
+
+tbm_bo_data *tbm_module_alloc_bo_data(tbm_module *module, tbm_bo bo, int size, int flags, tbm_error_e *error);
+tbm_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_bo_data *tbm_module_import_bo_data_with_fd(tbm_module *module, tbm_bo bo, tbm_fd fd, tbm_error_e *error);
+tbm_bo_data *tbm_module_import_bo_data_with_key(tbm_module *module, tbm_bo bo, tbm_key key, tbm_error_e *error);
+int tbm_module_compare_bo_data(tbm_module *module, tbm_bo_data *bo_data1, tbm_bo_data *bo_data2);
+
+void tbm_surface_data_free(tbm_surface_data *surface_data);
+tbm_error_e tbm_surface_data_get_plane_data(tbm_surface_data *surface_data, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
+tbm_bo_data **tbm_surface_data_get_bo_data_array(tbm_surface_data *surface_data, int *num_bos, tbm_error_e *error);
+tbm_surface_buffer_data *tbm_surface_data_export(tbm_surface_data *surface_data, tbm_error_e *error);
+
+void tbm_bo_data_free(tbm_bo_data *bo_data, int get_from_surface_data);
+int tbm_bo_data_get_size(tbm_bo_data *bo_data, tbm_error_e *error);
+int tbm_bo_data_get_memory_types(tbm_bo_data *bo_data, tbm_error_e *error);
+tbm_bo_handle tbm_bo_data_get_handle(tbm_bo_data *bo_data, int device, tbm_error_e *error);
+tbm_bo_handle tbm_bo_data_map(tbm_bo_data *bo_data, int device, int opt, tbm_error_e *error);
+tbm_error_e tbm_bo_data_unmap(tbm_bo_data *bo_data);
+tbm_error_e tbm_bo_data_lock(tbm_bo_data *bo_data, int device, int opt);
+tbm_error_e tbm_bo_data_unlock(tbm_bo_data *bo_data);
+tbm_fd tbm_bo_data_export_fd(tbm_bo_data *bo_data, tbm_error_e *error);
+tbm_key tbm_bo_data_export_key(tbm_bo_data *bo_data, tbm_error_e *error);
#endif // _TBM_MODULE_H_