From 01b5acf980d5d79881b1328ed2082fea21b799bf Mon Sep 17 00:00:00 2001 From: "jinhyung.jo" Date: Thu, 8 Jan 2015 15:32:57 +0900 Subject: [PATCH] VIGS: Implemented BO Lock/Unlock This patch will be resolve a problem that the tbm module doesn't open a node, '/slp_global_lock', because it has no permission. Change-Id: Ia2a038d0e96aea48dcc59f087c76c9bad38f8194 Signed-off-by: Jinhyung Jo --- src/tbm_bufmgr_emulator.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/tbm_bufmgr_emulator.c b/src/tbm_bufmgr_emulator.c index 5bb832e..d6a7227 100644 --- a/src/tbm_bufmgr_emulator.c +++ b/src/tbm_bufmgr_emulator.c @@ -218,6 +218,18 @@ static int tbm_bufmgr_emulator_bo_cache_flush(tbm_bo bo, int flags) return 1; } +static int tbm_bufmgr_emulator_bo_lock(tbm_bo bo) +{ + TBM_EMULATOR_LOG_DEBUG("bo = %p", bo); + return 1; +} + +static int tbm_bufmgr_emulator_bo_unlock(tbm_bo bo) +{ + TBM_EMULATOR_LOG_DEBUG("bo = %p", bo); + return 1; +} + static int tbm_bufmgr_emulator_bo_get_global_key(tbm_bo bo) { struct vigs_drm_surface *sfc; @@ -275,7 +287,7 @@ int tbm_bufmgr_emulator_init(tbm_bufmgr bufmgr, int fd) goto fail; } - backend->flags = 0; + backend->flags = TBM_CACHE_CTRL_BACKEND|TBM_LOCK_CTRL_BACKEND; backend->priv = (void*)drm_dev; backend->bufmgr_deinit = tbm_bufmgr_emulator_deinit; backend->bo_size = tbm_bufmgr_emulator_bo_size; @@ -288,8 +300,8 @@ int tbm_bufmgr_emulator_init(tbm_bufmgr bufmgr, int fd) backend->bo_unmap = tbm_bufmgr_emulator_bo_unmap; backend->bo_cache_flush = tbm_bufmgr_emulator_bo_cache_flush; backend->bo_get_global_key = tbm_bufmgr_emulator_bo_get_global_key; - backend->bo_lock = NULL; - backend->bo_unlock = NULL; + backend->bo_lock = tbm_bufmgr_emulator_bo_lock; + backend->bo_unlock = tbm_bufmgr_emulator_bo_unlock; if (!tbm_backend_init(bufmgr, backend)) { TBM_EMULATOR_LOG_ERROR("tbm_backend_init failed"); -- 2.7.4