Revert "Add description for doxygen" 67/317667/1
authorJinbong Lee <jinbong.lee@samsung.com>
Mon, 6 Jan 2025 10:45:04 +0000 (10:45 +0000)
committerJinbong Lee <jinbong.lee@samsung.com>
Mon, 6 Jan 2025 10:45:04 +0000 (10:45 +0000)
Revert submission 317006

Reason for revert: for applying tizen_9.0's code

Reverted changes: /gerrit/q/submissionid:317006

Change-Id: I21b8d8163a082263633fb1596d5003c13b01edfa

include/hal-tbm-interface-1.h
include/hal-tbm-types.h
include/hal-tbm.h

index 1b6294bdc622d38fac9c9541f4550adb8a78e6e8..1287c419736825ba4320d0df90b4453e5656abf8 100644 (file)
@@ -45,131 +45,59 @@ typedef struct _hal_tbm_bufmgr_funcs hal_tbm_bufmgr_funcs;
 typedef struct _hal_tbm_surface_funcs   hal_tbm_surface_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;                                     /**< The handle of bufmgr */
+       hal_tbm_bufmgr *bufmgr; // handle
 
-       int has_drm_device;                                         /**< The flag of having drm device or not */
+       int has_drm_device;
        struct {
-               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 */
+               hal_tbm_fd drm_fd;
+               int is_master;
+               hal_tbm_authenticated_drm_fd_handler auth_drm_fd_func;
+               void *user_data;
        } drm_info;
 
-       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 */
+       hal_tbm_bufmgr_funcs *bufmgr_funcs;
+       hal_tbm_surface_funcs *surface_funcs;
+       hal_tbm_bo_funcs     *bo_funcs;
 };
 
-
-/**
- * @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 {
-       /**< Get the capabilities of a buffer manager */
+       /* tbm_bufmgr_func */
        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 {
-       /**< 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);
+       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);
 };
 
-/**
- * @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 369ba78da1a1bb1ece77968f94f777be867365b7..783def81baae7aae297de16475050264ccf0c058 100644 (file)
 extern "C" {
 #endif
 
-/**
- * @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
- * @{
- */
-
-/**
- * @brief Definition of HAL_TBM_ERROR_BASE
- * @since HAL_MODULE_TBM 1.0
- * @warning This definition must be the same as TBM_ERROR_BASE in tizen_error.h.
- */
-#ifndef HAL_TBM_ERROR_BASE
+/* 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.
 #define HAL_TBM_ERROR_BASE                     -0x02830000
 #endif
 
 /**
  * @brief Enumeration for hal tbm error type.
- * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
        /* HAL_TBM_ERROR_XXX. start from (HAL_TBM_ERROR_BASE | 0x0001) to (HAL_TBM_ERROR_BASE | 0x0099) */
@@ -74,27 +58,26 @@ typedef enum {
        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) */
+       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_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*/
@@ -107,20 +90,18 @@ 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 */
@@ -132,7 +113,6 @@ typedef enum {
 
 /**
  * @brief Definition for the optoin to access hal_tbm_bo
- * @since HAL_MODULE_TBM 1.0
  */
 typedef enum {
        HAL_TBM_OPTION_NONE = (1 << 0),        /**< the option is none */
@@ -143,7 +123,6 @@ typedef enum {
 
 /**
  * @brief Deficitino 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 */
@@ -156,7 +135,6 @@ 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;
@@ -168,55 +146,46 @@ 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
- * @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 HAL_MODULE_TBM 1.0
+ * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
  */
 typedef uint32_t hal_tbm_format;
 
@@ -226,270 +195,196 @@ typedef uint32_t hal_tbm_format;
 /* 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')
 
@@ -502,25 +397,18 @@ 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')
 
@@ -535,75 +423,51 @@ 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 46302b2c3beb5a230c530f05cc2732348ed4b74a..72d2830650b4a43edf70027c26113efa3540d3ce 100644 (file)
@@ -39,350 +39,47 @@ extern "C" {
 
 #include <hal-tbm-types.h>
 
-/**
- * @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);
-
-/**
- * @}
- */
+/* 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);
 
 #ifdef __cplusplus
 }