-
- if (!TBM_BUFMGR_IS_VALID(bufmgr) || (bufmgr != gBufMgr)) {
- TBM_LOG_E("invalid bufmgr\n");
- pthread_mutex_unlock(&gLock);
- return;
- }
-
- TBM_DEBUG("\n");
- _tbm_util_get_appname_from_pid(getpid(), app_name);
- _tbm_util_get_appname_brief(app_name);
- TBM_DEBUG("============TBM DEBUG: %s(%d)===========================\n",
- app_name, getpid());
- memset(app_name, 0x0, 255 * sizeof(char));
- snprintf(title, 255, "%s", "no surface refcnt width height bpp size n_b n_p flags format app_name ");
- if (!LIST_IS_EMPTY(&bufmgr->debug_key_list)) {
- LIST_FOR_EACH_ENTRY_SAFE(debug_old_data, debug_tmp, &bufmgr->debug_key_list, item_link) {
- strncat(title, " ", 3);
- strncat(title, debug_old_data->key, strlen(debug_old_data->key) + 1);
- }
- }
-
- TBM_DEBUG("[tbm_surface information]\n");
- TBM_DEBUG("%s\n", title);
- /* show the tbm_surface information in surf_list */
- if (!LIST_IS_EMPTY(&bufmgr->surf_list)) {
- char *value = NULL;
-
- LIST_FOR_EACH_ENTRY_SAFE(surf, tmp_surf, &bufmgr->surf_list, item_link) {
- pid = _tbm_surface_internal_get_debug_pid(surf);
- if (!pid) {
- /* if pid is null, set the self_pid */
- pid = getpid();
- }
-
- _tbm_util_get_appname_from_pid(pid, app_name);
- _tbm_util_get_appname_brief(app_name);
-
- snprintf(data, 255, "%-2d %-9p %-4d %-5d %-6d %-3d %-6d %-2d %-2d %-3d %-8s %-15s",
- ++surf_cnt,
- surf,
- surf->refcnt,
- surf->info.width,
- surf->info.height,
- surf->info.bpp,
- surf->info.size / 1024,
- surf->num_bos,
- surf->num_planes,
- surf->flags,
- _tbm_surface_internal_format_to_str(surf->info.format) + 11,
- app_name);
-
- if (!LIST_IS_EMPTY(&bufmgr->debug_key_list)) {
- LIST_FOR_EACH_ENTRY_SAFE(debug_old_data, debug_tmp, &bufmgr->debug_key_list, item_link) {
- strncat(data, " ", 3);
-
- value = _tbm_surface_internal_get_debug_data(surf, debug_old_data->key);
- if (value)
- strncat(data, value, strlen(value) + 1);
- else
- strncat(data, "none", 5);
- }
- }
- TBM_DEBUG("%s\n", data);
-
- for (i = 0; i < surf->num_bos; i++) {
- TBM_DEBUG(" bo:%-12p %-26d%-10d\n",
- surf->bos[i],
- surf->bos[i]->ref_cnt,
- bufmgr->backend->bo_size(surf->bos[i]) / 1024);
- }
-
- memset(app_name, 0x0, 255 * sizeof(char));
- }
- } else {
- TBM_DEBUG("no tbm_surfaces.\n");
- }
- TBM_DEBUG("\n");
-
- TBM_DEBUG("[tbm_bo information]\n");
- TBM_DEBUG("no bo refcnt size lock_cnt map_cnt flags surface\n");
-
- /* show the tbm_bo information in bo_list */
- if (!LIST_IS_EMPTY(&bufmgr->bo_list)) {
- LIST_FOR_EACH_ENTRY_SAFE(bo, tmp_bo, &bufmgr->bo_list, item_link) {
- TBM_DEBUG("%-4d%-11p %-4d %-6d %-5d %-4d %-3d %-11p\n",
- ++bo_cnt,
- bo,
- bo->ref_cnt,
- bufmgr->backend->bo_size(bo) / 1024,
- bo->lock_cnt,
- bo->map_cnt,
- bo->flags,
- bo->surface);
- }
- } else {
- TBM_DEBUG("no tbm_bos.\n");
- }
- TBM_DEBUG("\n");
-
- TBM_DEBUG("===============================================================\n");
-