diff options
author | Changyeon Lee <cyeon.lee@samsung.com> | 2023-01-16 17:47:44 +0900 |
---|---|---|
committer | Changyeon Lee <cyeon.lee@samsung.com> | 2023-01-16 17:52:31 +0900 |
commit | 3d2ef6f3b42def3613b7b1c0af83fddf785786d6 (patch) | |
tree | 82d380fadaf52e757c724912734055cfde325921 | |
parent | a558bcf3f0d08804798d7b73ab4be338cbd37a43 (diff) | |
download | libtbm-vc4-3d2ef6f3b42def3613b7b1c0af83fddf785786d6.tar.gz libtbm-vc4-3d2ef6f3b42def3613b7b1c0af83fddf785786d6.tar.bz2 libtbm-vc4-3d2ef6f3b42def3613b7b1c0af83fddf785786d6.zip |
Fix build error in aarch64accepted/tizen/unified/20230117.140526
Change-Id: I68848246e4beef91bbe10fa90f990a2ec365f8d7
-rw-r--r-- | src/tbm_backend_vc4.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tbm_backend_vc4.c b/src/tbm_backend_vc4.c index 0b09253..6622966 100644 --- a/src/tbm_backend_vc4.c +++ b/src/tbm_backend_vc4.c @@ -358,7 +358,7 @@ _open_gem(int fd, unsigned name, unsigned int *gem, unsigned int *size) static unsigned int _get_size_with_open(int fd, unsigned int name) { - unsigned int gem, size; + unsigned int gem = 0, size = 0; if (!_open_gem(fd, name, &gem, &size)) { TBM_BACKEND_ERR("fail to get gem info from gem:%d name:%d", gem, name); @@ -1083,7 +1083,8 @@ tbm_vc4_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd key, hal_tbm_error * { tbm_vc4_bufmgr *bufmgr_data = (tbm_vc4_bufmgr *)bufmgr; tbm_vc4_bo *bo_data; - unsigned int gem, name, size; + unsigned int gem, name = 0, size = 0; + off_t lseek_size; int ret; if (bufmgr_data == NULL) { @@ -1124,9 +1125,11 @@ tbm_vc4_bufmgr_import_fd(hal_tbm_bufmgr *bufmgr, hal_tbm_fd key, hal_tbm_error * * kernels will just fail, in which case we fall back to the * provided (estimated or guess size). */ - size = lseek(key, 0, SEEK_END); - if (size == -1) + lseek_size = lseek(key, 0, SEEK_END); + if (lseek_size == -1) size = _get_size_with_open(bufmgr_data->fd, name); + else + size = (unsigned int)lseek_size; bo_data = calloc(1, sizeof(struct _tbm_vc4_bo)); if (!bo_data) { @@ -1169,7 +1172,7 @@ tbm_vc4_bufmgr_import_key(hal_tbm_bufmgr *bufmgr, hal_tbm_key key, hal_tbm_error tbm_vc4_bufmgr *bufmgr_data = (tbm_vc4_bufmgr *)bufmgr; tbm_vc4_bo *bo_data; int ret; - unsigned int gem, size; + unsigned int gem = 0, size = 0; if (bufmgr_data == NULL) { TBM_BACKEND_ERR("bufmgr is null"); |