tbm_bufmgr_sprd: clean up tbm_sprd_bo_unmap() 54/97454/2 accepted/tizen/3.0/mobile/20161116.021432 accepted/tizen/mobile/20161115.233729 submit/tizen/20161115.022149 submit/tizen_3.0/20161115.021406
authorYoungJun Cho <yj44.cho@samsung.com>
Mon, 14 Nov 2016 07:24:06 +0000 (16:24 +0900)
committerYoungJun Cho <yj44.cho@samsung.com>
Tue, 15 Nov 2016 02:15:22 +0000 (18:15 -0800)
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>
src/tbm_bufmgr_sprd.c

index 81676b8..1b30142 100644 (file)
@@ -1373,8 +1373,8 @@ tbm_sprd_bo_unmap(tbm_bo bo)
 {
        SPRD_RETURN_VAL_IF_FAIL(bo != NULL, 0);
 
-       tbm_bo_sprd bo_sprd;
        tbm_bufmgr_sprd bufmgr_sprd;
+       tbm_bo_sprd bo_sprd;
 
        bufmgr_sprd = (tbm_bufmgr_sprd)tbm_backend_get_bufmgr_priv(bo);
        SPRD_RETURN_VAL_IF_FAIL(bufmgr_sprd != NULL, 0);
@@ -1414,7 +1414,6 @@ tbm_sprd_bo_lock(tbm_bo bo, int device, int opt)
        int ret = 0;
 
        if (bufmgr_sprd->use_dma_fence) {
-
                struct dma_buf_fence fence;
 
                memset(&fence, 0, sizeof(struct dma_buf_fence));
@@ -1446,15 +1445,6 @@ tbm_sprd_bo_lock(tbm_bo bo, int device, int opt)
                        return 0;
                }
 
-               /* 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] "
@@ -1484,7 +1474,6 @@ tbm_sprd_bo_lock(tbm_bo bo, int device, int opt)
                     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",