diff options
author | Junkyeong Kim <jk0430.kim@samsung.com> | 2017-09-11 16:50:14 +0900 |
---|---|---|
committer | Junkyeong Kim <jk0430.kim@samsung.com> | 2017-09-11 16:50:17 +0900 |
commit | 86471bb45833ec0465f8c4169be625b354a98c6e (patch) | |
tree | 17420dd067ea167e5d75279e15568658f3e6a40b | |
parent | 7a2a3fdd6be87dfdbae6ed7461ebe3dd05e3a38c (diff) | |
download | libtbm-dumb-86471bb45833ec0465f8c4169be625b354a98c6e.tar.gz libtbm-dumb-86471bb45833ec0465f8c4169be625b354a98c6e.tar.bz2 libtbm-dumb-86471bb45833ec0465f8c4169be625b354a98c6e.zip |
remove PrivGemsubmit/tizen_4.0/20170911.080340submit/tizen/20170911.080123accepted/tizen/unified/20170911.160108accepted/tizen/4.0/unified/20170913.003230
Change-Id: I88c7eb9e0c94ca336608e69e3d4b6e0c4527709d
Signed-off-by: Junkyeong Kim <jk0430.kim@samsung.com>
-rw-r--r-- | src/tbm_bufmgr_dumb.c | 76 |
1 files changed, 12 insertions, 64 deletions
diff --git a/src/tbm_bufmgr_dumb.c b/src/tbm_bufmgr_dumb.c index 01e0579..2a5b375 100644 --- a/src/tbm_bufmgr_dumb.c +++ b/src/tbm_bufmgr_dumb.c @@ -149,11 +149,6 @@ struct dma_buf_fence { typedef struct _tbm_bufmgr_dumb *tbm_bufmgr_dumb; typedef struct _tbm_bo_dumb *tbm_bo_dumb; -typedef struct _dumb_private { - int ref_count; - struct _tbm_bo_dumb *bo_priv; -} PrivGem; - /* tbm buffor object for dumb */ struct _tbm_bo_dumb { int fd; @@ -171,8 +166,6 @@ struct _tbm_bo_dumb { unsigned int flags_dumb; unsigned int flags_tbm; - PrivGem* private; - pthread_mutex_t mutex; struct dma_buf_fence dma_fence[DMA_FENCE_LIST_MAX]; int device; @@ -477,18 +470,7 @@ tbm_dumb_bo_alloc(tbm_bo bo, int size, int flags) } /* add bo to hash */ - PrivGem* privGem = calloc(1, sizeof(PrivGem)); - if (!privGem) { - TBM_DUMB_LOG("[libtbm-dumb:%d] " - "error %s:%d Fail to calloc privGem\n", - getpid(), __FUNCTION__, __LINE__); - free(bo_dumb); - return 0; - } - - privGem->ref_count = 1; - privGem->bo_priv = bo_dumb; - if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)privGem) < 0) + if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)bo_dumb) < 0) TBM_DUMB_LOG("error Cannot insert bo to Hash(%d)\n", bo_dumb->name); DBG(" [%s] bo:%p, gem:%d(%d), flags:%d(%d), size:%d\n", target_name(), @@ -535,18 +517,12 @@ tbm_dumb_bo_free(tbm_bo bo) } /* delete bo from hash */ - PrivGem *privGem = NULL; int ret; - ret = drmHashLookup(bufmgr_dumb->hashBos, bo_dumb->name, (void**)&privGem); - if (ret == 0) { - privGem->ref_count--; - if (privGem->ref_count == 0) { - drmHashDelete(bufmgr_dumb->hashBos, bo_dumb->name); - free(privGem); - privGem = NULL; - } - } else + ret = drmHashLookup(bufmgr_dumb->hashBos, bo_dumb->name, (void**)&bo_dumb); + if (ret == 0) + drmHashDelete(bufmgr_dumb->hashBos, bo_dumb->name); + else TBM_DUMB_LOG("warning Cannot find bo to Hash(%d), ret =%d\n", bo_dumb->name, ret); /* Free gem handle */ @@ -569,15 +545,14 @@ tbm_dumb_bo_import(tbm_bo bo, unsigned int key) tbm_bufmgr_dumb bufmgr_dumb; tbm_bo_dumb bo_dumb; - PrivGem *privGem = NULL; int ret; bufmgr_dumb = (tbm_bufmgr_dumb)tbm_backend_get_bufmgr_priv(bo); DUMB_RETURN_VAL_IF_FAIL(bufmgr_dumb != NULL, 0); - ret = drmHashLookup(bufmgr_dumb->hashBos, key, (void **)&privGem); + ret = drmHashLookup(bufmgr_dumb->hashBos, key, (void **)&bo_dumb); if (ret == 0) - return privGem->bo_priv; + return bo_dumb; struct drm_gem_open arg = {0, }; @@ -613,20 +588,7 @@ tbm_dumb_bo_import(tbm_bo bo, unsigned int key) } /* add bo to hash */ - privGem = NULL; - privGem = calloc(1, sizeof(PrivGem)); - if (!privGem) { - TBM_DUMB_LOG("[libtbm-dumb:%d] " - "error %s:%d Fail to calloc privGem\n", - getpid(), __FUNCTION__, __LINE__); - free(bo_dumb); - return 0; - } - - privGem->ref_count = 1; - privGem->bo_priv = bo_dumb; - - if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)privGem) < 0) + if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)bo_dumb) < 0) TBM_DUMB_LOG("error Cannot insert bo to Hash(%d)\n", bo_dumb->name); DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, flags:%d(%d), size:%d\n", target_name(), @@ -650,7 +612,6 @@ tbm_dumb_bo_import_fd(tbm_bo bo, tbm_fd key) bufmgr_dumb = (tbm_bufmgr_dumb)tbm_backend_get_bufmgr_priv(bo); DUMB_RETURN_VAL_IF_FAIL(bufmgr_dumb != NULL, 0); - PrivGem *privGem = NULL; int ret; unsigned int gem = 0; @@ -684,10 +645,10 @@ tbm_dumb_bo_import_fd(tbm_bo bo, tbm_fd key) return 0; } - ret = drmHashLookup(bufmgr_dumb->hashBos, name, (void **)&privGem); + ret = drmHashLookup(bufmgr_dumb->hashBos, name, (void **)&bo_dumb); if (ret == 0) { - if (gem == privGem->bo_priv->gem) - return privGem->bo_priv; + if (gem == bo_dumb->gem) + return bo_dumb; } /* Open the same GEM object only for finding out its size */ @@ -722,20 +683,7 @@ tbm_dumb_bo_import_fd(tbm_bo bo, tbm_fd key) bo_dumb->name = name; /* add bo to hash */ - privGem = NULL; - privGem = calloc(1, sizeof(PrivGem)); - if (!privGem) { - TBM_DUMB_LOG("[libtbm-dumb:%d] " - "error %s:%d Fail to calloc privGem\n", - getpid(), __FUNCTION__, __LINE__); - free(bo_dumb); - return 0; - } - - privGem->ref_count = 1; - privGem->bo_priv = bo_dumb; - - if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)privGem) < 0) + if (drmHashInsert(bufmgr_dumb->hashBos, bo_dumb->name, (void *)bo_dumb) < 0) TBM_DUMB_LOG("error Cannot insert bo to Hash(%d)\n", bo_dumb->name); DBG(" [%s] bo:%p, gem:%d(%d), fd:%d, key_fd:%d, flags:%d(%d), size:%d\n", target_name(), |