int isLocal;
void *hashBos;
- int use_dma_fence;
-
int tgl_fd;
char *device_name;
NEXELL_RETURN_VAL_IF_FAIL(bufmgr_nexell != NULL, 0);
NEXELL_RETURN_VAL_IF_FAIL(bo_nexell != NULL, 0);
- if (bufmgr_nexell->use_dma_fence)
- return 1;
-
tbm_bo_cache_state cache_state;
_tgl_init(bufmgr_nexell->tgl_fd, bo_nexell->name);
NEXELL_RETURN_VAL_IF_FAIL(bufmgr_nexell != NULL, 0);
NEXELL_RETURN_VAL_IF_FAIL(bo_nexell != NULL, 0);
- if (bufmgr_nexell->use_dma_fence)
- return 1;
-
char need_flush = 0;
unsigned short cntFlush = 0;
NEXELL_RETURN_VAL_IF_FAIL(bufmgr_nexell != NULL, 0);
NEXELL_RETURN_VAL_IF_FAIL(bo_nexell != NULL, 0);
- if (bufmgr_nexell->use_dma_fence)
- return 1;
-
unsigned short cntFlush = 0;
/* get global cache flush count */
NEXELL_RETURN_IF_FAIL(bufmgr_nexell != NULL);
NEXELL_RETURN_IF_FAIL(bo_nexell != NULL);
- if (bufmgr_nexell->use_dma_fence)
- return ;
-
_tgl_destroy(bufmgr_nexell->tgl_fd, bo_nexell->name);
#endif
}
#ifdef ENABLE_CACHECRTL
NEXELL_RETURN_IF_FAIL(bufmgr_nexell != NULL);
- if (bufmgr_nexell->use_dma_fence)
- return 1;
-
/* open tgl fd for saving cache flush data */
bufmgr_nexell->tgl_fd = open(tgl_devfile, O_RDWR);
#ifdef ENABLE_CACHECRTL
NEXELL_RETURN_IF_FAIL(bufmgr_nexell != NULL);
- if (bufmgr_nexell->use_dma_fence)
- return;
-
if (bufmgr_nexell->tgl_fd >= 0)
close(bufmgr_nexell->tgl_fd);
#endif
}
}
-#ifdef USE_DMA_FD
- //Check if the tbm manager supports dma fence or not.
- int fp = open("/sys/module/dmabuf_sync/parameters/enabled", O_RDONLY);
- int length;
- char buf[1];
- if (fp != -1) {
- length = read(fp, buf, 1);
-
- if (length == 1 && buf[0] == '1')
- bufmgr_nexell->use_dma_fence = 1;
-
- close(fp);
- }
-#endif
-
if (!_bufmgr_init_cache_state(bufmgr_nexell)) {
TBM_NEXELL_LOG("[libtbm-nexell:%d] error: init bufmgr cache state failed!\n", getpid());