This patch cleans up tbm_sprd_bo_unmap().
- The bufmgr_sprd->use_dma_fence is checked unnecessarily.
Change-Id: I7e133e680b320dc0022ce10cac6e99798832d014
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com>
{
SPRD_RETURN_VAL_IF_FAIL(bo != NULL, 0);
{
SPRD_RETURN_VAL_IF_FAIL(bo != NULL, 0);
tbm_bufmgr_sprd bufmgr_sprd;
tbm_bufmgr_sprd bufmgr_sprd;
bufmgr_sprd = (tbm_bufmgr_sprd)tbm_backend_get_bufmgr_priv(bo);
SPRD_RETURN_VAL_IF_FAIL(bufmgr_sprd != NULL, 0);
bufmgr_sprd = (tbm_bufmgr_sprd)tbm_backend_get_bufmgr_priv(bo);
SPRD_RETURN_VAL_IF_FAIL(bufmgr_sprd != NULL, 0);
int ret = 0;
if (bufmgr_sprd->use_dma_fence) {
int ret = 0;
if (bufmgr_sprd->use_dma_fence) {
struct dma_buf_fence fence;
memset(&fence, 0, sizeof(struct dma_buf_fence));
struct dma_buf_fence fence;
memset(&fence, 0, sizeof(struct dma_buf_fence));
- /* Check if the tbm manager supports dma fence or not. */
- if (!bufmgr_sprd->use_dma_fence) {
- TBM_SPRD_LOG("[libtbm-sprd:%d] "
- "error %s:%d Not support DMA FENCE(%s)\n",
- getpid(), __FUNCTION__, __LINE__, strerror(errno));
- return 0;
-
- }
-
ret = ioctl(bo_sprd->dmabuf, DMABUF_IOCTL_GET_FENCE, &fence);
if (ret < 0) {
TBM_SPRD_LOG("[libtbm-sprd:%d] "
ret = ioctl(bo_sprd->dmabuf, DMABUF_IOCTL_GET_FENCE, &fence);
if (ret < 0) {
TBM_SPRD_LOG("[libtbm-sprd:%d] "
getpid(),
__FUNCTION__, bo_sprd->name, bo_sprd->dmabuf);
} else {
getpid(),
__FUNCTION__, bo_sprd->name, bo_sprd->dmabuf);
} else {
ret = _tgl_lock(bufmgr_sprd->tgl_fd, bo_sprd->name);
DBG("[libtbm-sprd:%d] lock tgl flink_id:%d\n",
ret = _tgl_lock(bufmgr_sprd->tgl_fd, bo_sprd->name);
DBG("[libtbm-sprd:%d] lock tgl flink_id:%d\n",