}
static int
-_bo_lock (tbm_bo bo)
+_bo_lock (tbm_bo bo, int device, int opt)
{
tbm_bufmgr bufmgr = bo->bufmgr;
int ret = 0;
if (bufmgr->backend->flags&TBM_LOCK_CTRL_BACKEND &&
bufmgr->backend->bo_lock)
{
- /* use backend lock */
+ /* use bo_lock2 backend lock */
ret = bufmgr->backend->bo_lock (bo);
}
+ if (bufmgr->backend->flags&TBM_LOCK_CTRL_BACKEND &&
+ bufmgr->backend->bo_lock2)
+ {
+ /* use bo_lock2 backend lock */
+ ret = bufmgr->backend->bo_lock2 (bo, device, opt);
+ }
else
{
/* use tizen global lock */
}
static int
-_tbm_bo_lock (tbm_bo bo)
+_tbm_bo_lock (tbm_bo bo, int device, int opt)
{
tbm_bufmgr bufmgr = NULL;
int old;
{
case LOCK_TRY_ALWAYS: /* LOCK_TRY_ALWAYS */
pthread_mutex_unlock (&bufmgr->lock);
- ret = _bo_lock (bo);
+ ret = _bo_lock (bo, device, opt);
pthread_mutex_lock (&bufmgr->lock);
if(ret)
bo->lock_cnt++;
if (bo->lock_cnt == 0)
{
pthread_mutex_unlock (&bufmgr->lock);
- ret = _bo_lock (bo);
+ ret = _bo_lock (bo, device, opt);
pthread_mutex_lock (&bufmgr->lock);
if (ret)
bo->lock_cnt++;
pthread_mutex_lock (&bufmgr->lock);
- _tbm_bo_lock (bo);
+ _tbm_bo_lock (bo, device, opt);
bo_handle = bufmgr->backend->bo_map (bo, device, opt);
if (bufmgr->use_map_cache == 1 && bo->map_cnt == 0)
*/\r
int (*bo_unlock) (tbm_bo bo);\r
\r
+ /**\r
+ * @brief lock the buffer object with a device and an opt.\r
+ * @param[in] bo : the buffer object\r
+ * @param[in] device : the device type to get a handle\r
+ * @param[in] option : the option to access the buffer object\r
+ * @return 1 if this function succeeds, otherwise 0.\r
+ * @remark This function pointer could be null. (default: use the tizen global lock)\r
+ */\r
+ int (*bo_lock2) (tbm_bo bo, int device, int opt);\r
+\r
/* Padding for future extension */\r
void (*reserved1) (void);\r
void (*reserved2) (void);\r
void (*reserved3) (void);\r
- void (*reserved4) (void);\r
};\r
\r
/**\r