Skip to content

Commit 67e267f

Browse files
ZhuChenyanXsysopenci
authored andcommitted
Fix arl failed to start after change gpu ver
Tracked-On: OAM-134096 Signed-off-by: ZhuChenyanX <zhucx@intel.com>
1 parent b4ad92e commit 67e267f

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

i915.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

150151
bool 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

155156
static 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

intel_device.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ int intel_gpu_info_from_device_id(uint16_t device_id, struct intel_gpu_info *i91
224224
i915->graphics_version = 12;
225225
i915->sub_version = 0;
226226
i915->is_xelpd = false;
227+
i915->is_mtl_or_newer = true;
227228
return 0;
228229
}
229230

@@ -232,6 +233,7 @@ int intel_gpu_info_from_device_id(uint16_t device_id, struct intel_gpu_info *i91
232233
i915->graphics_version = 12;
233234
i915->sub_version = 0;
234235
i915->is_xelpd = false;
236+
i915->is_mtl_or_newer = true;
235237
return 0;
236238
}
237239

intel_device.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct intel_gpu_info {
3434
int graphics_version;
3535
int sub_version;
3636
bool is_xelpd;
37+
bool is_mtl_or_newer;
3738
};
3839

3940
int intel_gpu_info_from_device_id(uint16_t device_id, struct intel_gpu_info *info);

0 commit comments

Comments
 (0)