bufmgr: add tbm_bufmgr_set_bo_lock_type api
[platform/core/uifw/libtbm.git] / src / tbm_bufmgr.h
index 7d89204..bc69778 100644 (file)
@@ -172,6 +172,16 @@ enum TBM_BUFMGR_CAPABILITY {
        TBM_BUFMGR_CAPABILITY_TBM_SYNC = (1 << 2),              /**< Support tbm sync */
 };
 
+/**
+ * @brief Enumeration of buffer manager lock try for bo
+ * @since_tizen 5.0
+ */
+typedef enum {
+       TBM_BUFMGR_BO_LOCK_TYPE_NEVER = 0,  /**< the bufmgr do not try to lock the bos when the tbm_bo_map is called. */
+       TBM_BUFMGR_BO_LOCK_TYPE_ONCE,       /**< the bufmgr tries to lock the bos only once when the tbm_bo_map is called. */
+       TBM_BUFMGR_BO_LOCK_TYPE_ALWAYS,     /**< the bufmgr always tries to lock the bos when the tbm_bo_map is called. */
+} tbm_bufmgr_bo_lock_type;
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -1022,6 +1032,28 @@ unsigned int tbm_bufmgr_get_capability(tbm_bufmgr bufmgr);
 int tbm_bo_get_flags(tbm_bo bo);
 
 /**
+ * @brief bind the native_display.
+ * @since_tizen 3.0
+ * @param[in] bufmgr : the buffer manager
+ * @param[in] native_display : the native_display
+ */
+int tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *native_display);
+
+/**
+ * @brief Initializes the buffer manager at the display server.
+ * @details use this api to initialize the tbm_bufmgr at the display server.
+ * @since_tizen 5.0
+ */
+tbm_bufmgr tbm_bufmgr_server_init(void);
+
+/**
+ * @brief Set the bo_lock_type of the bufffer manager.
+ * @details set the bo_lock_type
+ * @since_tizen 5.0
+ */
+int tbm_bufmgr_set_bo_lock_type(tbm_bufmgr bufmgr, tbm_bufmgr_bo_lock_type bo_lock_type);
+
+/**
  * @brief Print out the information of tbm_bos.
  * @since_tizen 3.0
  * @param[in] bufmgr : the buffer manager
@@ -1029,13 +1061,12 @@ int tbm_bo_get_flags(tbm_bo bo);
 void tbm_bufmgr_debug_show(tbm_bufmgr bufmgr);
 
 /**
- * @brief Print out to str the information of tbm_bos.
+ * @brief Get string with the information of tbm_bos.
  * @since_tizen 3.0
  * @param[in] bufmgr : the buffer manager
- * @param[out] str :
- * @param[out] len :
+ * @return sting with info if this function succeeds, otherwise NULL. It has to be free by user.
  */
-void tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr, char * str, int * len);
+char * tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr);
 
 /**
  * @brief Print out the trace of tbm_bos.
@@ -1082,7 +1113,11 @@ int tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff);
  */
 void tbm_bufmgr_debug_dump_set_scale(double scale);
 
-int tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay);
+/**
+ * @brief Get ref_count of a global tbm_bufmgr
+ * @since_tizen 5.0
+ */
+int tbm_bufmgr_debug_get_ref_count(void);
 
 #ifdef __cplusplus
 }