snprintf(tmp_file, sizeof(tmp_file), "/tmp/tbm_debug_show_%d%d", getpid(), c++);
if ((f = fopen(tmp_file, "a+")) != NULL) {
+ WL_TBM_LOG_E("fail to open tmp_file.");
fprintf(f, "%s", show_str);
fclose(f);
}
if (!tbm_client->bufmgr) {
tbm_client->bufmgr = tbm_bufmgr_init(-1);
if (!tbm_client->bufmgr) {
- WL_TBM_LOG("failed to get auth_info");
+ WL_TBM_LOG_E("failed to get auth_info");
wl_tbm_destroy(tbm_client->wl_tbm);
tbm_client->wl_tbm = NULL;
return;
display_wrapper = wl_proxy_create_wrapper(display);
if (!display_wrapper) {
- WL_TBM_LOG("Failed to create display_wrapper.");
+ WL_TBM_LOG_E("Failed to create display_wrapper.");
free(tbm_client);
return NULL;
}
wl_queue = wl_display_create_queue(display);
if (!wl_queue) {
- WL_TBM_LOG("Failed to create queue.");
+ WL_TBM_LOG_E("Failed to create queue.");
wl_proxy_wrapper_destroy(display_wrapper);
free(tbm_client);
return NULL;
wl_registry = wl_display_get_registry(display_wrapper);
wl_proxy_wrapper_destroy(display_wrapper);
if (!wl_registry) {
- WL_TBM_LOG("Failed to get registry");
+ WL_TBM_LOG_E("Failed to get registry");
wl_event_queue_destroy(wl_queue);
free(tbm_client);
wl_registry_add_listener(wl_registry, ®istry_listener, tbm_client);
if (wl_display_roundtrip_queue(display, wl_queue) < 0) {
- WL_TBM_LOG("Failed to wl_display_roundtrip_queue");
+ WL_TBM_LOG_E("Failed to wl_display_roundtrip_queue");
wl_registry_destroy(wl_registry);
wl_event_queue_destroy(wl_queue);
/* check wl_tbm */
if (!tbm_client->wl_tbm) {
- WL_TBM_LOG("failed to create wl_tbm");
+ WL_TBM_LOG_E("failed to create wl_tbm");
wayland_tbm_client_deinit(tbm_client);
return NULL;
}
return buffer->wl_buffer;
if (tbm_surface_get_info(surface, &info) != TBM_SURFACE_ERROR_NONE) {
- WL_TBM_LOG("Failed to create buffer from surface");
+ WL_TBM_LOG_E("Failed to create buffer from surface");
return NULL;
}
if (info.num_planes > 3) {
- WL_TBM_LOG("invalid num_planes(%d)", info.num_planes);
+ WL_TBM_LOG_E("invalid num_planes(%d)", info.num_planes);
return NULL;
}
num_buf = tbm_surface_internal_get_num_bos(surface);
if (num_buf == 0) {
- WL_TBM_LOG("surface doesn't have any bo.");
+ WL_TBM_LOG_E("surface doesn't have any bo.");
return NULL;
}
for (i = 0; i < num_buf; i++) {
tbm_bo bo = tbm_surface_internal_get_bo(surface, i);
if (bo == NULL) {
- WL_TBM_LOG("Failed to get bo from surface");
+ WL_TBM_LOG_E("Failed to get bo from surface");
goto err;
}
if (is_fd == -1 ||
(is_fd == 1 && bufs[i] < 0) ||
(is_fd == 0 && bufs[i] <= 0)) {
- WL_TBM_LOG("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
+ WL_TBM_LOG_E("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
goto err;
}
}
wl_array_release(&plane_size);
if (!wl_buffer) {
- WL_TBM_LOG("Failed to create wl_buffer");
+ WL_TBM_LOG_E("Failed to create wl_buffer");
goto err;
}
pthread_mutex_lock(&queue_info->lock);
if (queue_info->is_active) {
- WL_TBM_C_LOG("warning: queue_info is already activated");
+ WL_TBM_LOG_E("warning: queue_info is already activated");
pthread_mutex_unlock(&queue_info->lock);
return;
}
pthread_mutex_lock(&queue_info->lock);
if (!queue_info->is_active) {
- WL_TBM_C_LOG("warning: queue_info is already deactivated");
+ WL_TBM_LOG_E("warning: queue_info is already deactivated");
pthread_mutex_unlock(&queue_info->lock);
return;
}
pthread_mutex_lock(&queue_info->lock);
if (queue_info->is_active && queue_info->active_flush) {
- WL_TBM_C_LOG("warning: Cannot flush the tbm_surface_queueu. The queue is activate.");
+ WL_TBM_LOG_E("warning: Cannot flush the tbm_surface_queueu. The queue is activate.");
pthread_mutex_unlock(&queue_info->lock);
return;
}
tbm_buffer = calloc(1, sizeof(*tbm_buffer));
if (tbm_buffer == NULL) {
- WL_TBM_S_LOG("Error. fail to allocate a tbm_buffer.");
+ WL_TBM_LOG_E("Error. fail to allocate a tbm_buffer.");
return NULL;
}
wl_list_init(&tbm_buffer->link_ref);
/* create a wl_buffer resource */
tbm_buffer->wl_buffer = wl_resource_create(wl_client, &wl_buffer_interface, 1, id);
if (!tbm_buffer->wl_buffer) {
- WL_TBM_S_LOG("Error. fail to create wl_buffer resource.");
+ WL_TBM_LOG_E("Error. fail to create wl_buffer resource.");
free(tbm_buffer);
return NULL;
}
numPlane = tbm_surface_internal_get_num_planes(format);
if (numPlane != num_plane) {
+ WL_TBM_LOG_E("invalid numPlane.");
wl_resource_post_error(wl_tbm, WL_TBM_ERROR_INVALID_FORMAT,
"invalid format");
return;
surface = tbm_surface_internal_create_with_bos(&info, bos, num_buf);
if (surface == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_surface.");
wl_resource_post_no_memory(wl_tbm);
return;
}
tbm_buffer = _wayland_tbm_server_tbm_buffer_create(wl_tbm, client, surface, id, flags);
if (tbm_buffer == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_buffer.");
wl_resource_post_no_memory(wl_tbm);
tbm_surface_destroy(surface);
return;
numPlane = tbm_surface_internal_get_num_planes(format);
if (numPlane != num_plane) {
+ WL_TBM_LOG_E("invalid numPlane.");
wl_resource_post_error(wl_tbm, WL_TBM_ERROR_INVALID_FORMAT,
"invalid format");
goto done;
surface = tbm_surface_internal_create_with_bos(&info, bos, num_buf);
if (surface == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_surface.");
wl_resource_post_no_memory(wl_tbm);
goto done;
}
tbm_buffer = _wayland_tbm_server_tbm_buffer_create(wl_tbm, client, surface, id, flags);
if (tbm_buffer == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_buffer.");
wl_resource_post_no_memory(wl_tbm);
tbm_surface_destroy(surface);
goto done;
cqueue = calloc(1, sizeof(struct wayland_tbm_client_queue));
if (!cqueue) {
+ WL_TBM_LOG_E("fail to allocate the cqueue.");
wl_resource_post_no_memory(wl_tbm);
return;
}
&wl_tbm_queue_interface,
1, surface_queue);
if (!cqueue->wl_tbm_queue) {
+ WL_TBM_LOG_E("fail to create the wl_tbm_queue.");
wl_resource_post_no_memory(wl_tbm);
free(cqueue);
return;
int *p;
if (tbm_surface_get_info(surface, &info) != TBM_SURFACE_ERROR_NONE) {
- WL_TBM_S_LOG("Failed to create buffer from surface");
+ WL_TBM_LOG_E("Failed to create buffer from surface");
return 0;
}
if (info.num_planes > 3) {
- WL_TBM_S_LOG("invalid num_planes(%d)", info.num_planes);
+ WL_TBM_LOG_E("invalid num_planes(%d)", info.num_planes);
return 0;
}
num_buf = tbm_surface_internal_get_num_bos(surface);
if (num_buf == 0) {
- WL_TBM_S_LOG("surface doesn't have any bo.");
+ WL_TBM_LOG_E("surface doesn't have any bo.");
return 0;
}
for (i = 0; i < num_buf; i++) {
tbm_bo bo = tbm_surface_internal_get_bo(surface, i);
- if (bo == NULL)
+ if (bo == NULL) {
+ WL_TBM_LOG_E("fail to get the bo.");
goto err;
+ }
/* try to get fd first */
if (is_fd == -1 || is_fd == 1) {
if (is_fd == -1 ||
(is_fd == 1 && bufs[i] < 0) ||
(is_fd == 0 && bufs[i] <= 0)) {
- WL_TBM_S_LOG("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
+ WL_TBM_LOG_E("Failed to export(is_fd:%d, bufs:%d)", is_fd, bufs[i]);
goto err;
}
}
tbm_buffer = _wayland_tbm_server_tbm_buffer_create(wl_tbm, 0, surface,
0, 0);
if (tbm_buffer == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_buffer.");
tbm_surface_internal_unref(surface);
return NULL;
}
if (!_wayland_tbm_server_export_surface(wl_tbm,
tbm_buffer->wl_buffer,
surface)) {
- WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue");
+ WL_TBM_LOG_E("Failed to send the surface to the wl_tbm_queue");
wl_resource_destroy(tbm_buffer->wl_buffer);
tbm_surface_internal_unref(surface);
return NULL;
tbm_buffer = _wayland_tbm_server_tbm_buffer_create(wl_tbm, 0, surface,
0, 0);
if (tbm_buffer == NULL) {
+ WL_TBM_LOG_E("fail to create the tbm_buffer.");
tbm_surface_internal_unref(surface);
return NULL;
}
if (!_wayland_tbm_server_export_surface(cqueue->wl_tbm,
tbm_buffer->wl_buffer,
surface)) {
- WL_TBM_S_LOG("Failed to send the surface to the wl_tbm_queue");
+ WL_TBM_LOG_E("Failed to send the surface to the wl_tbm_queue");
wl_resource_destroy(tbm_buffer->wl_buffer);
tbm_surface_internal_unref(surface);
return NULL;