summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChangyeon Lee <cyeon.lee@samsung.com>2019-06-11 17:00:17 +0900
committerChangyeon Lee <cyeon.lee@samsung.com>2019-06-11 17:02:09 +0900
commitf6f5e95f299a9ba284689c6f249ca5af1623f788 (patch)
tree9388263b161512ce80a9941622c0d946f3917e5b
parentd4d821b734a95b2e04ccac9d6e65994b0bc4f8f3 (diff)
downloadlibtbm-vc4-f6f5e95f299a9ba284689c6f249ca5af1623f788.tar.gz
libtbm-vc4-f6f5e95f299a9ba284689c6f249ca5af1623f788.tar.bz2
libtbm-vc4-f6f5e95f299a9ba284689c6f249ca5af1623f788.zip
set TBM_BO_TILED flags to bo in import_fd/key
Change-Id: I7194ec559b46713399054b768cc0e9b94698dfaf
-rw-r--r--src/tbm_bufmgr_vc4.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tbm_bufmgr_vc4.c b/src/tbm_bufmgr_vc4.c
index 82cccdc..37c9934 100644
--- a/src/tbm_bufmgr_vc4.c
+++ b/src/tbm_bufmgr_vc4.c
@@ -1625,8 +1625,18 @@ tbm_vc4_bufmgr_import_fd(tbm_backend_bufmgr_data *bufmgr_data, tbm_fd key, tbm_e
bo_vc4->fd = bufmgr_vc4->fd;
bo_vc4->gem = gem;
bo_vc4->size = real_size;
- bo_vc4->flags_tbm = 0;
bo_vc4->name = name;
+ bo_vc4->flags_tbm = 0;
+
+#ifdef VC4_TILED_FORMAT
+ struct drm_vc4_get_tiling get_tiling = {
+ .handle = bo_vc4->gem,
+ };
+ drmIoctl(bo_vc4->fd, DRM_IOCTL_VC4_GET_TILING, &get_tiling);
+
+ if (get_tiling.modifier == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED)
+ bo_vc4->flags_tbm |= TBM_BO_TILED;
+#endif
if (!_bo_init_cache_state(bufmgr_vc4, bo_vc4, 1)) {
TBM_ERR("fail init cache state(%d)\n", bo_vc4->name);
@@ -1701,6 +1711,16 @@ tbm_vc4_bufmgr_import_key(tbm_backend_bufmgr_data *bufmgr_data, tbm_key key, tbm
bo_vc4->name = key;
bo_vc4->flags_tbm = 0;
+#ifdef VC4_TILED_FORMAT
+ struct drm_vc4_get_tiling get_tiling = {
+ .handle = bo_vc4->gem,
+ };
+ drmIoctl(bo_vc4->fd, DRM_IOCTL_VC4_GET_TILING, &get_tiling);
+
+ if (get_tiling.modifier == DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED)
+ bo_vc4->flags_tbm |= TBM_BO_TILED;
+#endif
+
if (!_bo_init_cache_state(bufmgr_vc4, bo_vc4, 1)) {
TBM_ERR("fail init cache state(%d)\n", bo_vc4->name);
free(bo_vc4);