static void _tbm_bufmgr_mutex_unlock(void);
+//#define TBM_BUFMGR_INIT_TIME
+
#define PREFIX_LIB "libtbm_"
#define SUFFIX_LIB ".so"
#define DEFAULT_LIB PREFIX_LIB"default"SUFFIX_LIB
bo);
}
- DBG_LOCK(">> LOCK bo:%p(%d->%d)\n",
+ TBM_DBG_LOCK(">> LOCK bo:%p(%d->%d)\n",
bo, old, bo->lock_cnt);
return ret;
if (bo->lock_cnt < 0)
bo->lock_cnt = 0;
- DBG_LOCK(">> UNLOCK bo:%p(%d->%d)\n",
+ TBM_DBG_LOCK(">> UNLOCK bo:%p(%d->%d)\n",
bo, old, bo->lock_cnt);
}
abimaj = GET_ABI_MAJOR(data->abiversion);
abimin = GET_ABI_MINOR(data->abiversion);
- DBG("TBM module %s: vendor=\"%s\" ABI=%d,%d\n",
+ TBM_DBG("TBM module %s: vendor=\"%s\" ABI=%d,%d\n",
data->modname ? data->modname : "UNKNOWN!",
data->vendor ? data->vendor : "UNKNOWN!", abimaj, abimin);
vermaj = GET_ABI_MAJOR(TBM_ABI_VERSION);
vermin = GET_ABI_MINOR(TBM_ABI_VERSION);
- DBG("TBM ABI version %d.%d\n",
+ TBM_DBG("TBM ABI version %d.%d\n",
vermaj, vermin);
if (abimaj != vermaj) {
bufmgr->module_data = module_data;
- DBG("Success to load module(%s)\n",
+ TBM_DBG("Success to load module(%s)\n",
file);
return 1;
{
char *env;
+#ifdef TBM_BUFMGR_INIT_TIME
+ struct timeval start_tv, end_tv;
+#endif
+
pthread_mutex_lock(&gLock);
+#ifdef TBM_BUFMGR_INIT_TIME
+ /* get the start tv */
+ gettimeofday(&start_tv, NULL);
+#endif
+
/* LCOV_EXCL_START */
#ifdef HAVE_DLOG
env = getenv("TBM_DLOG");
return gBufMgr;
}
- DBG("bufmgr init\n");
+ TBM_DBG("bufmgr init\n");
/* allocate bufmgr */
gBufMgr = calloc(1, sizeof(struct _tbm_bufmgr));
}
/* log for tbm backend_flag */
- DBG("backend flag:%x:", gBufMgr->backend->flags);
- DBG("\n");
+ TBM_DBG("backend flag:%x:", gBufMgr->backend->flags);
+ TBM_DBG("\n");
gBufMgr->ref_count = 1;
- DBG("create tizen bufmgr:%p ref_count:%d\n",
+ TBM_DBG("create tizen bufmgr:%p ref_count:%d\n",
gBufMgr, gBufMgr->ref_count);
/* setup the lock_type */
else
gBufMgr->lock_type = LOCK_TRY_ALWAYS;
- DBG("BUFMGR_LOCK_TYPE=%s\n",
+ TBM_DBG("BUFMGR_LOCK_TYPE=%s\n",
env ? env : "default:once");
TBM_TRACE("create tbm_bufmgr(%p) ref_count(%d) fd(%d)\n", gBufMgr, gBufMgr->ref_count, fd);
/* intialize debug_key_list */
LIST_INITHEAD(&gBufMgr->debug_key_list);
+#ifdef TBM_BUFMGR_INIT_TIME
+ /* get the end tv */
+ gettimeofday(&end_tv, NULL);
+ TBM_LOG_I("tbm_bufmgr_init time: %ld ms", ((end_tv.tv_sec * 1000 + end_tv.tv_usec / 1000) - (start_tv.tv_sec * 1000 + start_tv.tv_usec / 1000)));
+#endif
+
pthread_mutex_unlock(&gLock);
return gBufMgr;
/* destory the user_data_list */
if (!LIST_IS_EMPTY(&bo->user_data_list)) {
LIST_FOR_EACH_ENTRY_SAFE(old_data, tmp, &bo->user_data_list, item_link) {
- DBG("free user_data\n");
+ TBM_DBG("free user_data\n");
user_data_delete(old_data);
}
}
++bo_cnt,
bo,
bo->ref_cnt,
- tbm_bo_size(bo) / 1024,
+ bufmgr->backend->bo_size(bo) / 1024,
bo->lock_cnt,
bo->map_cnt,
bo->flags,