diff options
-rw-r--r-- | src/tbm_bufmgr_dumb.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/tbm_bufmgr_dumb.c b/src/tbm_bufmgr_dumb.c index d36503d..f7cc999 100644 --- a/src/tbm_bufmgr_dumb.c +++ b/src/tbm_bufmgr_dumb.c @@ -372,7 +372,7 @@ tbm_dumb_bufmgr_bind_native_display(tbm_backend_bufmgr_data *bufmgr_data, tbm_na if (!tbm_drm_helper_wl_auth_server_init(native_display, bufmgr_dumb->fd, bufmgr_dumb->device_name, 0)) { TBM_ERR("fail to tbm_drm_helper_wl_server_init\n"); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } bufmgr_dumb->bind_display = native_display; @@ -682,7 +682,7 @@ tbm_dumb_bufmgr_alloc_bo(tbm_backend_bufmgr_data *bufmgr_data, unsigned int size (unsigned int)size); free(bo_dumb); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } @@ -703,7 +703,7 @@ tbm_dumb_bufmgr_alloc_bo(tbm_backend_bufmgr_data *bufmgr_data, unsigned int size TBM_ERR("Cannot dmabuf=%d\n", bo_dumb->gem); free(bo_dumb); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } bo_dumb->dmabuf = arg.fd; @@ -751,7 +751,7 @@ tbm_dumb_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_ TBM_ERR("Cannot get gem handle from fd:%d (%s)\n", arg.fd, strerror_r(errno, buf, STRERR_BUFSIZE)); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } gem = arg.handle; @@ -761,7 +761,7 @@ tbm_dumb_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_ TBM_ERR("Cannot get name from gem:%d, fd:%d (%s)\n", gem, key, strerror_r(errno, buf, STRERR_BUFSIZE)); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } @@ -790,7 +790,7 @@ tbm_dumb_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_ TBM_ERR("Cannot get gem info from gem:%d, fd:%d (%s)\n", gem, key, strerror_r(errno, buf, STRERR_BUFSIZE)); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } @@ -801,7 +801,7 @@ tbm_dumb_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_ TBM_ERR("Cannot close gem_handle.\n", strerror_r(errno, buf, STRERR_BUFSIZE)); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } @@ -871,7 +871,7 @@ tbm_dumb_bufmgr_import_key(tbm_backend_bufmgr_data *bufmgr_data, tbm_key key, tb if (drmIoctl(bufmgr_dumb->fd, DRM_IOCTL_GEM_OPEN, &arg)) { TBM_ERR("Cannot open gem name=%d\n", key); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return NULL; } @@ -898,7 +898,7 @@ tbm_dumb_bufmgr_import_key(tbm_backend_bufmgr_data *bufmgr_data, tbm_key key, tb if (drmIoctl(bo_dumb->fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &arg)) { TBM_ERR("fail to DRM_IOCTL_PRIME_HANDLE_TO_FD gem=%d\n", bo_dumb->gem); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; free(bo_dumb); return NULL; } @@ -1046,7 +1046,7 @@ tbm_dumb_bo_get_handle(tbm_backend_bo_data *bo_data, tbm_bo_device_type device, TBM_ERR("Cannot get handle: gem:%d, device:%d\n", bo_dumb->gem, device); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return (tbm_bo_handle) NULL; } @@ -1152,11 +1152,11 @@ tbm_dumb_bo_lock(tbm_backend_bo_data *bo_data, tbm_bo_device_type device, if (device != TBM_DEVICE_3D && device != TBM_DEVICE_CPU) { TBM_DBG("Not support device type,\n"); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } if (!bufmgr_dumb->use_dma_fence) - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; memset(&fence, 0, sizeof(struct dma_buf_fence)); @@ -1175,14 +1175,14 @@ tbm_dumb_bo_lock(tbm_backend_bo_data *bo_data, tbm_bo_device_type device, /* Check if the tbm manager supports dma fence or not. */ if (!bufmgr_dumb->use_dma_fence) { TBM_ERR("Not support DMA FENCE(%s)\n", strerror_r(errno, buf, STRERR_BUFSIZE)); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } if (device == TBM_DEVICE_3D) { ret = ioctl(bo_dumb->dmabuf, DMABUF_IOCTL_GET_FENCE, &fence); if (ret < 0) { TBM_ERR("Cannot set GET FENCE(%s)\n", strerror_r(errno, buf, STRERR_BUFSIZE)); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } } else { if (opt & TBM_OPTION_WRITE) @@ -1195,7 +1195,7 @@ tbm_dumb_bo_lock(tbm_backend_bo_data *bo_data, tbm_bo_device_type device, filelock.l_len = 0; if (-1 == fcntl(bo_dumb->dmabuf, F_SETLKW, &filelock)) - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } pthread_mutex_lock(&bo_dumb->mutex); @@ -1243,19 +1243,19 @@ tbm_dumb_bo_unlock(tbm_backend_bo_data *bo_data) return TBM_ERROR_INVALID_PARAMETER; if (!bufmgr_dumb->use_dma_fence) - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; if (bo_dumb->dma_fence[0].type & DMA_BUF_ACCESS_DMA) dma_type = 1; if (!bo_dumb->dma_fence[0].ctx && dma_type) { TBM_DBG("FENCE not support or ignored,\n"); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } if (!bo_dumb->dma_fence[0].ctx && dma_type) { TBM_DBG("device type is not 3D/CPU,\n"); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } pthread_mutex_lock(&bo_dumb->mutex); @@ -1278,7 +1278,7 @@ tbm_dumb_bo_unlock(tbm_backend_bo_data *bo_data) ret = ioctl(bo_dumb->dmabuf, DMABUF_IOCTL_PUT_FENCE, &fence); if (ret < 0) { TBM_ERR("Can not set PUT FENCE(%s)\n", strerror_r(errno, buf, STRERR_BUFSIZE)); - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } } else { filelock.l_type = F_UNLCK; @@ -1287,7 +1287,7 @@ tbm_dumb_bo_unlock(tbm_backend_bo_data *bo_data) filelock.l_len = 0; if (-1 == fcntl(bo_dumb->dmabuf, F_SETLKW, &filelock)) - return TBM_ERROR_OPERATION_FAILED; + return TBM_ERROR_INVALID_OPERATION; } TBM_DBG("DMABUF_IOCTL_PUT_FENCE! bo_dumb:%p, gem:%d(%d), fd:%ds\n", @@ -1320,7 +1320,7 @@ tbm_dumb_bo_export_fd(tbm_backend_bo_data *bo_data, tbm_error_e *error) TBM_ERR("bo_dumb:%p Cannot dmabuf=%d (%s)\n", bo_dumb, bo_dumb->gem, strerror_r(errno, buf, STRERR_BUFSIZE)); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; return (tbm_fd) ret; } @@ -1449,7 +1449,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) if (bufmgr_dumb->fd < 0) { TBM_ERR("fail to open drm!\n"); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_open_drm; } } @@ -1461,7 +1461,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) TBM_ERR("fail to get device name!\n"); tbm_drm_helper_unset_tbm_master_fd(); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_get_device_name; } tbm_drm_helper_set_fd(bufmgr_dumb->fd); @@ -1469,7 +1469,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) if (!tbm_drm_helper_get_auth_info(&(bufmgr_dumb->fd), &(bufmgr_dumb->device_name), NULL)) { TBM_ERR("fail to get auth drm info!\n"); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_get_auth_info; } tbm_drm_helper_set_fd(bufmgr_dumb->fd); @@ -1479,7 +1479,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) if (ret || cap == 0) { TBM_ERR("drm buffer isn't supported !\n"); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_get_cap; } @@ -1520,7 +1520,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) if (err != TBM_ERROR_NONE) { TBM_ERR("fail to register bufmgr_func! err(%d)\n", err); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_register_bufmgr_func; } bufmgr_dumb->bufmgr_func = bufmgr_func; @@ -1549,7 +1549,7 @@ tbm_dumb_init(tbm_bufmgr bufmgr, tbm_error_e *error) if (err != TBM_ERROR_NONE) { TBM_ERR("fail to register bo_func! err(%d)\n", err); if (error) - *error = TBM_ERROR_OPERATION_FAILED; + *error = TBM_ERROR_INVALID_OPERATION; goto fail_register_bo_func; } bufmgr_dumb->bo_func = bo_func; |