Fix svace issues 32/90232/1 accepted/tizen/3.0/ivi/20161011.050518 accepted/tizen/3.0/mobile/20161015.033631 accepted/tizen/3.0/tv/20161016.004911 accepted/tizen/3.0/wearable/20161015.083212 accepted/tizen/common/20160929.163513 accepted/tizen/ivi/20160930.001136 accepted/tizen/mobile/20160930.001129 accepted/tizen/tv/20160930.001133 accepted/tizen/wearable/20160930.001125 submit/tizen/20160929.082343 submit/tizen_3.0_ivi/20161010.000004 submit/tizen_3.0_mobile/20161015.000004 submit/tizen_3.0_tv/20161015.000003 submit/tizen_3.0_wearable/20161015.000003
authorChangyeon Lee <cyeon.lee@samsung.com>
Thu, 29 Sep 2016 05:56:35 +0000 (14:56 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Thu, 29 Sep 2016 06:15:15 +0000 (15:15 +0900)
Change-Id: Ibf92bcd26152d79f4d34aca257a8f3f0768dc79a

src/tbm_bufmgr_exynos.c

index e3d5b4d..defd7bf 100644 (file)
@@ -358,8 +358,6 @@ _exynos_cache_flush(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, in
        if (bufmgr_exynos->use_dma_fence)
                return 1;
 
-       EXYNOS_RETURN_VAL_IF_FAIL(bo_exynos != NULL, 0);
-
        struct drm_exynos_gem_cache_op cache_op = {0, };
        int ret;
 
@@ -442,7 +440,7 @@ _bo_set_cache_state(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, in
        char need_flush = 0;
        unsigned short cntFlush = 0;
 
-       if (bo_exynos->flags_exynos & EXYNOS_BO_NONCACHABLE)
+       if (!(bo_exynos->flags_exynos & EXYNOS_BO_CACHABLE))
                return 1;
 
        /* get cache state of a bo */
@@ -452,7 +450,7 @@ _bo_set_cache_state(tbm_bufmgr_exynos bufmgr_exynos, tbm_bo_exynos bo_exynos, in
        /* get global cache flush count */
        cntFlush = (unsigned short)_tgl_get_data(bufmgr_exynos->tgl_fd, GLOBAL_KEY);
 
-       if (opt == TBM_DEVICE_CPU) {
+       if (device == TBM_DEVICE_CPU) {
                if (bo_exynos->cache_state.data.isDirtied == DEVICE_CO &&
                    bo_exynos->cache_state.data.isCached)
                        need_flush = TBM_EXYNOS_CACHE_INV;
@@ -553,8 +551,6 @@ _bufmgr_init_cache_state(tbm_bufmgr_exynos bufmgr_exynos)
                        TBM_EXYNOS_LOG("[libtbm-exynos:%d] "
                                       "error: Fail to open global_lock:%s\n",
                                       getpid(), tgl_devfile);
-
-                       close(bufmgr_exynos->tgl_fd);
                        return 0;
                }
        }