bufmgr: add tbm_bufmgr_set_bo_lock_type api 76/170776/4
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 22 Feb 2018 05:14:43 +0000 (14:14 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Thu, 22 Feb 2018 07:54:45 +0000 (07:54 +0000)
this api is used intead of setting the BUFMGR_LOCK_TYPE env variables.

Change-Id: I20f0b33663293d7c810027877f993eb2edcf7ecd

src/tbm_bufmgr.c
src/tbm_bufmgr.h

index 1dd4f13..4208000 100644 (file)
@@ -1813,6 +1813,20 @@ tbm_bufmgr_server_init(void)
        return bufmgr;
 }
 
+int
+tbm_bufmgr_set_bo_lock_type(tbm_bufmgr bufmgr, tbm_bufmgr_bo_lock_type bo_lock_type)
+{
+       TBM_BUFMGR_RETURN_VAL_IF_FAIL(TBM_BUFMGR_IS_VALID(gBufMgr), 0);
+       TBM_BUFMGR_RETURN_VAL_IF_FAIL(bufmgr == gBufMgr, 0);
+
+       gBufMgr->bo_lock_type = bo_lock_type;
+
+       TBM_LOG_I("The bo_lock_type of the bo is %d\n", bo_lock_type);
+
+       return 1;
+}
+
+
 int tbm_bufmgr_get_fd_limit(void)
 {
        struct rlimit lim;
index 867cb3e..bc69778 100644 (file)
@@ -1047,6 +1047,13 @@ int tbm_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *native_display);
 tbm_bufmgr tbm_bufmgr_server_init(void);
 
 /**
+ * @brief Set the bo_lock_type of the bufffer manager.
+ * @details set the bo_lock_type
+ * @since_tizen 5.0
+ */
+int tbm_bufmgr_set_bo_lock_type(tbm_bufmgr bufmgr, tbm_bufmgr_bo_lock_type bo_lock_type);
+
+/**
  * @brief Print out the information of tbm_bos.
  * @since_tizen 3.0
  * @param[in] bufmgr : the buffer manager