Add description for doxygen 24/317224/4
authorjinbong.lee <jinbong.lee@samsung.com>
Fri, 13 Dec 2024 12:30:41 +0000 (21:30 +0900)
committerjinbong.lee <jinbong.lee@samsung.com>
Fri, 3 Jan 2025 03:36:14 +0000 (12:36 +0900)
Change-Id: I2b88e710377b8a8d9a29a5294607367a329c060e
Signed-off-by: jinbong.lee <jinbong.lee@samsung.com>
include/hal-tbm-interface-1.h
include/hal-tbm-types.h
include/hal-tbm.h

index 1287c419736825ba4320d0df90b4453e5656abf8..6cb552020b80baf1c6c9dbe0ff6859ebfd246e0b 100644 (file)
@@ -39,65 +39,164 @@ extern "C" {
 
 #include <hal-tbm-types.h>
 
+/**
+ * @addtogroup HALAPI_HAL_TBM_MODULE
+ * @{
+ */
+
+/**
+ * @brief The structure type of the tbm backend data.
+ * @since HAL_MODULE_TBM 1.0
+ * @see #_hal_tbm_backend_data
+ */
 typedef struct _hal_tbm_backend_data hal_tbm_backend_data;
 
+/**
+ * @brief The structure type of the TBM HAL's buffer management functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @see #_hal_tbm_bufmgr_funcs
+ */
 typedef struct _hal_tbm_bufmgr_funcs hal_tbm_bufmgr_funcs;
+
+/**
+ * @brief The structure type of the TBM HAL's surface functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @see #_hal_tbm_surface_funcs
+ */
 typedef struct _hal_tbm_surface_funcs   hal_tbm_surface_funcs;
+
+/**
+ * @brief The structure type of the TBM HAL's buffer object functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @see #_hal_tbm_bo_funcs
+ */
 typedef struct _hal_tbm_bo_funcs     hal_tbm_bo_funcs;
 
+/**
+ * @brief The Event handler function when drm file descriptor is authernticated.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] auth_fd authernticated drm file descriptor.
+ * @param[in] user_data The user data for handler.
+ * @pre hal_tbm_backend_set_authenticated_drm_fd() will invoke this handler.
+ * @see hal_tbm_backend_set_authenticated_drm_fd().
+ * @see hal_tbm_backend_get_master_drm_fd().
+ */
 typedef hal_tbm_error (*hal_tbm_authenticated_drm_fd_handler)(hal_tbm_fd auth_fd, void *user_data);
 
+/**
+ * @brief The structure type of the tbm backend data.
+ * @since HAL_MODULE_TBM 1.0
+ */
 struct _hal_tbm_backend_data {
-       hal_tbm_bufmgr *bufmgr; // handle
+       hal_tbm_bufmgr *bufmgr;                                     /**< The handle of bufmgr */
 
-       int has_drm_device;
+       int has_drm_device;                                         /**< The flag of having drm device or not */
        struct {
-               hal_tbm_fd drm_fd;
-               int is_master;
-               hal_tbm_authenticated_drm_fd_handler auth_drm_fd_func;
-               void *user_data;
+               hal_tbm_fd drm_fd;                                       /**< The drm file descriptor */
+               int is_master;                                           /**< The flag of master or not */
+               hal_tbm_authenticated_drm_fd_handler auth_drm_fd_func;   /**< The Event handler function when drm file descriptor is authernticated. */
+               void *user_data;                                         /**< The user data for callback */
        } drm_info;
 
-       hal_tbm_bufmgr_funcs *bufmgr_funcs;
-       hal_tbm_surface_funcs *surface_funcs;
-       hal_tbm_bo_funcs     *bo_funcs;
+       hal_tbm_bufmgr_funcs  *bufmgr_funcs;                        /**< The buffer manager's functions of backend */
+       hal_tbm_surface_funcs *surface_funcs;                       /**< The TBM Surface's functions of backend */
+       hal_tbm_bo_funcs      *bo_funcs;                            /**< The TBM Buffer Object's functions of backend */
 };
 
+
+/**
+ * @brief The structure type of the TBM HAL's buffer management functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ */
 struct _hal_tbm_bufmgr_funcs {
-       /* tbm_bufmgr_func */
+       /**< Get the capabilities of a buffer manager */
        hal_tbm_bufmgr_capability (*bufmgr_get_capabilities)(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
+
+       /**< Get supported color format from TBM buffer manger. */
        hal_tbm_error (*bufmgr_get_supported_formats)(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num);
+
+       /**< Get plane's information from TBM buffer manger HAL according to the color format */
        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);
+
+       /**< Allocate the surface according to the color format. */
        hal_tbm_surface *(*bufmgr_alloc_surface)(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format, hal_tbm_bo_memory_type mem_types, uint64_t *modifiers, uint32_t num_modifiers, hal_tbm_error *error);
+
+       /**< Import the surface according to the format. */
        hal_tbm_surface *(*bufmgr_import_surface)(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format, hal_tbm_surface_buffer_data *buffer_data, hal_tbm_error *error);
+
+       /**< Allocate the buffer object. */
        hal_tbm_bo *(*bufmgr_alloc_bo)(hal_tbm_bufmgr *bufmgr, unsigned int size, hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+
+       /**< Allocate the buffer object at buffer object index in surface according to the format. */
        hal_tbm_bo *(*bufmgr_alloc_bo_with_format)(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height, int bpp,
                                                                                hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+
+       /**< Import the buffer object associated with the tbm_fd(prime fd). */
        hal_tbm_bo *(*bufmgr_import_fd)(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error);
+
+       /**< Import the buffer object associated with the tbm_key */
        hal_tbm_bo *(*bufmgr_import_key)(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error);
 };
 
+/**
+ * @brief The structure type of the TBM HAL's surface functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ */
 struct _hal_tbm_surface_funcs {
-       void                           (*surface_free) (hal_tbm_surface *surface);
-       hal_tbm_bo                   **(*surface_get_bos)(hal_tbm_surface *surface, int *num_bos, hal_tbm_error *error);
-       hal_tbm_error                  (*surface_get_plane_data)(hal_tbm_surface *surface, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
-       hal_tbm_surface_buffer_data   *(*surface_export)(hal_tbm_surface *surface, hal_tbm_error *error);
+       /**< Deallocate tbm_surface using backend's surface free function. */
+       void (*surface_free) (hal_tbm_surface *surface);
+
+       /**< Get the number of buffer objects associated with the tbm_surface. */
+       hal_tbm_bo **(*surface_get_bos)(hal_tbm_surface *surface, int *num_bos, hal_tbm_error *error);
+
+       /**< Get size, offset, pitch, buffer object index related with plane_index from tbm_surface. */
+       hal_tbm_error (*surface_get_plane_data)(hal_tbm_surface *surface, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
+
+       /**< Export a buffer_data of tbm_surface. */
+       hal_tbm_surface_buffer_data *(*surface_export)(hal_tbm_surface *surface, hal_tbm_error *error);
 };
 
+/**
+ * @brief The structure type of the TBM HAL's buffer object functions of backend.
+ * @since HAL_MODULE_TBM 1.0
+ */
 struct _hal_tbm_bo_funcs {
+       /**< Free the buffer object. */
        void (*bo_free)(hal_tbm_bo *bo);
+
+       /**< Get the size of a buffer object. */
        int (*bo_get_size)(hal_tbm_bo *bo, hal_tbm_error *error);
+
+       /**< Get the memory type of buffer object */
        hal_tbm_bo_memory_type (*bo_get_memory_types)(hal_tbm_bo *bo, hal_tbm_error *error);
+
+       /**< Get the handle of TBM buffer object according to the device type. */
        hal_tbm_bo_handle (*bo_get_handle)(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error);
+
+       /**< Map the buffer object according to the device type and the option. */
        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);
+
+       /**< Unmap the buffer object. */
        hal_tbm_error (*bo_unmap)(hal_tbm_bo *bo);
+
+       /**< Lock the buffer object. */
        hal_tbm_error (*bo_lock)(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
+
+       /**< Unlock the buffer object. */
        hal_tbm_error (*bo_unlock)(hal_tbm_bo *bo);
+
+       /**< Export file descriptor used by the buffer object */
        hal_tbm_fd (*bo_export_fd)(hal_tbm_bo *bo, hal_tbm_error *error);
+
+       /**< Export tbm_key used by the buffer object */
        hal_tbm_key (*bo_export_key)(hal_tbm_bo *bo, hal_tbm_error *error);
 };
 
+/**
+ * @}
+ */
+
 #ifdef __cplusplus
 }
 #endif
index 783def81baae7aae297de16475050264ccf0c058..e4d28ac86c3735264dd633c1b5666effee4d241f 100644 (file)
 extern "C" {
 #endif
 
-/* hal tbm error base : this error base is same as TIZEN_ERROR_TBM in tizen_error.h */
-#ifndef HAL_TBM_ERROR_BASE // CAUTION :: This MUST be the same as TBM_ERROR_BASE.
+/**
+ * @file hal-tbm-types.h
+ * @brief This file contains several enumerations, definitions, structures and unions that is used in the Tizen TBM HAL interface API.
+ * @since HAL_MODULE_TBM 1.0
+ */
+
+/**
+ * @addtogroup HALAPI_HAL_TBM_MODULE
+ * @{
+ */
+
+#ifndef HAL_TBM_ERROR_BASE
 #define HAL_TBM_ERROR_BASE                     -0x02830000
 #endif
 
 /**
  * @brief Enumeration for hal tbm error type.
+ * @since HAL_MODULE_TBM 1.0
+ * @details Error's enumulation has group using offset 0x0101.
+ * HAL_TBM_ERROR_XXX. start from (HAL_TBM_ERROR_BASE | 0x0001) to (HAL_TBM_ERROR_BASE | 0x0099)
+ * HAL_TBM_BO_ERROR_XXX. start from (HAL_TBM_ERROR_BASE | 0x0101) to (HAL_TBM_ERROR_BASE | 0x0199)
  */
 typedef enum {
-       /* HAL_TBM_ERROR_XXX. start from (HAL_TBM_ERROR_BASE | 0x0001) to (HAL_TBM_ERROR_BASE | 0x0099) */
        HAL_TBM_ERROR_NONE = TIZEN_ERROR_NONE,                               /**< Successful */
        HAL_TBM_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY,             /**< Out of memory */
        HAL_TBM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER,     /**< Invalid function parameter */
        HAL_TBM_ERROR_INVALID_OPERATION = TIZEN_ERROR_INVALID_OPERATION,     /**< Function not implemented */
        HAL_TBM_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED,             /**< Not supported */
 
-       /* HAL_TBM_BO_ERROR_XXX. start from (HAL_TBM_ERROR_BASE | 0x0101) to (HAL_TBM_ERROR_BASE | 0x0199) */
-       HAL_TBM_BO_ERROR_GET_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0101,            /**< failed to get fd in bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_HEAP_ALLOC_FAILED = HAL_TBM_ERROR_OUT_OF_MEMORY,        /**< failed to allocate the heap memory in bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_LOAD_MODULE_FAILED = HAL_TBM_ERROR_BASE | 0x0103,       /**< failed to load module  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_THREAD_INIT_FAILED = HAL_TBM_ERROR_BASE | 0x0104,       /**< failed to initialize the pthread  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_BO_ALLOC_FAILED = HAL_TBM_ERROR_OUT_OF_MEMORY,          /**< failed to allocate hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_INIT_STATE_FAILED = HAL_TBM_ERROR_BASE | 0x0106,        /**< failed to initialize the state of hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_IMPORT_FAILED = HAL_TBM_ERROR_BASE | 0x0107,            /**< failed to import the handle of hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_IMPORT_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0108,         /**< failed to import fd of hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_EXPORT_FAILED = HAL_TBM_ERROR_BASE | 0x0109,            /**< failed to export the handle of the hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_EXPORT_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0110,         /**< failed to export fd of hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_GET_HANDLE_FAILED = HAL_TBM_ERROR_BASE | 0x0111,        /**< failed to get the hal_tbm_bo_handle  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_LOCK_FAILED = HAL_TBM_ERROR_BASE | 0x0112,              /**< failed to lock the hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_MAP_FAILED = HAL_TBM_ERROR_BASE | 0x0113,               /**< failed to map the hal_tbm_bo to get the hal_tbm_bo_handle  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_UNMAP_FAILED = HAL_TBM_ERROR_BASE | 0x0114,             /**< failed to unmap the hal_tbm_bo  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_SWAP_FAILED = HAL_TBM_ERROR_BASE | 0x0115,              /**< failed to swap the tbm_bos  (DEPRECATED) */
-       HAL_TBM_BO_ERROR_DUP_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0116,            /**< failed to duplicate fd  (DEPRECATED) */
+       HAL_TBM_BO_ERROR_GET_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0101,        /**< failed to get fd in bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_HEAP_ALLOC_FAILED = HAL_TBM_ERROR_OUT_OF_MEMORY,    /**< failed to allocate the heap memory in bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_LOAD_MODULE_FAILED = HAL_TBM_ERROR_BASE | 0x0103,   /**< failed to load module  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_THREAD_INIT_FAILED = HAL_TBM_ERROR_BASE | 0x0104,   /**< failed to initialize the pthread  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_BO_ALLOC_FAILED = HAL_TBM_ERROR_OUT_OF_MEMORY,      /**< failed to allocate hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_INIT_STATE_FAILED = HAL_TBM_ERROR_BASE | 0x0106,    /**< failed to initialize the state of hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_IMPORT_FAILED = HAL_TBM_ERROR_BASE | 0x0107,        /**< failed to import the handle of hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_IMPORT_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0108,     /**< failed to import fd of hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_EXPORT_FAILED = HAL_TBM_ERROR_BASE | 0x0109,        /**< failed to export the handle of the hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_EXPORT_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0110,     /**< failed to export fd of hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_GET_HANDLE_FAILED = HAL_TBM_ERROR_BASE | 0x0111,    /**< failed to get the hal_tbm_bo_handle  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_LOCK_FAILED = HAL_TBM_ERROR_BASE | 0x0112,          /**< failed to lock the hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_MAP_FAILED = HAL_TBM_ERROR_BASE | 0x0113,           /**< failed to map the hal_tbm_bo to get the hal_tbm_bo_handle  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_UNMAP_FAILED = HAL_TBM_ERROR_BASE | 0x0114,         /**< failed to unmap the hal_tbm_bo  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_SWAP_FAILED = HAL_TBM_ERROR_BASE | 0x0115,          /**< failed to swap the tbm_bos  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
+       HAL_TBM_BO_ERROR_DUP_FD_FAILED = HAL_TBM_ERROR_BASE | 0x0116,        /**< failed to duplicate fd  @deprecated Deprecated since HAL_MODULE_TBM 1.0 */
 } hal_tbm_error;
 
 /**
  * @brief Enumeration of tbm buffer manager capability.
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
        HAL_TBM_BUFMGR_CAPABILITY_NONE = 0,                  /**< Not Support capability*/
@@ -90,18 +103,20 @@ typedef enum {
 
 /**
  * @brief Enumeration of bo memory type
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
-       HAL_TBM_BO_DEFAULT = 0,                    /**< default memory: it depends on the backend         */
-       HAL_TBM_BO_SCANOUT = (1 << 0),     /**< scanout memory                                    */
+       HAL_TBM_BO_DEFAULT = 0,            /**< default memory: it depends on the backend         */
+       HAL_TBM_BO_SCANOUT = (1 << 0),     /**< scanout memory                                    */
        HAL_TBM_BO_NONCACHABLE = (1 << 1), /**< non-cachable memory                               */
-       HAL_TBM_BO_WC = (1 << 2),                  /**< write-combine memory                              */
+       HAL_TBM_BO_WC = (1 << 2),          /**< write-combine memory                              */
        HAL_TBM_BO_TILED = (1 << 3),       /**< tiled memory                                      */
        HAL_TBM_BO_VENDOR = (0xffff0000),  /**< vendor specific memory: it depends on the backend */
 } hal_tbm_bo_memory_type;
 
 /**
  * @brief Definition for the device type to access hal_tbm_bo
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
        HAL_TBM_DEVICE_DEFAULT = 0,  /**< the device type to get the default handle */
@@ -112,7 +127,8 @@ typedef enum {
 } hal_tbm_bo_device_type;
 
 /**
- * @brief Definition for the optoin to access hal_tbm_bo
+ * @brief Definition for the option to access hal_tbm_bo
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
        HAL_TBM_OPTION_NONE = (1 << 0),        /**< the option is none */
@@ -122,7 +138,8 @@ typedef enum {
 } hal_tbm_bo_access_option;
 
 /**
- * @brief Deficitino for the buffer data of hal_tbm_surface
+ * @brief Definition for the buffer data of hal_tbm_surface
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef struct _hal_tbm_surface_buffer_data {
        int *fds;                       /**< an array of dmabuf fds */
@@ -135,6 +152,7 @@ typedef struct _hal_tbm_surface_buffer_data {
 
 /**
  * @brief hal_tbm_bo_handle abstraction of the memory handle by HAL_TBM_DEVICE_TYPE
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef union _hal_tbm_bo_handle {
        void *ptr;
@@ -146,245 +164,322 @@ typedef union _hal_tbm_bo_handle {
 
 /**
  * @brief Definition for hal_tbm_backend handle
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef void hal_tbm_backend;
 
 /**
  * @brief Definition for hal_tbm_bufmgr handle created by hal tbm backend
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef void hal_tbm_bufmgr;
 
 /**
  * @brief Definition for the tizen surface object
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef void hal_tbm_surface;
 
 /**
  * @brief Definition for the tizen buffer object
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef void hal_tbm_bo;
 
 /**
  * @brief Definition for native display (wl_display in tizen)
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef void hal_tbm_native_display;
 
 /**
- * @brief Definition for the file descripter of the system buffer manager
+ * @brief Definition for the file descriptor of the system buffer manager
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef int32_t hal_tbm_fd;
 
 /**
  * @brief Definition for the key associated with the buffer object
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef uint32_t hal_tbm_key;
 
 /**
  * @brief Definition for the Tizen buffer surface.
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef struct _hal_tbm_surface *hal_tbm_surface_h;
+
 /**
  * @brief Definition for the Tizen buffer surface format.
- * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
+ * @since HAL_MODULE_TBM 1.0
  */
 typedef uint32_t hal_tbm_format;
 
 #define __hal_tbm_fourcc_code(a, b, c, d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
                                ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
 
-/* color index */
 /**
  * @brief Definition for the TBM surface format C8 ([7:0] C).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_C8       __hal_tbm_fourcc_code('C', '8', ' ', ' ')
 
-/* 8 bpp RGB */
 /**
  * @brief Definition for the TBM surface format RGB322 ([7:0] R:G:B 3:3:2).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGB332   __hal_tbm_fourcc_code('R', 'G', 'B', '8')
+
 /**
  * @brief Definition for the TBM surface format RGB233 ([7:0] B:G:R 2:3:3).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGR233   __hal_tbm_fourcc_code('B', 'G', 'R', '8')
 
-/* 16 bpp RGB */
 /**
  * @brief Definition for the TBM surface format XRGB4444 ([15:0] x:R:G:B 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XRGB4444 __hal_tbm_fourcc_code('X', 'R', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format XBRG4444 ([15:0] x:B:G:R 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XBGR4444 __hal_tbm_fourcc_code('X', 'B', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format RGBX4444 ([15:0] R:G:B:x 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBX4444 __hal_tbm_fourcc_code('R', 'X', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format BGRX4444 ([15:0] B:G:R:x 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRX4444 __hal_tbm_fourcc_code('B', 'X', '1', '2')
 
 /**
  * @brief Definition for the TBM surface format ARGB4444 ([15:0] A:R:G:B 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ARGB4444 __hal_tbm_fourcc_code('A', 'R', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format ABGR4444 ([15:0] A:B:G:R 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ABGR4444 __hal_tbm_fourcc_code('A', 'B', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format RGBA4444 ([15:0] R:G:B:A 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBA4444 __hal_tbm_fourcc_code('R', 'A', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format BGRA4444 ([15:0] B:G:R:A 4:4:4:4 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRA4444 __hal_tbm_fourcc_code('B', 'A', '1', '2')
 
 /**
  * @brief Definition for the TBM surface format XRGB1555 ([15:0] x:R:G:B 1:5:5:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XRGB1555 __hal_tbm_fourcc_code('X', 'R', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format XBGR1555 ([15:0] x:B:G:R 1:5:5:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XBGR1555 __hal_tbm_fourcc_code('X', 'B', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format RGBX5551 ([15:0] R:G:B:x 5:5:5:1 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBX5551 __hal_tbm_fourcc_code('R', 'X', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format BGRX5551 ([15:0] B:G:R:x 5:5:5:1 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRX5551 __hal_tbm_fourcc_code('B', 'X', '1', '5')
 
 /**
  * @brief Definition for the TBM surface format ARGB1555 ([15:0] A:R:G:B 1:5:5:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ARGB1555 __hal_tbm_fourcc_code('A', 'R', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format ABGR1555 ([15:0] A:B:G:R 1:5:5:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ABGR1555 __hal_tbm_fourcc_code('A', 'B', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format RGBA5551 ([15:0] R:G:B:A 5:5:5:1 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBA5551 __hal_tbm_fourcc_code('R', 'A', '1', '5')
+
 /**
  * @brief Definition for the TBM surface format BGRA5551 ([15:0] B:G:R:A 5:5:5:1 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRA5551 __hal_tbm_fourcc_code('B', 'A', '1', '5')
 
 /**
  * @brief Definition for the TBM surface format RGB565 ([15:0] R:G:B 5:6:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGB565   __hal_tbm_fourcc_code('R', 'G', '1', '6')
+
 /**
  * @brief Definition for the TBM surface format BGR565 ([15:0] B:G:R 5:6:5 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGR565   __hal_tbm_fourcc_code('B', 'G', '1', '6')
 
-/* 24 bpp RGB */
 /**
  * @brief Definition for the TBM surface format RGB888 ([23:0] R:G:B little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGB888   __hal_tbm_fourcc_code('R', 'G', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format BGR888 ([23:0] B:G:R little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGR888   __hal_tbm_fourcc_code('B', 'G', '2', '4')
 
-/* 32 bpp RGB */
 /**
  * @brief Definition for the TBM surface format XRGB8888 ([31:0] x:R:G:B 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XRGB8888 __hal_tbm_fourcc_code('X', 'R', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format XBGR8888 ([31:0] x:B:G:R 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XBGR8888 __hal_tbm_fourcc_code('X', 'B', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format RGBX8888 ([31:0] R:G:B:x 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBX8888 __hal_tbm_fourcc_code('R', 'X', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format BGRX8888 ([31:0] B:G:R:x 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRX8888 __hal_tbm_fourcc_code('B', 'X', '2', '4')
 
 /**
  * @brief Definition for the TBM surface format ARGB8888 ([31:0] A:R:G:B 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ARGB8888 __hal_tbm_fourcc_code('A', 'R', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format ABGR8888 ([31:0] [31:0] A:B:G:R 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ABGR8888 __hal_tbm_fourcc_code('A', 'B', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format RGBA8888 ([31:0] R:G:B:A 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBA8888 __hal_tbm_fourcc_code('R', 'A', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format BGRA8888 ([31:0] B:G:R:A 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRA8888 __hal_tbm_fourcc_code('B', 'A', '2', '4')
 
 /**
  * @brief Definition for the TBM surface format XRGB2101010 ([31:0] x:R:G:B 2:10:10:10 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XRGB2101010  __hal_tbm_fourcc_code('X', 'R', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format XBGR2101010 ([31:0] x:B:G:R 2:10:10:10 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_XBGR2101010  __hal_tbm_fourcc_code('X', 'B', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format RGBX1010102 ([31:0] R:G:B:x 10:10:10:2 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBX1010102  __hal_tbm_fourcc_code('R', 'X', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format BGRX1010102 ([31:0] B:G:R:x 10:10:10:2 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRX1010102  __hal_tbm_fourcc_code('B', 'X', '3', '0')
 
 /**
  * @brief Definition for the TBM surface format ARGB2101010 ([31:0] A:R:G:B 2:10:10:10 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ARGB2101010  __hal_tbm_fourcc_code('A', 'R', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format ABGR2101010 ([31:0] A:B:G:R 2:10:10:10 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_ABGR2101010  __hal_tbm_fourcc_code('A', 'B', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format RGBA1010102 ([31:0] R:G:B:A 10:10:10:2 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_RGBA1010102  __hal_tbm_fourcc_code('R', 'A', '3', '0')
+
 /**
  * @brief Definition for the TBM surface format BGRA1010102 ([31:0] B:G:R:A 10:10:10:2 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_BGRA1010102  __hal_tbm_fourcc_code('B', 'A', '3', '0')
 
-/* packed YCbCr */
 /**
  * @brief Definition for the TBM surface format YUYV ([31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUYV     __hal_tbm_fourcc_code('Y', 'U', 'Y', 'V')
+
 /**
  * @brief Definition for the TBM surface format YVYU ([31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVYU     __hal_tbm_fourcc_code('Y', 'V', 'Y', 'U')
+
 /**
  * @brief Definition for the TBM surface format UYVY ([31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_UYVY     __hal_tbm_fourcc_code('U', 'Y', 'V', 'Y')
+
 /**
  * @brief Definition for the TBM surface format VYUY ([31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_VYUY     __hal_tbm_fourcc_code('V', 'Y', 'U', 'Y')
 
 /**
  * @brief Definition for the TBM surface format AYUV ([31:0] A:Y:Cb:Cr 8:8:8:8 little endian).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_AYUV     __hal_tbm_fourcc_code('A', 'Y', 'U', 'V')
 
@@ -397,18 +492,25 @@ typedef uint32_t hal_tbm_format;
  */
 /**
  * @brief Definition for the TBM surface format NV12 (2x2 subsampled Cr:Cb plane).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_NV12     __hal_tbm_fourcc_code('N', 'V', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format NV21 (2x2 subsampled Cb:Cr plane).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_NV21     __hal_tbm_fourcc_code('N', 'V', '2', '1')
+
 /**
  * @brief Definition for the TBM surface format NV16 (2x1 subsampled Cr:Cb plane).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_NV16     __hal_tbm_fourcc_code('N', 'V', '1', '6')
+
 /**
  * @brief Definition for the TBM surface format NV61 (2x1 subsampled Cb:Cr plane).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_NV61     __hal_tbm_fourcc_code('N', 'V', '6', '1')
 
@@ -423,51 +525,74 @@ typedef uint32_t hal_tbm_format;
  */
 /**
  * @brief Definition for the TBM surface format YUV410 (4x4 subsampled Cb (1) and Cr (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUV410   __hal_tbm_fourcc_code('Y', 'U', 'V', '9')
+
 /**
  * @brief Definition for the TBM surface format YVU410 (4x4 subsampled Cr (1) and Cb (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVU410   __hal_tbm_fourcc_code('Y', 'V', 'U', '9')
+
 /**
  * @brief Definition for the TBM surface format YUV411 (4x1 subsampled Cb (1) and Cr (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUV411   __hal_tbm_fourcc_code('Y', 'U', '1', '1')
+
 /**
  * @brief Definition for the TBM surface format YVU411 (4x1 subsampled Cr (1) and Cb (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVU411   __hal_tbm_fourcc_code('Y', 'V', '1', '1')
+
 /**
  * @brief Definition for the TBM surface format YUV420 (2x2 subsampled Cb (1) and Cr (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUV420   __hal_tbm_fourcc_code('Y', 'U', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format YVU420 (2x2 subsampled Cr (1) and Cb (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVU420   __hal_tbm_fourcc_code('Y', 'V', '1', '2')
+
 /**
  * @brief Definition for the TBM surface format YUV422 (2x1 subsampled Cb (1) and Cr (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUV422   __hal_tbm_fourcc_code('Y', 'U', '1', '6')
+
 /**
  * @brief Definition for the TBM surface format YVU422 (2x1 subsampled Cr (1) and Cb (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVU422   __hal_tbm_fourcc_code('Y', 'V', '1', '6')
+
 /**
  * @brief Definition for the TBM surface format YUV444 (non-subsampled Cb (1) and Cr (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YUV444   __hal_tbm_fourcc_code('Y', 'U', '2', '4')
+
 /**
  * @brief Definition for the TBM surface format YVU444 (non-subsampled Cr (1) and Cb (2) planes).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_YVU444   __hal_tbm_fourcc_code('Y', 'V', '2', '4')
 
-/* 2 plane YCbCr */
 /**
  * @brief Definition for the TBM surface format NV12MT (tiled '64x32' & multi-plane version of NV12).
+ * @since HAL_MODULE_TBM 1.0
  */
 #define HAL_TBM_FORMAT_NV12MT   __hal_tbm_fourcc_code('T', 'M', '1', '2')
 
+/**
+ * @}
+ */
+
 #ifdef __cplusplus
 }
 #endif
index 72d2830650b4a43edf70027c26113efa3540d3ce..46302b2c3beb5a230c530f05cc2732348ed4b74a 100644 (file)
@@ -39,47 +39,350 @@ extern "C" {
 
 #include <hal-tbm-types.h>
 
-/* 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);
-int               hal_tbm_backend_has_drm_device(hal_tbm_backend *backend, hal_tbm_error *error);
-hal_tbm_fd        hal_tbm_backend_get_master_drm_fd(hal_tbm_backend *backend, hal_tbm_error *error);
-
-hal_tbm_error     hal_tbm_backend_set_authenticated_drm_fd(hal_tbm_backend *backend, hal_tbm_fd auth_drm_fd);
-
-/* hal_tbm_bufmgr_funcs */
-hal_tbm_bufmgr_capability  hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
-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_surface           *hal_tbm_bufmgr_alloc_surface(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format, hal_tbm_bo_memory_type mem_types, uint64_t *modifiers, uint32_t num_modifiers, hal_tbm_error *error);
-hal_tbm_surface           *hal_tbm_bufmgr_import_surface(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format, hal_tbm_surface_buffer_data *buffer_data, hal_tbm_error *error);
-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, int bpp,
-                                          hal_tbm_bo_memory_type mem_types, 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_surface_funcs*/
-void                           hal_tbm_surface_free(hal_tbm_surface *surface);
-hal_tbm_bo                   **hal_tbm_surface_get_bos(hal_tbm_surface *surface, int *num_bos, hal_tbm_error *error);
-hal_tbm_error                  hal_tbm_surface_get_plane_data(hal_tbm_surface *surface, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
-hal_tbm_surface_buffer_data   *hal_tbm_surface_export(hal_tbm_surface *surface, hal_tbm_error *error);
-
-/* hal_tbm_bo_funcs*/
-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);
+/**
+ * @file hal-tbm.h
+ * @brief This file contains the Tizen TBM HAL interface API, related structures and enumerations.
+ * @since HAL_MODULE_TBM 1.0
+ */
+
+/**
+ * @addtogroup HALAPI_HAL_TBM_MODULE
+ * @{
+ */
+
+/**
+ * @brief Get the handle of hal_tbm_backend from backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The handle of hal_tbm_backend, otherwise NULL.
+ * @see hal_tbm_put_backend()
+ */
+hal_tbm_backend *hal_tbm_get_backend(hal_tbm_error *error);
+
+/**
+ * @brief Put the handle of hal_tbm_backend to backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] backend_data The handle of hal_tbm_backend.
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @see hal_tbm_get_backend()
+ */
+hal_tbm_error hal_tbm_put_backend(hal_tbm_backend *backend_data);
+
+/**
+ * @brief Get the handle of TBM buffer manager HAL from backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] backend The handle of hal_tbm_backend.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The handle of TBM buffer manager HAL, otherwise NULL.
+ */
+hal_tbm_bufmgr *hal_tbm_backend_get_bufmgr(hal_tbm_backend *backend, hal_tbm_error *error);
+
+/**
+ * @brief Check the tbm_backend has drm device or not.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] backend The handle of hal_tbm_backend.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return If tbm_backend has drm device then 1 will be returned, otherwise 0.
+ */
+int hal_tbm_backend_has_drm_device(hal_tbm_backend *backend, hal_tbm_error *error);
+
+/**
+ * @brief Get the master DRM file descriptor form tbm_backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] backend The handle of hal_tbm_backend.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The master DRM file descriptor, otherwise 0.
+ */
+hal_tbm_fd hal_tbm_backend_get_master_drm_fd(hal_tbm_backend *backend, hal_tbm_error *error);
+
+/**
+ * @brief Set the authenticated DRM file descriptor to tbm_backend.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] backend The handle of hal_tbm_backend.
+ * @param[in] auth_drm_fd The authenticated DRM file descriptor.
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ */
+hal_tbm_error hal_tbm_backend_set_authenticated_drm_fd(hal_tbm_backend *backend, hal_tbm_fd auth_drm_fd);
+
+/**
+ * @brief Get the capabilities of a buffer manager
+ * @remarks The backend must support the TBM_BUFMGR_CAPABILITY_SHARE_FD.
+ *        TBM_BUFMGR_CAPABILITY_SHARE_KEY will help you do debugging to
+ *        develop the platform because the tbm_key will be the unique
+ *        identification of the tbm_bo memory in the system.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The handle of TBM buffer manager HAL.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return the capabilities of TBM buffer manger HAL, otherwise NULL.
+ */
+hal_tbm_bufmgr_capability hal_tbm_bufmgr_get_capabilities(hal_tbm_bufmgr *bufmgr, hal_tbm_error *error);
+
+/**
+ * @brief Get supported color format from TBM buffer manger HAL.
+ * @remarks color format is like HAL_TBM_FORMAT_ARGB8888, HAL_TBM_FORMAT_XRGB8888, HAL_TBM_FORMAT_NV12, HAL_TBM_FORMAT_YUV420, and so on.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The handle of TBM buffer manager HAL.
+ * @param[out] formats The pointer of supported color format array. it is allocated by backend funtion
+ * @param[out] num The number of supported color formats.
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ */
+hal_tbm_error hal_tbm_bufmgr_get_supported_formats(hal_tbm_bufmgr *bufmgr, uint32_t **formats, uint32_t *num);
+
+/**
+ * @brief Get plane's information from TBM buffer manger HAL according to the color format.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The handle of TBM buffer manager HAL.
+ * @param[in] format The color format of plane.
+ * @param[in] plane_idx The index of plane.
+ * @param[in] width Width of plane.
+ * @param[in] height Height of plane.
+ * @param[out] size The size of the plane.
+ * @param[out] offset The offset of the plane at the buffer object.
+ * @param[out] pitch The pitch of the plane.
+ * @param[out] bo_idx The buffer object index of the plane.
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ */
+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);
+
+/**
+ * @brief Allocate the surface according to the color format.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The buffer manager handle.
+ * @param[in] width The width of the surface.
+ * @param[in] height The height of the surface.
+ * @param[in] format The format of the surface.
+ * @param[in] mem_types The memory types.
+ * @param[in] modifiers The modifiers of the surface.
+ * @param[in] num_modifiers The number of the modifiers.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of the hal's tbm_surface from the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_import_surface()
+ * @see hal_tbm_surface_free()
+ */
+hal_tbm_surface *hal_tbm_bufmgr_alloc_surface(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format,
+                                hal_tbm_bo_memory_type mem_types, uint64_t *modifiers, uint32_t num_modifiers, hal_tbm_error *error);
+
+/**
+ * @brief Import the surface according to the format.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The backend bufmgr handle.
+ * @param[in] width The width of the surface.
+ * @param[in] height The height of the surface.
+ * @param[in] format The color format of the surface.
+ * @param[in] buffer_data The buffer data for TBM Surface.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of the hal's tbm_surface of the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_alloc_surface()
+ * @see hal_tbm_surface_free()
+ */
+hal_tbm_surface *hal_tbm_bufmgr_import_surface(hal_tbm_bufmgr *bufmgr, uint32_t width, uint32_t height, hal_tbm_format format,
+                                hal_tbm_surface_buffer_data *buffer_data, hal_tbm_error *error);
+
+/**
+ * @brief Allocate the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The backend bufmgr handle
+ * @param[in] size The size of buffer object
+ * @param[in] mem_types The memory types
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of hal's buffer object of the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_alloc_bo_with_format()
+ * @see hal_tbm_bo_free()
+ */
+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);
+
+/**
+ * @brief Allocate the buffer object at buffer object index in surface according to the format.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bufmgr The backend bufmgr handle.
+ * @param[in] format The format of the surface.
+ * @param[in] bo_idx The buffer object index.
+ * @param[in] width The width of the surface.
+ * @param[in] height The height of the surface.
+ * @param[in] bpp The bpp of the surface format.
+ * @param[in] mem_types The memory types.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of hal's buffer object from the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_alloc_bo()
+ * @see hal_tbm_bo_free()
+ */
+hal_tbm_bo *hal_tbm_bufmgr_alloc_bo_with_format(hal_tbm_bufmgr *bufmgr, int format, int bo_idx, int width, int height, int bpp,
+                           hal_tbm_bo_memory_type mem_types, hal_tbm_error *error);
+
+/**
+ * @brief Import the buffer object associated with the tbm_fd(prime fd).
+ * @since HAL_MODULE_TBM 1.0
+ * @remarks Tbm_fd must be free by user.
+ * @remarks It must be supported at the backend module. To sharing the tbm_fd(prime fd)
+ *        among the processes is the essential feature to run the graphic rendering.
+ * @param[in] bufmgr The backend bufmgr handle.
+ * @param[in] fd The tbm_fd(prime fd) associated with the buffer object.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of buffer object from the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_import_key()
+ * @see hal_tbm_bo_free()
+ */
+hal_tbm_bo *hal_tbm_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd fd, hal_tbm_error *error);
+
+/**
+ * @brief Import the buffer object associated with the tbm_key.
+ * @since HAL_MODULE_TBM 1.0
+ * @remarks If the backend doesn't support a buffer sharing by tbm key,
+ *        fucntion pointer must be set to NULL.
+ * @param[in] bufmgr The backend bufmgr data.
+ * @param[in] key The tbm_key associated with the buffer object
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The pointer of hal's buffer object from the tbm backend, otherwise NULL.
+ * @see hal_tbm_bufmgr_import_fd()
+ * @see hal_tbm_bo_free()
+ */
+hal_tbm_bo *hal_tbm_bufmgr_import_key(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error *error);
+
+/**
+ * @brief Deallocate tbm_surface using backend's surface free function.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] surface The tbm_surface.
+ * @see hal_tbm_bufmgr_alloc_surface()
+ * @see hal_tbm_bufmgr_import_surface()
+ */
+void hal_tbm_surface_free(hal_tbm_surface *surface);
+
+/**
+ * @brief Get the number of buffer objects associated with the tbm_surface.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] surface The handle of tbm_surface.
+ * @param[out] num_bos The number of buffer objects.
+ * @return The buffer object array associated with the tbm_surface_h, otherwise NULL.
+ * @see hal_tbm_bo_free()
+ */
+hal_tbm_bo **hal_tbm_surface_get_bos(hal_tbm_surface *surface, int *num_bos, hal_tbm_error *error);
+
+/**
+ * @brief Get size, offset, pitch, buffer object index related with plane_index from tbm_surface.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] surface The tbm_surface_h.
+ * @param[in] plane_idx The bo index in the the tbm_surface.
+ * @param[out] size The size of plane in tbm_surface.
+ * @param[out] offset The offset of plane in tbm_surface.
+ * @param[out] pitch The pitch of plane in tbm_surface.
+ * @param[out] bo_idx The index of the buffer object in tbm_surface.
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ */
+hal_tbm_error hal_tbm_surface_get_plane_data(hal_tbm_surface *surface, int plane_idx, uint32_t *size, uint32_t *offset, uint32_t *pitch, int *bo_idx);
+
+/**
+ * @brief Export a buffer_data of tbm_surface.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] surface The tbm surface.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ */
+hal_tbm_surface_buffer_data *hal_tbm_surface_export(hal_tbm_surface *surface, hal_tbm_error *error);
+
+/**
+ * @brief Free the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object.
+ * @see hal_tbm_surface_get_bos()
+ * @see hal_tbm_bufmgr_import_key()
+ * @see hal_tbm_bufmgr_import_fd()
+ * @see hal_tbm_bufmgr_alloc_bo_with_format()
+ * @see hal_tbm_bufmgr_alloc_bo()
+ */
+void hal_tbm_bo_free(hal_tbm_bo *bo);
+
+/**
+ * @brief Get the size of a buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object.
+ * @return Size if this function succeeds, otherwise 0.
+ */
+int hal_tbm_bo_get_size(hal_tbm_bo *bo, hal_tbm_error *error);
+
+/**
+ * @brief Get the memory type of buffer object
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object.
+ * @return The memory type of buffer object.
+ * @see hal_tbm_bo_memory_type
+ */
+hal_tbm_bo_memory_type hal_tbm_bo_get_memory_types(hal_tbm_bo *bo, hal_tbm_error *error);
+
+/**
+ * @brief Get the hal_tbm_bo_handle according to the device type.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo : The buffer object.
+ * @param[in] device : The device type to get a handle.
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The handle of the buffer object
+ * @see hal_tbm_bo_device_type
+ */
+hal_tbm_bo_handle hal_tbm_bo_get_handle(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_error *error);
+
+/**
+ * @brief Map the buffer object according to the device type and the option.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @param[in] device The device type to get a handle
+ * @param[in] opt The option to access the buffer object
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The handle of the buffer object
+ * @see hal_tbm_bo_unmap()
+ */
+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);
+
+/**
+ * @brief Unmap the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @see hal_tbm_bo_map()
+ */
+hal_tbm_error hal_tbm_bo_unmap(hal_tbm_bo *bo);
+
+/**
+ * @brief Lock the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @param[in] device The device type to get a handle
+ * @param[in] opt The option to access the buffer object
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @see hal_tbm_bo_unlock()
+ */
+hal_tbm_error hal_tbm_bo_lock(hal_tbm_bo *bo, hal_tbm_bo_device_type device, hal_tbm_bo_access_option opt);
+
+/**
+ * @brief Unlock the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @return #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @see hal_tbm_bo_lock()
+ */
+hal_tbm_error hal_tbm_bo_unlock(hal_tbm_bo *bo);
+
+/**
+ * @brief Export file descriptor used by the buffer object.
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The file descriptor associated with the buffer object
+ * @see hal_tbm_bo_export_key()
+ */
+hal_tbm_fd hal_tbm_bo_export_fd(hal_tbm_bo *bo, hal_tbm_error *error);
+
+/**
+ * @brief Export tbm_key used by the buffer object
+ * @since HAL_MODULE_TBM 1.0
+ * @param[in] bo The buffer object
+ * @param[out] error #HAL_TBM_ERROR_NONE if success, otherwise error value.
+ * @return The key associated with the buffer object
+ * @see hal_tbm_bo_export_fd()
+ */
+hal_tbm_key hal_tbm_bo_export_key(hal_tbm_bo *bo, hal_tbm_error *error);
+
+/**
+ * @}
+ */
 
 #ifdef __cplusplus
 }