#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);
};
/**
#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
}
#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;
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) {
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)
}
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)
}
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)
}
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)
}
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)
}
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)
}
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)