@@ -114,6 +114,7 @@ struct i915_device {
114114 uint32_t has_llc : 1 ;
115115 uint32_t has_hw_protection : 1 ;
116116 uint32_t is_xelpd : 1 ;
117+ uint32_t is_mtl_or_newer : 1 ;
117118 uint32_t has_mmap_offset : 1 ;
118119 uint32_t has_local_mem : 1 ;
119120 uint32_t force_mem_local : 1 ;
@@ -149,7 +150,7 @@ flags_to_heap(struct i915_device *i915, unsigned flags)
149150
150151bool i915_has_tile4 (struct i915_device * i915 )
151152{
152- return GEN_VERSION_X10 (i915 ) >= 125 ;
153+ return GEN_VERSION_X10 (i915 ) >= 125 || i915 -> is_mtl_or_newer ;
153154}
154155
155156static void i915_get_modifier_order (struct i915_device * i915 )
@@ -372,7 +373,7 @@ static int i915_align_dimensions(struct bo *bo, uint32_t format, uint32_t tiling
372373 uint32_t horizontal_alignment = 64 ;
373374 uint32_t vertical_alignment = 4 ;
374375 struct i915_device * i915 = bo -> drv -> priv ;
375- if (GEN_VERSION_X10 (i915 ) >= 125 ) {
376+ if (GEN_VERSION_X10 (i915 ) >= 125 || i915 -> is_mtl_or_newer ) {
376377 horizontal_alignment = 4 ;
377378 vertical_alignment = 4 ;
378379 }
@@ -610,6 +611,7 @@ static int i915_init(struct driver *drv)
610611 i915 -> graphics_version = info .graphics_version ;
611612 i915 -> sub_version = info .sub_version ;
612613 i915 -> is_xelpd = info .is_xelpd ;
614+ i915 -> is_mtl_or_newer = info .is_mtl_or_newer ;
613615
614616 i915_get_modifier_order (i915 );
615617
@@ -678,7 +680,7 @@ static bool i915_format_needs_LCU_alignment(uint32_t format, size_t plane,
678680 case DRM_FORMAT_NV12 :
679681 case DRM_FORMAT_P010 :
680682 case DRM_FORMAT_P016 :
681- return (i915 -> graphics_version == 11 || i915 -> graphics_version == 12 ) && plane == 1 ;
683+ return (i915 -> graphics_version == 11 || i915 -> graphics_version == 12 ) && ! i915 -> is_mtl_or_newer && plane == 1 ;
682684 }
683685 return false;
684686}
@@ -1127,7 +1129,7 @@ static int i915_bo_create_from_metadata(struct bo *bo)
11271129 /* Set/Get tiling ioctl not supported based on fence availability
11281130 Refer : "https://patchwork.freedesktop.org/patch/325343/"
11291131 */
1130- if ((GEN_VERSION_X10 (i915 ) != 125 ) && ( i915 -> graphics_version != 14 ) ) {
1132+ if ((GEN_VERSION_X10 (i915 ) != 125 ) && ! i915 -> is_mtl_or_newer ) {
11311133 gem_set_tiling .handle = bo -> handles [0 ].u32 ;
11321134 gem_set_tiling .tiling_mode = bo -> meta .tiling ;
11331135 gem_set_tiling .stride = bo -> meta .strides [0 ];
@@ -1167,7 +1169,7 @@ static int i915_bo_import(struct bo *bo, struct drv_import_fd_data *data)
11671169 /* Set/Get tiling ioctl not supported based on fence availability
11681170 Refer : "https://patchwork.freedesktop.org/patch/325343/"
11691171 */
1170- if ((GEN_VERSION_X10 (i915 ) != 125 ) && ( i915 -> graphics_version != 14 ) ) {
1172+ if ((GEN_VERSION_X10 (i915 ) != 125 ) && ! i915 -> is_mtl_or_newer ) {
11711173 /* TODO(gsingh): export modifiers and get rid of backdoor tiling. */
11721174 gem_get_tiling .handle = bo -> handles [0 ].u32 ;
11731175
0 commit comments