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);
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);