/**
* @brief Initializes the buffer manager.
* @details If fd is lower than zero, fd is get drm fd in tbm_bufmgr_init function\n
- * The user can decide the lock type and cache flush type with the environment variables, which are BUFMGR_LOCK_TYPE and BUFMGR_MAP_CACHE.\n
- * \n
- * BUFMGR_LOCK default is once\n
- * once : The previous bo which is locked is unlock when the new bo is trying to be locked\n
- * always : The new bo is locked until the previous bo which is locked is unlocked\n
- * never : Every bo is never locked.\n
- * \n
- * BUFMGR_MAP_CACHE default is true\n
- * true : use map cache flushing\n
- * false : to use map cache flushing
* @since_tizen 2.3
* @param[in] fd : file descripter of the system buffer manager
* @return a buffer manager
#include <tbm_bufmgr.h>
int bufmgr_fd;
- setenv("BUFMGR_LOCK_TYPE", "once", 1);
- setenv("BUFMGR_MAP_CACHE", "true", 1);
-
tbm_bufmgr bufmgr;
bufmgr = tbm_bufmgr_init (bufmgr_fd);
*/
unsigned int tbm_bufmgr_get_capability(tbm_bufmgr bufmgr);
-/**
- * @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
- */
-void tbm_bufmgr_debug_show(tbm_bufmgr bufmgr);
-
-/**
- * @brief Get string with the information of tbm_bos.
- * @since_tizen 3.0
- * @param[in] bufmgr : the buffer manager
- * @return sting with info if this function succeeds, otherwise NULL. It has to be free by user.
- */
-char * tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr);
-
-/**
- * @brief Print out the trace of tbm_bos.
- * @since_tizen 3.0
- * @param[in] bufmgr : the buffer manager
- * @param[in] onoff : 1 is on, and 0 is off
- */
-void tbm_bufmgr_debug_trace(tbm_bufmgr bufmgr, int onoff);
-
-/**
- * @brief Dump all tbm surfaces
- * @param[in] path : the given dump path
- * @return 1 if this function succeeds, otherwise 0.
- */
-int tbm_bufmgr_debug_dump_all(char *path);
-
-/**
- * @brief Start the dump debugging for queue.
- * @since_tizen 3.0
- * @param[in] path : the given dump path
- * @param[in] count : the dump count number
- * @param[in] onoff : 1 is on, and 0 is off, if onoff==0 path and count are ignored
- * @return 1 if this function succeeds, otherwise 0.
- */
-int tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff);
-
-/**
- * @brief Set scale factor for the nearest calling tbm_bufmgr_debug_dump_all() or tbm_bufmgr_debug_queue_dump()
- * @since_tizen 3.0
- * @param[in] scale : the scale factor, 0 - disable scaling
- * @par Example
- @code
- #include <tbm_bufmgr.h>
-
- // Dump all surface with scale factor 0.5
- tbm_bufmgr_debug_dump_set_scale(0.5);
- tbm_bufmgr_debug_dump_all("/tmp/");
-
- // Start the dump debugging for queue with scale factor 0.5
- tbm_bufmgr_debug_dump_set_scale(0.2);
- tbm_bufmgr_debug_queue_dump("/tmp/", 10, 1);
-
- @endcode
- */
-void tbm_bufmgr_debug_dump_set_scale(double scale);
-
-/**
- * @brief Get ref_count of a global tbm_bufmgr
- * @since_tizen 5.0
- */
-int tbm_bufmgr_debug_get_ref_count(void);
-
-/**
- * @brief set or unset the trace_mask to print out the trace logs.
- * @since_tizen 5.0
- * @param[in] bufmgr : the buffer manager
- * @param[in] mask : enum value for the trace log
- * @param[in] set : set the mask when set is 1, otherwise unset the mask when set is 0
- */
-void tbm_bufmgr_debug_set_trace_mask(tbm_bufmgr bufmgr, tbm_bufmgr_debug_trace_mask mask, int set);
-
#ifdef __cplusplus
}
#endif
--- /dev/null
+/**************************************************************************
+
+libtbm
+
+Copyright 2012 Samsung Electronics co., Ltd. All Rights Reserved.
+
+Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
+Boram Park <boram1288.park@samsung.com>, Changyeon Lee <cyeon.lee@samsung.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sub license, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice (including the
+next paragraph) shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+**************************************************************************/
+
+#ifndef _TBM_BUFMGR_INTERNAL_H_
+#define _TBM_BUFMGR_INTERNAL_H_
+
+#include <tbm_type.h>
+#include <tbm_type_common.h>
+#include <tbm_bo.h>
+#include <tbm_error.h>
+
+/**
+ * \file tbm_bufmgr_internal.h
+ * \brief Tizen Buffer Manager Internal
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @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
+ */
+void tbm_bufmgr_debug_show(tbm_bufmgr bufmgr);
+
+/**
+ * @brief Get string with the information of tbm_bos.
+ * @since_tizen 3.0
+ * @param[in] bufmgr : the buffer manager
+ * @return sting with info if this function succeeds, otherwise NULL. It has to be free by user.
+ */
+char * tbm_bufmgr_debug_tbm_info_get(tbm_bufmgr bufmgr);
+
+/**
+ * @brief Print out the trace of tbm_bos.
+ * @since_tizen 3.0
+ * @param[in] bufmgr : the buffer manager
+ * @param[in] onoff : 1 is on, and 0 is off
+ */
+void tbm_bufmgr_debug_trace(tbm_bufmgr bufmgr, int onoff);
+
+/**
+ * @brief Dump all tbm surfaces
+ * @param[in] path : the given dump path
+ * @return 1 if this function succeeds, otherwise 0.
+ */
+int tbm_bufmgr_debug_dump_all(char *path);
+
+/**
+ * @brief Start the dump debugging for queue.
+ * @since_tizen 3.0
+ * @param[in] path : the given dump path
+ * @param[in] count : the dump count number
+ * @param[in] onoff : 1 is on, and 0 is off, if onoff==0 path and count are ignored
+ * @return 1 if this function succeeds, otherwise 0.
+ */
+int tbm_bufmgr_debug_queue_dump(char *path, int count, int onoff);
+
+/**
+ * @brief Set scale factor for the nearest calling tbm_bufmgr_debug_dump_all() or tbm_bufmgr_debug_queue_dump()
+ * @since_tizen 3.0
+ * @param[in] scale : the scale factor, 0 - disable scaling
+ * @par Example
+ @code
+ #include <tbm_bufmgr.h>
+
+ // Dump all surface with scale factor 0.5
+ tbm_bufmgr_debug_dump_set_scale(0.5);
+ tbm_bufmgr_debug_dump_all("/tmp/");
+
+ // Start the dump debugging for queue with scale factor 0.5
+ tbm_bufmgr_debug_dump_set_scale(0.2);
+ tbm_bufmgr_debug_queue_dump("/tmp/", 10, 1);
+
+ @endcode
+ */
+void tbm_bufmgr_debug_dump_set_scale(double scale);
+
+/**
+ * @brief Get ref_count of a global tbm_bufmgr
+ * @since_tizen 5.0
+ */
+int tbm_bufmgr_debug_get_ref_count(void);
+
+/**
+ * @brief set or unset the trace_mask to print out the trace logs.
+ * @since_tizen 5.0
+ * @param[in] bufmgr : the buffer manager
+ * @param[in] mask : enum value for the trace log
+ * @param[in] set : set the mask when set is 1, otherwise unset the mask when set is 0
+ */
+void tbm_bufmgr_debug_set_trace_mask(tbm_bufmgr bufmgr, tbm_bufmgr_debug_trace_mask mask, int set);
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* _TBM_BUFMGR_INTERNAL_H_ */