change name of functions, variables and definitions 75/253075/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 4 Feb 2021 06:43:09 +0000 (15:43 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 4 Feb 2021 07:28:08 +0000 (16:28 +0900)
Change-Id: If30f87087b3418b9514e8cec94d1a9eb78f6c44c

include/hal-tbm-interface.h
include/hal-tbm-types.h
include/hal-tbm.h
src/hal-api-tbm.c

index ddb4561..f0a961a 100644 (file)
@@ -39,42 +39,45 @@ extern "C" {
 
 #include <hal-tbm-types.h>
 
+typedef struct _hal_tbm_backend_data hal_tbm_backend_data;
+
 typedef struct _hal_tbm_bufmgr_funcs hal_tbm_bufmgr_funcs;
-typedef struct _hal_tbm_bo_funcs    hal_tbm_bo_funcs;
+typedef struct _hal_tbm_bo_funcs     hal_tbm_bo_funcs;
 
 struct _hal_tbm_backend_data {
-       hal_tbm_bufmgr_data *bufmgr_data; // handle for calling the hal_tbm_bufmgr_funcs
+       hal_tbm_bufmgr *bufmgr; // handle
+
        hal_tbm_bufmgr_funcs *bufmgr_funcs;
-       hal_tbm_bo_funcs *bo_funcs;
+       hal_tbm_bo_funcs     *bo_funcs;
 };
 
 struct _hal_tbm_bufmgr_funcs {
        /* tbm_bufmgr_func */
-       hal_tbm_bufmgr_capability (*bufmgr_get_capabilities)(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_error *error);
-       hal_tbm_error (*bufmgr_bind_native_display)(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_native_display *native_display);
-       hal_tbm_error (*bufmgr_get_supported_formats)(hal_tbm_bufmgr_data *bufmgr_data, uint32_t **formats, uint32_t *num);
-       hal_tbm_error (*bufmgr_get_plane_data)(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_format format, int plane_idx, int width, int height,
+       hal_tbm_bufmgr_capability (*bufmgr_get_capabilities)(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
+       hal_tbm_error (*bufmgr_bind_native_display)(hal_tbm_bufmgr *bufmgr, hal_tbm_native_display *native_display);
+       hal_tbm_error (*bufmgr_get_supported_formats)(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num);
+       hal_tbm_error (*bufmgr_get_plane_data)(hal_tbm_bufmgr *bufmgr, hal_tbm_format format, int plane_idx, int width, int height,
                                                                                uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
-       hal_tbm_bo_data *(*bufmgr_alloc_bo)(hal_tbm_bufmgr_data *bufmgr_data, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
-       hal_tbm_bo_data *(*bufmgr_alloc_bo_with_format)(hal_tbm_bufmgr_data *bufmgr_data, int format, int bo_idx, int width, int height,
+       hal_tbm_bo *(*bufmgr_alloc_bo)(hal_tbm_bufmgr *bufmgr, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+       hal_tbm_bo *(*bufmgr_alloc_bo_with_format)(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height,
                                                                                hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
-       hal_tbm_bo_data *(*bufmgr_alloc_bo_with_tiled_format)(hal_tbm_bufmgr_data *bufmgr_data, int width, int height, int bpp, int format,
+       hal_tbm_bo *(*bufmgr_alloc_bo_with_tiled_format)(hal_tbm_bufmgr *bufmgr, int width, int height, int bpp, int format,
                                                                                hal_tbm_bo_memory_type flags, int bo_idx, hal_tbm_error *error);
-       hal_tbm_bo_data *(*bufmgr_import_fd)(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_fd fd, hal_tbm_error *error);
-       hal_tbm_bo_data *(*bufmgr_import_key)(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_key key, hal_tbm_error *error);
+       hal_tbm_bo *(*bufmgr_import_fd)(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error);
+       hal_tbm_bo *(*bufmgr_import_key)(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error);
 };
 
 struct _hal_tbm_bo_funcs {
-       void (*bo_free)(hal_tbm_bo_data *bo_data);
-       int (*bo_get_size)(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-       hal_tbm_bo_memory_type (*bo_get_memory_types)(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-       hal_tbm_bo_handle (*bo_get_handle)(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_error *error);
-       hal_tbm_bo_handle (*bo_map)(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error);
-       hal_tbm_error (*bo_unmap)(hal_tbm_bo_data *bo_data);
-       hal_tbm_error (*bo_lock)(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
-       hal_tbm_error (*bo_unlock)(hal_tbm_bo_data *bo_data);
-       hal_tbm_fd (*bo_export_fd)(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-       hal_tbm_key (*bo_export_key)(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
+       void (*bo_free)(hal_tbm_bo *bo);
+       int (*bo_get_size)(hal_tbm_bo *bo, hal_tbm_error *error);
+       hal_tbm_bo_memory_type (*bo_get_memory_types)(hal_tbm_bo *bo, hal_tbm_error *error);
+       hal_tbm_bo_handle (*bo_get_handle)(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error);
+       hal_tbm_bo_handle (*bo_map)(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error);
+       hal_tbm_error (*bo_unmap)(hal_tbm_bo *bo);
+       hal_tbm_error (*bo_lock)(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
+       hal_tbm_error (*bo_unlock)(hal_tbm_bo *bo);
+       hal_tbm_fd (*bo_export_fd)(hal_tbm_bo *bo, hal_tbm_error *error);
+       hal_tbm_key (*bo_export_key)(hal_tbm_bo *bo, hal_tbm_error *error);
 };
 
 /**
index c9ec0b1..b054f24 100644 (file)
@@ -30,8 +30,8 @@
  *
 **************************************************************************/
 
-#ifndef _HAL_TBM_TYPES_H_
-#define _HAL_TBM_TYPES_H_
+#ifndef __HAL_TBM_TYPES_H__
+#define __HAL_TBM_TYPES_H__
 
 #include <stdint.h>
 #include <unistd.h>
@@ -140,19 +140,19 @@ typedef union _hal_tbm_bo_handle {
 } hal_tbm_bo_handle;
 
 /**
- * @brief Definition for hal_tbm_backend_data handle
+ * @brief Definition for hal_tbm_backend handle
  */
-typedef struct _hal_tbm_backend_data hal_tbm_backend_data;
+typedef void hal_tbm_backend;
 
 /**
- * @brief Definition for hal_tbm_bufmgr_data handle created by hal tbm backend
+ * @brief Definition for hal_tbm_bufmgr handle created by hal tbm backend
  */
-typedef void hal_tbm_bufmgr_data;
+typedef void hal_tbm_bufmgr;
 
 /**
  * @brief Definition for the tizen buffer object
  */
-typedef void hal_tbm_bo_data;
+typedef void hal_tbm_bo;
 
 /**
  * @brief Definition for native display (wl_display in tizen)
@@ -462,4 +462,4 @@ typedef uint32_t hal_tbm_format;
 }
 #endif
 
-#endif /* _HAL_TBM_TYPES_H_ */
+#endif /* __HAL_TBM_TYPES_H__ */
index 158e180..c02a2e0 100644 (file)
@@ -39,35 +39,38 @@ extern "C" {
 
 #include <hal-tbm-types.h>
 
-hal_tbm_backend_data *hal_tbm_get_backend(hal_tbm_error *error);
-hal_tbm_error         hal_tbm_put_backend(hal_tbm_backend_data *backend_data);
-hal_tbm_bufmgr_data  *hal_tbm_get_bufmgr_data(hal_tbm_backend_data *backend_data);
+/* hal_tbm */
+hal_tbm_backend  *hal_tbm_get_backend(hal_tbm_error *error);
+hal_tbm_error     hal_tbm_put_backend(hal_tbm_backend *backend_data);
+
+/* hal_tbm_backend */
+hal_tbm_bufmgr   *hal_tbm_backend_get_bufmgr(hal_tbm_backend *backend, hal_tbm_error *error);
 
 /* hal_tbm_bufmgr_funcs */
-hal_tbm_bufmgr_capability   hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_error *error);
-hal_tbm_error               hal_tbm_bufmgr_bind_native_display(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_native_display *native_display);
-hal_tbm_error               hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr_data *bufmgr_data, uint32_t **formats, uint32_t *num);
-hal_tbm_error               hal_tbm_bufmgr_get_plane_data(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_format format, int plane_idx, int width, int height,
-                                                                                        uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
-hal_tbm_bo_data            *hal_tbm_bufmgr_alloc_bo(hal_tbm_bufmgr_data *bufmgr_data, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
-hal_tbm_bo_data            *hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr_data *bufmgr_data, int format, int bo_idx, int width, int height,
-                                                                                            hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
-hal_tbm_bo_data            *hal_tbm_bufmgr_alloc_bo_with_tiled_format(hal_tbm_bufmgr_data *bufmgr_data, int width, int height, int bpp, int format,
-                                                                                            hal_tbm_bo_memory_type flags, int bo_idx, hal_tbm_error *error);
-hal_tbm_bo_data            *hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_fd fd, hal_tbm_error *error);
-hal_tbm_bo_data            *hal_tbm_bufmgr_import_key(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_key key, hal_tbm_error *error);
+hal_tbm_bufmgr_capability  hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
+hal_tbm_error              hal_tbm_bufmgr_bind_native_display(hal_tbm_bufmgr *bufmgr, hal_tbm_native_display *native_display);
+hal_tbm_error              hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num);
+hal_tbm_error              hal_tbm_bufmgr_get_plane_data(hal_tbm_bufmgr *bufmgr, hal_tbm_format format, int plane_idx, int width, int height,
+                                          uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
+hal_tbm_bo                *hal_tbm_bufmgr_alloc_bo(hal_tbm_bufmgr *bufmgr, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+hal_tbm_bo                *hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height,
+                                          hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+hal_tbm_bo                *hal_tbm_bufmgr_alloc_bo_with_tiled_format(hal_tbm_bufmgr *bufmgr, int width, int height, int bpp, int format,
+                                          hal_tbm_bo_memory_type flags, int bo_idx, hal_tbm_error *error);
+hal_tbm_bo                *hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error);
+hal_tbm_bo                *hal_tbm_bufmgr_import_key(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error);
 
 /* hal_tbm_bo_funcs*/
-void                        hal_tbm_bo_free(hal_tbm_bo_data *bo_data);
-int                         hal_tbm_bo_get_size(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-hal_tbm_bo_memory_type      hal_tbm_bo_get_memory_types(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-hal_tbm_bo_handle           hal_tbm_bo_get_handle(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_error *error);
-hal_tbm_bo_handle           hal_tbm_bo_map(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error);
-hal_tbm_error               hal_tbm_bo_unmap(hal_tbm_bo_data *bo_data);
-hal_tbm_error               hal_tbm_bo_lock(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
-hal_tbm_error               hal_tbm_bo_unlock(hal_tbm_bo_data *bo_data);
-hal_tbm_fd                  hal_tbm_bo_export_fd(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
-hal_tbm_key                 hal_tbm_bo_export_key(hal_tbm_bo_data *bo_data, hal_tbm_error *error);
+void                    hal_tbm_bo_free(hal_tbm_bo *bo);
+int                     hal_tbm_bo_get_size(hal_tbm_bo *bo, hal_tbm_error *error);
+hal_tbm_bo_memory_type  hal_tbm_bo_get_memory_types(hal_tbm_bo *bo, hal_tbm_error *error);
+hal_tbm_bo_handle       hal_tbm_bo_get_handle(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error);
+hal_tbm_bo_handle       hal_tbm_bo_map(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error);
+hal_tbm_error           hal_tbm_bo_unmap(hal_tbm_bo *bo);
+hal_tbm_error           hal_tbm_bo_lock(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
+hal_tbm_error           hal_tbm_bo_unlock(hal_tbm_bo *bo);
+hal_tbm_fd              hal_tbm_bo_export_fd(hal_tbm_bo *bo, hal_tbm_error *error);
+hal_tbm_key             hal_tbm_bo_export_key(hal_tbm_bo *bo, hal_tbm_error *error);
 
 #ifdef __cplusplus
 }
index 43be719..512e32e 100644 (file)
 
 #define BUFMGR_FUNC_ENTRY(__func__) \
        hal_tbm_bufmgr_funcs *bufmgr_funcs; \
-       if (!bufmgr_data) return HAL_TBM_ERROR_INVALID_PARAMETER; \
+       if (!bufmgr) return HAL_TBM_ERROR_INVALID_PARAMETER; \
        if (!g_hal_tbm_backend_data || !g_hal_tbm_backend_data->bufmgr_funcs) return HAL_TBM_ERROR_NOT_SUPPORTED; \
        bufmgr_funcs = g_hal_tbm_backend_data->bufmgr_funcs; \
        if (!bufmgr_funcs->__func__) return HAL_TBM_ERROR_NOT_SUPPORTED;
 
 #define BUFMGR_FUNC_ENTRY_NULL(__func__) \
        hal_tbm_bufmgr_funcs *bufmgr_funcs; \
-       if (!bufmgr_data) { if (error) *error = HAL_TBM_ERROR_INVALID_PARAMETER; return NULL; } \
+       if (!bufmgr) { if (error) *error = HAL_TBM_ERROR_INVALID_PARAMETER; return NULL; } \
        if (!g_hal_tbm_backend_data || !g_hal_tbm_backend_data->bufmgr_funcs) { if (error) *error = HAL_TBM_ERROR_NOT_SUPPORTED; return NULL; } \
        bufmgr_funcs = g_hal_tbm_backend_data->bufmgr_funcs; \
        if (!bufmgr_funcs->__func__) { if (error) *error = HAL_TBM_ERROR_NOT_SUPPORTED; return NULL; };
 
 #define BUFMGR_FUNC_ENTRY_GOTO(__func__, __goto__) \
        hal_tbm_bufmgr_funcs *bufmgr_funcs; \
-       if (!bufmgr_data) goto __goto__; \
+       if (!bufmgr) goto __goto__; \
        if (!g_hal_tbm_backend_data || !g_hal_tbm_backend_data->bufmgr_funcs) goto __goto__; \
        bufmgr_funcs = (hal_tbm_bufmgr_funcs *)g_hal_tbm_backend_data->bufmgr_funcs; \
        if (!bufmgr_funcs->__func__) goto __goto__;
 
 static hal_tbm_backend_data *g_hal_tbm_backend_data = NULL;
 
-EXTERN hal_tbm_backend_data *
+EXTERN hal_tbm_backend *
 hal_tbm_get_backend(hal_tbm_error *error)
 {
        hal_tbm_backend_data *backend_data;
@@ -130,23 +130,26 @@ hal_tbm_get_backend(hal_tbm_error *error)
                return NULL;
        }
 
-       g_hal_tbm_backend_data = backend_data;
+       g_hal_tbm_backend_data = (hal_tbm_backend_data *)backend_data;
 
        if (error)
                *error = HAL_TBM_ERROR_NONE;
 
        _I("hal_tbm_get_backend");
 
-       return backend_data;
+       return (hal_tbm_backend *)backend_data;
 }
 
 EXTERN hal_tbm_error
-hal_tbm_put_backend(hal_tbm_backend_data *backend_data)
+hal_tbm_put_backend(hal_tbm_backend *backend)
 {
+       hal_tbm_backend_data *backend_data = (hal_tbm_backend_data *)backend;
        int ret;
 
-       if (!g_hal_tbm_backend_data)
+       if (!backend_data && g_hal_tbm_backend_data != backend) {
+               _E("no backend_data\n");
                return HAL_TBM_ERROR_INVALID_OPERATION;
+       }
 
        ret = hal_common_put_backend(HAL_MODULE_TBM, NULL);
        if (ret < 0) {
@@ -161,32 +164,40 @@ hal_tbm_put_backend(hal_tbm_backend_data *backend_data)
        return HAL_TBM_ERROR_NONE;
 }
 
-EXTERN hal_tbm_bufmgr_data *
-hal_tbm_get_bufmgr_data(hal_tbm_backend_data *backend_data)
+EXTERN hal_tbm_bufmgr *
+hal_tbm_backend_get_bufmgr(hal_tbm_backend *backend, hal_tbm_error *error)
 {
-       hal_tbm_bufmgr_data *bufmgr_data;
+       hal_tbm_backend_data *backend_data = (hal_tbm_backend_data *)backend;
+       hal_tbm_bufmgr *bufmgr;
 
-       if (!g_hal_tbm_backend_data) {
+       if (!backend_data && g_hal_tbm_backend_data != backend_data) {
                _E("no backend_data\n");
+               if (error)
+                       *error = HAL_TBM_ERROR_INVALID_OPERATION;
                return NULL;
        }
 
-       bufmgr_data = g_hal_tbm_backend_data->bufmgr_data;
-       if (!bufmgr_data) {
-               _E("no bufmgr_data\n");
+       bufmgr = backend_data->bufmgr;
+       if (!bufmgr) {
+               _E("no bufmgr\n");
+               if (error)
+                       *error = HAL_TBM_ERROR_INVALID_OPERATION;
                return NULL;
        }
 
-       return bufmgr_data;
+       if (error)
+               *error = HAL_TBM_ERROR_NONE;
+
+       return bufmgr;
 }
 
 /* tbm_bufmgr_func */
 EXTERN hal_tbm_bufmgr_capability
-hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_error *error)
+hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_GOTO(bufmgr_get_capabilities, fail);
 
-       return bufmgr_funcs->bufmgr_get_capabilities((hal_tbm_bufmgr_data *)bufmgr_data, error);
+       return bufmgr_funcs->bufmgr_get_capabilities((hal_tbm_bufmgr *)bufmgr, error);
 
 fail:
        if (error)
@@ -196,88 +207,88 @@ fail:
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bufmgr_bind_native_display(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_native_display *native_display)
+hal_tbm_bufmgr_bind_native_display(hal_tbm_bufmgr *bufmgr, hal_tbm_native_display *native_display)
 {
        BUFMGR_FUNC_ENTRY(bufmgr_bind_native_display);
 
-       return bufmgr_funcs->bufmgr_bind_native_display((hal_tbm_bufmgr_data *)bufmgr_data, native_display);
+       return bufmgr_funcs->bufmgr_bind_native_display((hal_tbm_bufmgr *)bufmgr, native_display);
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr_data *bufmgr_data, uint32_t **formats, uint32_t *num)
+hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num)
 {
        BUFMGR_FUNC_ENTRY(bufmgr_get_supported_formats);
 
-       return bufmgr_funcs->bufmgr_get_supported_formats((hal_tbm_bufmgr_data *)bufmgr_data, formats, num);
+       return bufmgr_funcs->bufmgr_get_supported_formats((hal_tbm_bufmgr *)bufmgr, formats, num);
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bufmgr_get_plane_data(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_format format, int plane_idx, int width, int height,
+hal_tbm_bufmgr_get_plane_data(hal_tbm_bufmgr *bufmgr, hal_tbm_format format, int plane_idx, int width, int height,
                                                                        uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx)
 {
        BUFMGR_FUNC_ENTRY(bufmgr_get_plane_data);
 
-       return bufmgr_funcs->bufmgr_get_plane_data((hal_tbm_bufmgr_data *)bufmgr_data, format, plane_idx, width, height, size, offset, pitch, bo_idx);
+       return bufmgr_funcs->bufmgr_get_plane_data((hal_tbm_bufmgr *)bufmgr, format, plane_idx, width, height, size, offset, pitch, bo_idx);
 }
 
-EXTERN hal_tbm_bo_data *
-hal_tbm_bufmgr_alloc_bo(hal_tbm_bufmgr_data *bufmgr_data, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error)
+EXTERN hal_tbm_bo *
+hal_tbm_bufmgr_alloc_bo(hal_tbm_bufmgr *bufmgr, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_NULL(bufmgr_alloc_bo);
 
-       return bufmgr_funcs->bufmgr_alloc_bo((hal_tbm_bufmgr_data *)bufmgr_data, size, mem_types, error);
+       return bufmgr_funcs->bufmgr_alloc_bo((hal_tbm_bufmgr *)bufmgr, size, mem_types, error);
 }
 
-EXTERN hal_tbm_bo_data *
-hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr_data *bufmgr_data, int format, int bo_idx, int width, int height,
+EXTERN hal_tbm_bo *
+hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height,
                                                                        hal_tbm_bo_memory_type mem_types, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_NULL(bufmgr_alloc_bo_with_format);
 
-       return bufmgr_funcs->bufmgr_alloc_bo_with_format((hal_tbm_bufmgr_data *)bufmgr_data, format, bo_idx, width, height, mem_types, error);
+       return bufmgr_funcs->bufmgr_alloc_bo_with_format((hal_tbm_bufmgr *)bufmgr, format, bo_idx, width, height, mem_types, error);
 }
 
-EXTERN hal_tbm_bo_data *
-hal_tbm_bufmgr_alloc_bo_with_tiled_format(hal_tbm_bufmgr_data *bufmgr_data, int width, int height, int bpp, int format,
+EXTERN hal_tbm_bo *
+hal_tbm_bufmgr_alloc_bo_with_tiled_format(hal_tbm_bufmgr *bufmgr, int width, int height, int bpp, int format,
                                                                        hal_tbm_bo_memory_type flags, int bo_idx, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_NULL(bufmgr_alloc_bo_with_tiled_format);
 
-       return bufmgr_funcs->bufmgr_alloc_bo_with_tiled_format((hal_tbm_bufmgr_data *)bufmgr_data, width, height, bpp, format, flags, bo_idx, error);
+       return bufmgr_funcs->bufmgr_alloc_bo_with_tiled_format((hal_tbm_bufmgr *)bufmgr, width, height, bpp, format, flags, bo_idx, error);
 }
 
-EXTERN hal_tbm_bo_data *
-hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_fd fd, hal_tbm_error *error)
+EXTERN hal_tbm_bo *
+hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_NULL(bufmgr_import_fd);
 
-       return bufmgr_funcs->bufmgr_import_fd((hal_tbm_bufmgr_data *)bufmgr_data, fd, error);
+       return bufmgr_funcs->bufmgr_import_fd((hal_tbm_bufmgr *)bufmgr, fd, error);
 }
 
-EXTERN hal_tbm_bo_data *
-hal_tbm_bufmgr_import_key(hal_tbm_bufmgr_data *bufmgr_data, hal_tbm_key key, hal_tbm_error *error)
+EXTERN hal_tbm_bo *
+hal_tbm_bufmgr_import_key(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error)
 {
        BUFMGR_FUNC_ENTRY_NULL(bufmgr_import_key);
 
-       return bufmgr_funcs->bufmgr_import_key((hal_tbm_bufmgr_data *)bufmgr_data, key, error);
+       return bufmgr_funcs->bufmgr_import_key((hal_tbm_bufmgr *)bufmgr, key, error);
 }
 
 
 /* tbm_bo_func*/
 EXTERN void
-hal_tbm_bo_free(hal_tbm_bo_data *bo_data)
+hal_tbm_bo_free(hal_tbm_bo *bo)
 {
        BO_FUNC_ENTRY_VOID(bo_free);
 
-       bo_funcs->bo_free((hal_tbm_bo_data *)bo_data);
+       bo_funcs->bo_free((hal_tbm_bo *)bo);
 }
 
 EXTERN int
-hal_tbm_bo_get_size(hal_tbm_bo_data *bo_data, hal_tbm_error *error)
+hal_tbm_bo_get_size(hal_tbm_bo *bo, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_get_size, fail);
 
-       return bo_funcs->bo_get_size((hal_tbm_bo_data *)bo_data, error);
+       return bo_funcs->bo_get_size((hal_tbm_bo *)bo, error);
 
 fail:
        if (error)
@@ -287,11 +298,11 @@ fail:
 }
 
 EXTERN hal_tbm_bo_memory_type
-hal_tbm_bo_get_memory_types(hal_tbm_bo_data *bo_data, hal_tbm_error *error)
+hal_tbm_bo_get_memory_types(hal_tbm_bo *bo, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_get_memory_types, fail);
 
-       return bo_funcs->bo_get_memory_types((hal_tbm_bo_data *)bo_data, error);
+       return bo_funcs->bo_get_memory_types((hal_tbm_bo *)bo, error);
 
 fail:
        if (error)
@@ -301,11 +312,11 @@ fail:
 }
 
 EXTERN hal_tbm_bo_handle
-hal_tbm_bo_get_handle(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_error *error)
+hal_tbm_bo_get_handle(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_get_handle, fail);
 
-       return bo_funcs->bo_get_handle((hal_tbm_bo_data *)bo_data, device, error);
+       return bo_funcs->bo_get_handle((hal_tbm_bo *)bo, device, error);
 
 fail:
        if (error)
@@ -315,11 +326,11 @@ fail:
 }
 
 EXTERN hal_tbm_bo_handle
-hal_tbm_bo_map(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error)
+hal_tbm_bo_map(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_map, fail);
 
-       return bo_funcs->bo_map((hal_tbm_bo_data *)bo_data, device, opt, error);
+       return bo_funcs->bo_map((hal_tbm_bo *)bo, device, opt, error);
 
 fail:
        if (error)
@@ -329,35 +340,35 @@ fail:
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bo_unmap(hal_tbm_bo_data *bo_data)
+hal_tbm_bo_unmap(hal_tbm_bo *bo)
 {
        BO_FUNC_ENTRY(bo_unmap);
 
-       return bo_funcs->bo_unmap((hal_tbm_bo_data *)bo_data);
+       return bo_funcs->bo_unmap((hal_tbm_bo *)bo);
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bo_lock(hal_tbm_bo_data *bo_data, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt)
+hal_tbm_bo_lock(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt)
 {
        BO_FUNC_ENTRY(bo_unmap);
 
-       return bo_funcs->bo_lock((hal_tbm_bo_data *)bo_data, device, opt);
+       return bo_funcs->bo_lock((hal_tbm_bo *)bo, device, opt);
 }
 
 EXTERN hal_tbm_error
-hal_tbm_bo_unlock(hal_tbm_bo_data *bo_data)
+hal_tbm_bo_unlock(hal_tbm_bo *bo)
 {
        BO_FUNC_ENTRY(bo_unmap);
 
-       return bo_funcs->bo_unlock((hal_tbm_bo_data *)bo_data);
+       return bo_funcs->bo_unlock((hal_tbm_bo *)bo);
 }
 
 EXTERN hal_tbm_fd
-hal_tbm_bo_export_fd(hal_tbm_bo_data *bo_data, hal_tbm_error *error)
+hal_tbm_bo_export_fd(hal_tbm_bo *bo, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_export_fd, fail);
 
-       return bo_funcs->bo_export_fd((hal_tbm_bo_data *)bo_data, error);
+       return bo_funcs->bo_export_fd((hal_tbm_bo *)bo, error);
 
 fail:
        if (error)
@@ -367,11 +378,11 @@ fail:
 }
 
 EXTERN hal_tbm_key
-hal_tbm_bo_export_key(hal_tbm_bo_data *bo_data, hal_tbm_error *error)
+hal_tbm_bo_export_key(hal_tbm_bo *bo, hal_tbm_error *error)
 {
        BO_FUNC_ENTRY_GOTO(bo_export_key, fail);
 
-       return bo_funcs->bo_export_key((hal_tbm_bo_data *)bo_data, error);
+       return bo_funcs->bo_export_key((hal_tbm_bo *)bo, error);
 
 fail:
        if (error)