fd = open(file_name, O_RDWR | O_CLOEXEC);
if (fd < 0) {
- TBM_BACKEND_ERR("Cannot open drm device(%s)", file_name);
+ TBM_BACKEND_ERR("fail to open drm device:%s", file_name);
return 0;
}
fd = open(file_name, O_RDWR | O_CLOEXEC);
if (fd < 0) {
- TBM_BACKEND_ERR("Cannot open drm device(%s)", file_name);
+ TBM_BACKEND_ERR("fail to open drm device:%s", file_name);
goto ret;
}
- TBM_BACKEND_INFO("open drm device (name:%s, fd:%d)", file_name, fd);
+ TBM_BACKEND_INFO("open drm device (name:%s fd:%d)", file_name, fd);
ret:
if (drm_device) udev_device_unref(drm_device);
arg.handle = bo_data->gem;
if (drmIoctl(bo_data->fd, DRM_IOCTL_MODE_MAP_DUMB, &arg)) {
- TBM_BACKEND_ERR("Cannot map_ gem=%d", bo_data->gem);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_MODE_MAP_DUMB bo_data:%p gem:%d",
+ bo_data->gem);
return (hal_tbm_bo_handle) NULL;
}
map = mmap(NULL, bo_data->size, PROT_READ | PROT_WRITE, MAP_SHARED,
bo_data->fd, arg.offset);
if (map == MAP_FAILED) {
- TBM_BACKEND_ERR("Cannot usrptr gem=%d", bo_data->gem);
+ TBM_BACKEND_ERR("fail to mmap bo_data:%p gem:%d", bo_data, bo_data->gem);
return (hal_tbm_bo_handle) NULL;
}
bo_data->pBase = map;
arg.handle = bo_data->gem;
if (drmIoctl(bo_data->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_BACKEND_ERR("Cannot dmabuf=%d", bo_data->gem);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD bo_data:%p gem:%d",
+ bo_data, bo_data->gem);
return (hal_tbm_bo_handle) NULL;
}
bo_data->dmabuf = arg.fd;
arg.handle = bo_data->gem;
if (drmIoctl(bo_data->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_BACKEND_ERR("Cannot dmabuf=%d", bo_data->gem);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD bo_data:%p gem:%d",
+ bo_data, bo_data->gem);
return (hal_tbm_bo_handle) NULL;
}
bo_data->dmabuf = arg.fd;
arg.width = size;
arg.flags = dumb_flags;
if (drmIoctl(bufmgr_data->fd, DRM_IOCTL_MODE_CREATE_DUMB, &arg)) {
- TBM_BACKEND_ERR("Cannot create bo_data(flag:%x, size:%d)", arg.flags,
- (unsigned int)size);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_MODE_CREATE_DUMB flag:%x size:%d",
+ arg.flags, (unsigned int)size);
free(bo_data);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
/* add bo to hash */
if (drmHashInsert(bufmgr_data->hashBos, bo_data->name, (void *)bo_data) < 0)
- TBM_BACKEND_ERR("error Cannot insert bo to Hash(%d)", bo_data->name);
+ TBM_BACKEND_ERR("fail to insert bo_data to Hash:%d bo_data:%p gem:%d",
+ bo_data->name, bo_data, bo_data->gem);
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), flags:%d(%d), size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->flags_tbm,
- bo_data->size);;
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d flags:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->flags_tbm,
+ bo_data->size);
if (error)
*error = HAL_TBM_ERROR_NONE;
arg.fd = key;
arg.flags = 0;
if (drmIoctl(bufmgr_data->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &arg)) {
- TBM_BACKEND_ERR("Cannot get gem handle from fd:%d (%m)",
- arg.fd);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_FD_TO_HANDLE key:%d (%m)",
+ arg.fd);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return NULL;
name = _get_name(bufmgr_data->fd, gem);
if (name == 0) {
- TBM_BACKEND_ERR("Cannot get name from gem:%d, fd:%d (%m)",
- gem, key);
+ TBM_BACKEND_ERR("fail to get name gem:%d (%m)", gem);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return NULL;
/* Open the same GEM object only for finding out its size */
open_arg.name = name;
if (drmIoctl(bufmgr_data->fd, DRM_IOCTL_GEM_OPEN, &open_arg)) {
- TBM_BACKEND_ERR("Cannot get gem info from gem:%d, fd:%d (%m)",
- gem, key);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_GEM_OPEN gem:%d name:%d (%m)",
+ gem, name);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return NULL;
struct drm_gem_close gem_close;
gem_close.handle = open_arg.handle;
if (drmIoctl(bufmgr_data->fd, DRM_IOCTL_GEM_CLOSE, &gem_close)) {
- TBM_BACKEND_ERR("Cannot close gem_handle (%m)");
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_GEM_CLOSE gem:%d (%m)", open_arg.handle);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return NULL;
bo_data = calloc(1, sizeof(struct _tbm_dumb_bo));
if (!bo_data) {
- TBM_BACKEND_ERR("bo_data:%p fail to allocate the bo_data", bo_data);
+ TBM_BACKEND_ERR("fail to allocate the bo_data private");
if (error)
*error = HAL_TBM_ERROR_OUT_OF_MEMORY;
return NULL;
/* add bo_data to hash */
if (drmHashInsert(bufmgr_data->hashBos, bo_data->name, (void *)bo_data) < 0)
- TBM_BACKEND_ERR("bo_data:%p Cannot insert bo_data to Hash(%d) from gem:%d, fd:%d",
- bo_data, bo_data->name, gem, key);
-
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d, size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- key,
- bo_data->flags_tbm,
- bo_data->size);
+ TBM_BACKEND_ERR("fail to insert bo_data to Hash:%d bo_data:%p gem:%d fd:%d",
+ bo_data->name, bo_data, gem, key);
+
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d key_fd:%d flags:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ key,
+ bo_data->flags_tbm,
+ bo_data->size);
if (error)
*error = HAL_TBM_ERROR_NONE;
arg.name = key;
if (drmIoctl(bufmgr_data->fd, DRM_IOCTL_GEM_OPEN, &arg)) {
- TBM_BACKEND_ERR("Cannot open gem name=%d", key);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_GEM_OPEN name:%d", key);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return NULL;
arg.handle = bo_data->gem;
if (drmIoctl(bo_data->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD gem=%d", bo_data->gem);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD bo_data:%p gem:d%d",
+ bo_data, bo_data->gem);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
free(bo_data);
/* add bo to hash */
if (drmHashInsert(bufmgr_data->hashBos, bo_data->name, (void *)bo_data) < 0)
- TBM_BACKEND_ERR("Cannot insert bo_data to Hash(%d)", bo_data->name);
+ TBM_BACKEND_ERR("fail to insert bo_data:%p to Hash:%d", bo_data, bo_data->name);
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- bo_data->flags_tbm,
- bo_data->size);
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d flags:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ bo_data->flags_tbm,
+ bo_data->size);
if (error)
*error = HAL_TBM_ERROR_NONE;
if (!bufmgr_data)
return;
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- bo_data->size);
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ bo_data->size);
if (bo_data->pBase) {
if (munmap(bo_data->pBase, bo_data->size) == -1) {
- TBM_BACKEND_ERR("bo_data:%p fail to munmap (%m)",
- bo_data);
+ TBM_BACKEND_ERR("fail to munmap bo_data:%p (%m)",
+ bo_data);
}
}
if (ret == 0)
drmHashDelete(bufmgr_data->hashBos, bo_data->name);
else
- TBM_BACKEND_ERR("Cannot find bo_data to Hash(%d), ret=%d", bo_data->name, ret);
+ TBM_BACKEND_ERR("fail to find bo_data to Hash:%d, ret:%d", bo_data->name, ret);
if (temp != bo_data)
TBM_BACKEND_ERR("hashBos probably has several BOs with same name!!!");
memset(&arg, 0, sizeof(arg));
arg.handle = bo_data->gem;
if (drmIoctl(bo_data->fd, DRM_IOCTL_GEM_CLOSE, &arg))
- TBM_BACKEND_ERR("bo_data:%p fail to gem close (%m)",
- bo_data);
+ TBM_BACKEND_ERR("fail to gem close bo_data:%p gem:%d (%m)",
+ bo_data, bo_data->gem);
free(bo_data);
}
}
if (!bo_data->gem) {
- TBM_BACKEND_ERR("Cannot map gem=%d", bo_data->gem);
+ TBM_BACKEND_ERR("invalid gem bo_data:%p", bo_data);
if (error)
*error = HAL_TBM_ERROR_INVALID_PARAMETER;
return (hal_tbm_bo_handle) NULL;
}
- TBM_BACKEND_DBG("bo_data:%p, gem:%d(%d), fd:%d, flags:%d, size:%d, %s",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- bo_data->flags_tbm,
- bo_data->size,
- STR_DEVICE[device]);
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d flags:%d size:%d %s",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ bo_data->flags_tbm,
+ bo_data->size,
+ STR_DEVICE[device]);
/*Get mapped bo_handle*/
bo_handle = _dumb_bo_handle(bo_data, device);
if (bo_handle.ptr == NULL) {
- TBM_BACKEND_ERR("Cannot get handle: gem:%d, device:%d",
- bo_data->gem, device);
+ TBM_BACKEND_ERR("fail to get handle bo_data:%p gem:%d device:%d",
+ bo_data, bo_data->gem, device);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return (hal_tbm_bo_handle) NULL;
}
if (!bo_data->gem) {
- TBM_BACKEND_ERR("Cannot map gem=%d", bo_data->gem);
+ TBM_BACKEND_ERR("invalid gem bo_data:%p", bo_data);
if (error)
*error = HAL_TBM_ERROR_INVALID_PARAMETER;
return (hal_tbm_bo_handle) NULL;
}
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, %s, %s",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- STR_DEVICE[device],
- STR_OPT[opt]);
+ TBM_BACKEND_DBG("bo_data:%p, gem:%d name:%d fd:%d %s %s",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ STR_DEVICE[device],
+ STR_OPT[opt]);
/*Get mapped bo_handle*/
bo_handle = _dumb_bo_handle(bo_data, device);
if (bo_handle.ptr == NULL) {
- TBM_BACKEND_ERR("Cannot get handle: gem:%d, device:%d, opt:%d",
- bo_data->gem, device, opt);
+ TBM_BACKEND_ERR("fail to get handle gem:%d device:%d opt:%d",
+ bo_data->gem, device, opt);
if (error)
*error = HAL_TBM_ERROR_INVALID_PARAMETER;
return (hal_tbm_bo_handle) NULL;
if (!bo_data->gem)
return HAL_TBM_ERROR_INVALID_PARAMETER;
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf);
+ TBM_BACKEND_DBG("bo_data:%p, gem:%d name:%d fd:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf);
return HAL_TBM_ERROR_NONE;
}
arg.handle = bo_data->gem;
ret = drmIoctl(bo_data->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg);
if (ret) {
- TBM_BACKEND_ERR("bo_data:%p Cannot dmabuf=%d (%m)",
- bo_data, bo_data->gem);
+ TBM_BACKEND_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD bo_data:%p gem:%d (%m)",
+ bo_data, bo_data->gem);
if (error)
*error = HAL_TBM_ERROR_INVALID_OPERATION;
return (hal_tbm_fd)ret;
}
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d, size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- arg.fd,
- bo_data->flags_tbm,
- bo_data->size);
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d key_fd:%d flags:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ arg.fd,
+ bo_data->flags_tbm,
+ bo_data->size);
if (error)
*error = HAL_TBM_ERROR_NONE;
if (!bo_data->name) {
bo_data->name = _get_name(bo_data->fd, bo_data->gem);
if (!bo_data->name) {
- TBM_BACKEND_ERR("error Cannot get name");
+ TBM_BACKEND_ERR("fail to get name bo_data:%p", bo_data);
if (error)
*error = HAL_TBM_ERROR_INVALID_PARAMETER;
return 0;
}
}
- TBM_BACKEND_DBG(" bo_data:%p, gem:%d(%d), fd:%d, flags:%d, size:%d",
- bo_data,
- bo_data->gem, bo_data->name,
- bo_data->dmabuf,
- bo_data->flags_tbm,
- bo_data->size);
+ TBM_BACKEND_DBG("bo_data:%p gem:%d name:%d fd:%d flags:%d size:%d",
+ bo_data,
+ bo_data->gem,
+ bo_data->name,
+ bo_data->dmabuf,
+ bo_data->flags_tbm,
+ bo_data->size);
if (error)
*error = HAL_TBM_ERROR_NONE;