return app_name;
}
-#define TBM_EXYNOS_LOG(fmt, args...) LOGE("\033[31m" "[%s]" fmt "\033[0m", target_name(), ##args)
-#define DBG(fmt, args...) {if (bDebug&01) LOGE(fmt, ##args); }
+#define TBM_EXYNOS_ERROR(fmt, args...) LOGE("\033[31m" "[%s] " fmt "\033[0m", target_name(), ##args)
+#define TBM_EXYNOS_DEBUG(fmt, args...) {if (bDebug&01) LOGD("[%s] " fmt, target_name(), ##args); }
#else
-#define TBM_EXYNOS_LOG(...)
-#define DBG(...)
+#define TBM_EXYNOS_ERROR(...)
+#define TBM_EXYNOS_DEBUG(...)
#endif
#define SIZE_ALIGN(value, base) (((value) + ((base) - 1)) & ~((base) - 1))
/* check condition */
#define EXYNOS_RETURN_IF_FAIL(cond) {\
if (!(cond)) {\
- TBM_EXYNOS_LOG("[%s] : '%s' failed.\n", __func__, #cond);\
+ TBM_EXYNOS_ERROR("[%s] : '%s' failed.\n", __func__, #cond);\
return;\
} \
}
#define EXYNOS_RETURN_VAL_IF_FAIL(cond, val) {\
if (!(cond)) {\
- TBM_EXYNOS_LOG("[%s] : '%s' failed.\n", __func__, #cond);\
+ TBM_EXYNOS_ERROR("[%s] : '%s' failed.\n", __func__, #cond);\
return val;\
} \
}
err = ioctl(fd, TGL_IOCTL_GET_VERSION, &data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) %s:%d\n", strerror(errno));
+ TBM_EXYNOS_ERROR("error(%s) %s:%d\n", strerror(errno));
return 0;
}
- DBG("tgl version is (%u, %u).\n", data.major, data.minor);
+ TBM_EXYNOS_DEBUG("tgl version is (%u, %u).\n", data.major, data.minor);
return 1;
}
err = ioctl(fd, TGL_IOCTL_REGISTER, &data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d\n", strerror(errno), key);
+ TBM_EXYNOS_ERROR("error(%s) key:%d\n", strerror(errno), key);
return 0;
}
data.key = key;
err = ioctl(fd, TGL_IOCTL_UNREGISTER, &data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d\n", strerror(errno), key);
+ TBM_EXYNOS_ERROR("error(%s) key:%d\n", strerror(errno), key);
return 0;
}
err = ioctl(fd, TGL_IOCTL_LOCK, data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d opt:%d\n",
+ TBM_EXYNOS_ERROR("error(%s) key:%d opt:%d\n",
strerror(errno), key, opt);
return 0;
}
err = ioctl(fd, TGL_IOCTL_UNLOCK, data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d\n",
+ TBM_EXYNOS_ERROR("error(%s) key:%d\n",
strerror(errno), key);
return 0;
}
err = ioctl(fd, TGL_IOCTL_SET_DATA, &data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d\n",
+ TBM_EXYNOS_ERROR("error(%s) key:%d\n",
strerror(errno), key);
return 0;
}
err = ioctl(fd, TGL_IOCTL_GET_DATA, &data);
if (err) {
- TBM_EXYNOS_LOG("error(%s) key:%d\n",
+ TBM_EXYNOS_ERROR("error(%s) key:%d\n",
strerror(errno), key);
return 0;
}
ret = drmCommandWriteRead(bufmgr_exynos->fd, DRM_EXYNOS_GEM_CACHE_OP, &cache_op,
sizeof(cache_op));
if (ret) {
- TBM_EXYNOS_LOG("warning fail to flush the cache.\n");
+ TBM_EXYNOS_ERROR("fail to flush the cache.\n");
return 0;
}
/* call cache flush */
_exynos_cache_flush(bufmgr_exynos, bo_exynos, need_flush);
- DBG("[libtbm:%d] \tcache(%d,%d)....flush:0x%x, cntFlush(%d)\n",
- getpid(),
+ TBM_EXYNOS_DEBUG(" \tcache(%d,%d)....flush:0x%x, cntFlush(%d)\n",
bo_exynos->cache_state.data.isCached,
bo_exynos->cache_state.data.isDirtied,
need_flush,
if (bufmgr_exynos->tgl_fd < 0) {
bufmgr_exynos->tgl_fd = open(tgl_devfile1, O_RDWR);
if (bufmgr_exynos->tgl_fd < 0) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "warning: Fail to open global_lock:%s\n",
- getpid(), tgl_devfile1);
+ TBM_EXYNOS_ERROR("fail to open global_lock:%s\n",
+ tgl_devfile1);
return 0;
}
}
#ifdef TGL_GET_VERSION
if (!_tgl_get_version(bufmgr_exynos->tgl_fd)) {
- TBM_EXYNOS_LOG("fail to get tgl_version. tgl init failed.\n");
+ TBM_EXYNOS_ERROR("fail to get tgl_version. tgl init failed.\n");
close(bufmgr_sprd->tgl_fd);
return 0;
}
#endif
if (!_tgl_init(bufmgr_exynos->tgl_fd, GLOBAL_KEY)) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "warning: Fail to initialize the tgl\n",
- getpid());
-
+ TBM_EXYNOS_ERROR("fail to initialize the tgl\n");
close(bufmgr_exynos->tgl_fd);
return 0;
}
fd = drmOpen(EXYNOS_DRM_NAME, NULL);
if (fd < 0) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "warning %s:%d fail to open drm\n",
- getpid(), __FUNCTION__, __LINE__);
+ TBM_EXYNOS_ERROR("fail to open drm.(%s)\n", EXYNOS_DRM_NAME);
}
if (fd < 0) {
struct stat s;
int ret;
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "%s:%d search drm-device by udev\n",
- getpid(), __FUNCTION__, __LINE__);
+ TBM_EXYNOS_DEBUG("search drm-device by udev\n");
udev = udev_new();
if (!udev) {
- TBM_EXYNOS_LOG("udev_new() failed.\n");
+ TBM_EXYNOS_ERROR("udev_new() failed.\n");
return -1;
}
if (device_parent) {
if (strcmp(udev_device_get_sysname(device_parent), "exynos-drm") == 0) {
drm_device = device;
- DBG("[%s] Found render device: '%s' (%s)\n",
+ TBM_EXYNOS_DEBUG("[%s] Found render device: '%s' (%s)\n",
target_name(),
udev_device_get_syspath(drm_device),
udev_device_get_sysname(device_parent));
/* Get device file path. */
filepath = udev_device_get_devnode(drm_device);
if (!filepath) {
- TBM_EXYNOS_LOG("udev_device_get_devnode() failed.\n");
+ TBM_EXYNOS_ERROR("udev_device_get_devnode() failed.\n");
udev_device_unref(drm_device);
udev_unref(udev);
return -1;
/* Open DRM device file and check validity. */
fd = open(filepath, O_RDWR | O_CLOEXEC);
if (fd < 0) {
- TBM_EXYNOS_LOG("open(%s, O_RDWR | O_CLOEXEC) failed.\n");
+ TBM_EXYNOS_ERROR("open(%s, O_RDWR | O_CLOEXEC) failed.\n");
udev_device_unref(drm_device);
udev_unref(udev);
return -1;
ret = fstat(fd, &s);
if (ret) {
- TBM_EXYNOS_LOG("fstat() failed %s.\n");
+ TBM_EXYNOS_ERROR("fstat() failed %s.\n");
close(fd);
udev_device_unref(drm_device);
udev_unref(udev);
udev = udev_new();
if (!udev) {
- TBM_EXYNOS_LOG("udev_new() failed.\n");
+ TBM_EXYNOS_ERROR("udev_new() failed.\n");
return -1;
}
if (device_parent) {
if (strcmp(udev_device_get_sysname(device_parent), "exynos-drm") == 0) {
drm_device = device;
- DBG("[%s] Found render device: '%s' (%s)\n",
- target_name(),
+ TBM_EXYNOS_DEBUG("Found render device: '%s' (%s)\n",
udev_device_get_syspath(drm_device),
udev_device_get_sysname(device_parent));
break;
udev = udev_new();
if (!udev) {
- TBM_EXYNOS_LOG("udev_new() failed.\n");
+ TBM_EXYNOS_ERROR("udev_new() failed.\n");
return -1;
}
if (device_parent) {
if (strcmp(udev_device_get_sysname(device_parent), "exynos-drm") == 0) {
drm_device = device;
- DBG("[%s] Found render device: '%s' (%s)\n",
- target_name(),
+ TBM_EXYNOS_DEBUG("Found render device: '%s' (%s)\n",
udev_device_get_syspath(drm_device),
udev_device_get_sysname(device_parent));
break;
/* Get device file path. */
filepath = udev_device_get_devnode(drm_device);
if (!filepath) {
- TBM_EXYNOS_LOG("udev_device_get_devnode() failed.\n");
+ TBM_EXYNOS_ERROR("udev_device_get_devnode() failed.\n");
udev_device_unref(drm_device);
udev_unref(udev);
return -1;
/* Open DRM device file and check validity. */
fd = open(filepath, O_RDWR | O_CLOEXEC);
if (fd < 0) {
- TBM_EXYNOS_LOG("open(%s, O_RDWR | O_CLOEXEC) failed.\n");
+ TBM_EXYNOS_ERROR("open(%s, O_RDWR | O_CLOEXEC) failed.\n");
udev_device_unref(drm_device);
udev_unref(udev);
return -1;
ret = fstat(fd, &s);
if (ret) {
- TBM_EXYNOS_LOG("fstat() failed %s.\n");
+ TBM_EXYNOS_ERROR("fstat() failed %s.\n");
udev_device_unref(drm_device);
udev_unref(udev);
close(fd);
arg.handle = gem;
if (drmIoctl(fd, DRM_IOCTL_GEM_FLINK, &arg)) {
- TBM_EXYNOS_LOG("error fail to get flink from gem:%d (DRM_IOCTL_GEM_FLINK)\n",
- gem);
+ TBM_EXYNOS_ERROR("fail to DRM_IOCTL_GEM_FLINK gem:%d", gem);
return 0;
}
arg.handle = bo_exynos->gem;
if (drmCommandWriteRead(bo_exynos->fd, DRM_EXYNOS_GEM_MAP, &arg,
sizeof(arg))) {
- TBM_EXYNOS_LOG("error Cannot map_dumb gem=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot map_dumb gem=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
map = mmap(NULL, bo_exynos->size, PROT_READ | PROT_WRITE, MAP_SHARED,
bo_exynos->fd, arg.offset);
if (map == MAP_FAILED) {
- TBM_EXYNOS_LOG("error Cannot usrptr gem=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot usrptr gem=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
bo_exynos->pBase = map;
arg.handle = bo_exynos->gem;
if (drmIoctl(bo_exynos->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_EXYNOS_LOG("error Cannot dmabuf=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot dmabuf=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
bo_exynos->dmabuf = arg.fd;
arg.handle = bo_exynos->gem;
if (drmIoctl(bo_exynos->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_EXYNOS_LOG("error Cannot dmabuf=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot dmabuf=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
bo_exynos->dmabuf = arg.fd;
bo_handle.u32 = (uint32_t)bo_exynos->dmabuf;
break;
default:
- TBM_EXYNOS_LOG("error Not supported device:%d\n", device);
+ TBM_EXYNOS_ERROR("Not supported device:%d\n", device);
bo_handle.ptr = (void *) NULL;
break;
}
bo_exynos = calloc(1, sizeof(struct _tbm_bo_exynos));
if (!bo_exynos) {
- TBM_EXYNOS_LOG("error fail to allocate the bo private\n");
+ TBM_EXYNOS_ERROR("fail to allocate the bo private\n");
return 0;
}
arg.flags = exynos_flags;
if (drmCommandWriteRead(bufmgr_exynos->fd, DRM_EXYNOS_GEM_CREATE, &arg,
sizeof(arg))) {
- TBM_EXYNOS_LOG("error Cannot create bo(flag:%x, size:%d)\n", arg.flags,
+ TBM_EXYNOS_ERROR("Cannot create bo(flag:%x, size:%d)\n", arg.flags,
(unsigned int)arg.size);
free(bo_exynos);
return 0;
bo_exynos->name = _get_name(bo_exynos->fd, bo_exynos->gem);
if (!_bo_init_cache_state(bufmgr_exynos, bo_exynos, 0)) {
- TBM_EXYNOS_LOG("error fail init cache state(%d)\n", bo_exynos->name);
+ TBM_EXYNOS_ERROR("fail init cache state(%d)\n", bo_exynos->name);
free(bo_exynos);
return 0;
}
arg.handle = bo_exynos->gem;
if (drmIoctl(bo_exynos->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_EXYNOS_LOG("error Cannot dmabuf=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot dmabuf=%d\n", bo_exynos->gem);
free(bo_exynos);
return 0;
}
PrivGem *privGem = calloc(1, sizeof(PrivGem));
if (!privGem) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "error %s:%d Fail to calloc privGem\n",
- getpid(), __func__, __LINE__);
+ TBM_EXYNOS_ERROR("fail to calloc privGem\n");
free(bo_exynos);
return 0;
}
if (drmHashInsert(bufmgr_exynos->hashBos, bo_exynos->name,
(void *)privGem) < 0) {
- TBM_EXYNOS_LOG("error Cannot insert bo to Hash(%d)\n", bo_exynos->name);
+ TBM_EXYNOS_ERROR("Cannot insert bo to Hash(%d)\n", bo_exynos->name);
}
- DBG(" [%s] bo:%p, gem:%d(%d), flags:%d(%d), size:%d\n", target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), flags:%d(%d), size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
flags, exynos_flags,
bo_exynos = (tbm_bo_exynos)tbm_backend_get_bo_priv(bo);
EXYNOS_RETURN_IF_FAIL(bo_exynos != NULL);
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, size:%d\n", target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
if (bo_exynos->pBase) {
if (munmap(bo_exynos->pBase, bo_exynos->size) == -1) {
- TBM_EXYNOS_LOG("error bo:%p fail to munmap(%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p fail to munmap(%s)\n",
bo, strerror(errno));
}
}
privGem = NULL;
}
} else {
- TBM_EXYNOS_LOG("warning Cannot find bo to Hash(%d), ret=%d\n", bo_exynos->name,
- ret);
+ TBM_EXYNOS_ERROR("Cannot find bo to Hash(%d), ret=%d\n",
+ bo_exynos->name, ret);
}
_bo_destroy_cache_state(bufmgr_exynos, bo_exynos);
memset(&arg, 0, sizeof(arg));
arg.handle = bo_exynos->gem;
if (drmIoctl(bo_exynos->fd, DRM_IOCTL_GEM_CLOSE, &arg)) {
- TBM_EXYNOS_LOG("error bo:%p fail to gem close.(%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p fail to gem close.(%s)\n",
bo, strerror(errno));
}
arg.name = key;
if (drmIoctl(bufmgr_exynos->fd, DRM_IOCTL_GEM_OPEN, &arg)) {
- TBM_EXYNOS_LOG("error Cannot open gem name=%d\n", key);
+ TBM_EXYNOS_ERROR("Cannot open gem name=%d\n", key);
return 0;
}
DRM_EXYNOS_GEM_GET,
&info,
sizeof(struct drm_exynos_gem_info))) {
- TBM_EXYNOS_LOG("error Cannot get gem info=%d\n", key);
+ TBM_EXYNOS_ERROR("Cannot get gem info=%d\n", key);
return 0;
}
bo_exynos = calloc(1, sizeof(struct _tbm_bo_exynos));
if (!bo_exynos) {
- TBM_EXYNOS_LOG("error fail to allocate the bo private\n");
+ TBM_EXYNOS_ERROR("fail to allocate the bo private\n");
return 0;
}
bo_exynos->flags_tbm = _get_tbm_flag_from_exynos(bo_exynos->flags_exynos);
if (!_bo_init_cache_state(bufmgr_exynos, bo_exynos, 1)) {
- TBM_EXYNOS_LOG("error fail init cache state(%d)\n", bo_exynos->name);
+ TBM_EXYNOS_ERROR("fail init cache state(%d)\n", bo_exynos->name);
free(bo_exynos);
return 0;
}
arg.handle = bo_exynos->gem;
if (drmIoctl(bo_exynos->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) {
- TBM_EXYNOS_LOG("error Cannot dmabuf=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD gem=%d\n", bo_exynos->gem);
free(bo_exynos);
return 0;
}
privGem = calloc(1, sizeof(PrivGem));
if (!privGem) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "error %s:%d Fail to calloc privGem\n",
- getpid(), __func__, __LINE__);
+ TBM_EXYNOS_ERROR("fail to calloc privGem\n");
free(bo_exynos);
return 0;
}
if (drmHashInsert(bufmgr_exynos->hashBos, bo_exynos->name,
(void *)privGem) < 0) {
- TBM_EXYNOS_LOG("error Cannot insert bo to Hash(%d)\n", bo_exynos->name);
+ TBM_EXYNOS_ERROR("Cannot insert bo to Hash(%d)\n", bo_exynos->name);
}
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d\n",
- target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
arg.fd = key;
arg.flags = 0;
if (drmIoctl(bufmgr_exynos->fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &arg)) {
- TBM_EXYNOS_LOG("error bo:%p Cannot get gem handle from fd:%d (%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p Cannot get gem handle from fd:%d (%s)\n",
bo, arg.fd, strerror(errno));
return NULL;
}
name = _get_name(bufmgr_exynos->fd, gem);
if (!name) {
- TBM_EXYNOS_LOG("error bo:%p Cannot get name from gem:%d, fd:%d (%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p Cannot get name from gem:%d, fd:%d (%s)\n",
bo, gem, key, strerror(errno));
return 0;
}
DRM_EXYNOS_GEM_GET,
&info,
sizeof(struct drm_exynos_gem_info))) {
- TBM_EXYNOS_LOG("error bo:%p Cannot get gem info from gem:%d, fd:%d (%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p Cannot get gem info from gem:%d, fd:%d (%s)\n",
bo, gem, key, strerror(errno));
return 0;
}
bo_exynos = calloc(1, sizeof(struct _tbm_bo_exynos));
if (!bo_exynos) {
- TBM_EXYNOS_LOG("error bo:%p fail to allocate the bo private\n", bo);
+ TBM_EXYNOS_ERROR("bo:%p fail to allocate the bo private\n", bo);
return 0;
}
bo_exynos->name = name;
if (!_bo_init_cache_state(bufmgr_exynos, bo_exynos, 1)) {
- TBM_EXYNOS_LOG("error fail init cache state(%d)\n", bo_exynos->name);
+ TBM_EXYNOS_ERROR("fail init cache state(%d)\n", bo_exynos->name);
free(bo_exynos);
return 0;
}
privGem = calloc(1, sizeof(PrivGem));
if (!privGem) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
- "error %s:%d Fail to calloc privGem\n",
- getpid(), __func__, __LINE__);
+ TBM_EXYNOS_ERROR("fail to calloc privGem\n");
free(bo_exynos);
return 0;
}
if (drmHashInsert(bufmgr_exynos->hashBos, bo_exynos->name,
(void *)privGem) < 0) {
- TBM_EXYNOS_LOG("error bo:%p Cannot insert bo to Hash(%d) from gem:%d, fd:%d\n",
+ TBM_EXYNOS_ERROR("bo:%p Cannot insert bo to Hash(%d) from gem:%d, fd:%d\n",
bo, bo_exynos->name, gem, key);
}
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d(%d), size:%d\n",
- target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d(%d), size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
if (!bo_exynos->name) {
bo_exynos->name = _get_name(bo_exynos->fd, bo_exynos->gem);
if (!bo_exynos->name) {
- TBM_EXYNOS_LOG("error Cannot get name\n");
+ TBM_EXYNOS_ERROR("Cannot get name\n");
return 0;
}
}
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d\n",
- target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
arg.handle = bo_exynos->gem;
ret = drmIoctl(bo_exynos->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg);
if (ret) {
- TBM_EXYNOS_LOG("error bo:%p Cannot dmabuf=%d (%s)\n",
+ TBM_EXYNOS_ERROR("bo:%p Cannot dmabuf=%d (%s)\n",
bo, bo_exynos->gem, strerror(errno));
return (tbm_fd) ret;
}
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d(%d), size:%d\n",
- target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d(%d), size:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, (tbm_bo_handle) NULL);
if (!bo_exynos->gem) {
- TBM_EXYNOS_LOG("error Cannot map gem=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot map gem=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
- DBG("[%s] bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d, %s\n",
- target_name(),
+ TBM_EXYNOS_DEBUG("bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d, %s\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
/*Get mapped bo_handle*/
bo_handle = _exynos_bo_handle(bo_exynos, device);
if (bo_handle.ptr == NULL) {
- TBM_EXYNOS_LOG("error Cannot get handle: gem:%d, device:%d\n", bo_exynos->gem,
- device);
+ TBM_EXYNOS_ERROR("Cannot get handle: gem:%d, device:%d\n",
+ bo_exynos->gem, device);
return (tbm_bo_handle) NULL;
}
EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, (tbm_bo_handle) NULL);
if (!bo_exynos->gem) {
- TBM_EXYNOS_LOG("error Cannot map gem=%d\n", bo_exynos->gem);
+ TBM_EXYNOS_ERROR("Cannot map gem=%d\n", bo_exynos->gem);
return (tbm_bo_handle) NULL;
}
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, %s, %s\n", target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d, %s, %s\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf,
/*Get mapped bo_handle*/
bo_handle = _exynos_bo_handle(bo_exynos, device);
if (bo_handle.ptr == NULL) {
- TBM_EXYNOS_LOG("error Cannot get handle: gem:%d, device:%d, opt:%d\n",
+ TBM_EXYNOS_ERROR("Cannot get handle: gem:%d, device:%d, opt:%d\n",
bo_exynos->gem, device, opt);
return (tbm_bo_handle) NULL;
}
bo_exynos->last_map_device = -1;
- DBG(" [%s] bo:%p, gem:%d(%d), fd:%d\n", target_name(),
+ TBM_EXYNOS_DEBUG(" bo:%p, gem:%d(%d), fd:%d\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf);
int ret = 0;
if (device != TBM_DEVICE_3D && device != TBM_DEVICE_CPU) {
- DBG("[libtbm-exynos:%d] %s not support device type,\n", getpid(),
- __func__);
+ TBM_EXYNOS_DEBUG("Not support device type,\n");
return 0;
}
if (device == TBM_DEVICE_3D)
fence.type = DMA_BUF_ACCESS_READ | DMA_BUF_ACCESS_DMA;
} else {
- TBM_EXYNOS_LOG("error Invalid argument\n");
+ TBM_EXYNOS_ERROR("Invalid argument\n");
return 0;
}
/* Check if the tbm manager supports dma fence or not. */
if (!bufmgr_exynos->use_dma_fence) {
- TBM_EXYNOS_LOG("error Not support DMA FENCE(%s)\n", strerror(errno));
+ TBM_EXYNOS_ERROR("Not support DMA FENCE(%s)\n", strerror(errno));
return 0;
}
if (device == TBM_DEVICE_3D) {
ret = ioctl(bo_exynos->dmabuf, DMABUF_IOCTL_GET_FENCE, &fence);
if (ret < 0) {
- TBM_EXYNOS_LOG("error Cannot set GET FENCE(%s)\n", strerror(errno));
+ TBM_EXYNOS_ERROR("Cannot set GET FENCE(%s)\n", strerror(errno));
return 0;
}
} else {
if (i == DMA_FENCE_LIST_MAX) {
/*TODO: if dma_fence list is full, it needs realloc. I will fix this. by minseok3.kim*/
- TBM_EXYNOS_LOG("error fence list is full\n");
+ TBM_EXYNOS_ERROR("fence list is full\n");
}
}
pthread_mutex_unlock(&bo_exynos->mutex);
- DBG("[%s] DMABUF_IOCTL_GET_FENCE! bo:%p, gem:%d(%d), fd:%ds\n", target_name(),
+ TBM_EXYNOS_DEBUG("DMABUF_IOCTL_GET_FENCE! bo:%p, gem:%d(%d), fd:%ds\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf);
dma_type = 1;
if (!bo_exynos->dma_fence[0].ctx && dma_type) {
- DBG("[libtbm-exynos:%d] %s FENCE not support or ignored,\n", getpid(),
- __func__);
+ TBM_EXYNOS_DEBUG("FENCE not support or ignored,\n");
return 0;
}
if (!bo_exynos->dma_fence[0].ctx && dma_type) {
- DBG("[libtbm-exynos:%d] %s device type is not 3D/CPU,\n", getpid(),
- __func__);
+ TBM_EXYNOS_DEBUG("device type is not 3D/CPU,\n");
return 0;
}
if (dma_type) {
ret = ioctl(bo_exynos->dmabuf, DMABUF_IOCTL_PUT_FENCE, &fence);
if (ret < 0) {
- TBM_EXYNOS_LOG("error Can not set PUT FENCE(%s)\n", strerror(errno));
+ TBM_EXYNOS_ERROR("Can not set PUT FENCE(%s)\n", strerror(errno));
return 0;
}
} else {
return 0;
}
- DBG("[%s] DMABUF_IOCTL_PUT_FENCE! bo:%p, gem:%d(%d), fd:%ds\n", target_name(),
+ TBM_EXYNOS_DEBUG("DMABUF_IOCTL_PUT_FENCE! bo:%p, gem:%d(%d), fd:%ds\n",
bo,
bo_exynos->gem, bo_exynos->name,
bo_exynos->dmabuf);
*formats = color_formats;
*num = TBM_COLOR_FORMAT_COUNT;
- fprintf(stderr, "tbm_exynos_surface_supported_format count = %d\n", *num);
+ TBM_EXYNOS_DEBUG("tbm_exynos_surface_supported_format count = %d\n", *num);
return 1;
}
if (!tbm_drm_helper_wl_auth_server_init(native_display, bufmgr_exynos->fd,
bufmgr_exynos->device_name, 0)) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] error:Fail to tbm_drm_helper_wl_server_init\n");
+ TBM_EXYNOS_ERROR("fail to tbm_drm_helper_wl_server_init\n");
return 0;
}
bufmgr_exynos = calloc(1, sizeof(struct _tbm_bufmgr_exynos));
if (!bufmgr_exynos) {
- TBM_EXYNOS_LOG("error: Fail to alloc bufmgr_exynos!\n");
+ TBM_EXYNOS_ERROR("fail to alloc bufmgr_exynos!\n");
return 0;
}
if (bufmgr_exynos->fd < 0) {
bufmgr_exynos->fd = _tbm_exynos_open_drm();
if (bufmgr_exynos->fd < 0) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] error: Fail to open drm!\n", getpid());
+ TBM_EXYNOS_ERROR("fail to open drm!\n", getpid());
goto fail_open_drm;
}
}
bufmgr_exynos->device_name = drmGetDeviceNameFromFd(bufmgr_exynos->fd);
if (!bufmgr_exynos->device_name) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] error: Fail to get device name!\n", getpid());
+ TBM_EXYNOS_ERROR("fail to get device name!\n", getpid());
tbm_drm_helper_unset_tbm_master_fd();
goto fail_get_device_name;
if (_check_render_node()) {
bufmgr_exynos->fd = _get_render_node();
if (bufmgr_exynos->fd < 0) {
- TBM_EXYNOS_LOG("[%s] get render node failed\n", target_name(), fd);
+ TBM_EXYNOS_ERROR("fail to get render node\n");
goto fail_get_render_node;
}
- DBG("[%s] Use render node:%d\n", target_name(), bufmgr_exynos->fd);
+ TBM_EXYNOS_DEBUG("Use render node:%d\n", bufmgr_exynos->fd);
} else {
if (!tbm_drm_helper_get_auth_info(&(bufmgr_exynos->fd), &(bufmgr_exynos->device_name), NULL)) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] error: Fail to get auth drm info!\n", getpid());
+ TBM_EXYNOS_ERROR("fail to get auth drm info!\n");
goto fail_get_auth_info;
}
}
}
if (!_bufmgr_init_cache_state(bufmgr_exynos)) {
- TBM_EXYNOS_LOG("[libtbm-exynos:%d] error: Fail to init bufmgr cache state\n", getpid());
+ TBM_EXYNOS_ERROR("fail to init bufmgr cache state\n");
goto fail_init_cache_state;
}
bufmgr_backend = tbm_backend_alloc();
if (!bufmgr_backend) {
- TBM_EXYNOS_LOG("error: Fail to alloc backend!\n");
+ TBM_EXYNOS_ERROR("fail to alloc backend!\n");
goto fail_alloc_backend;
}
bufmgr_backend->bufmgr_bind_native_display = tbm_exynos_bufmgr_bind_native_display;
if (!tbm_backend_init(bufmgr, bufmgr_backend)) {
- TBM_EXYNOS_LOG("error: Fail to init backend!\n");
+ TBM_EXYNOS_ERROR("fail to init backend!\n");
goto fail_init_backend;
}
env = getenv("TBM_EXYNOS_DEBUG");
if (env) {
bDebug = atoi(env);
- TBM_EXYNOS_LOG("TBM_EXYNOS_DEBUG=%s\n", env);
+ TBM_EXYNOS_ERROR("TBM_EXYNOS_DEBUG=%s\n", env);
} else
bDebug = 0;
}
#endif
- DBG("[%s] drm_fd:%d\n", target_name(), bufmgr_exynos->fd);
+ TBM_EXYNOS_DEBUG("drm_fd:%d\n", bufmgr_exynos->fd);
return 1;