Skip to content

Commit 14128d6

Browse files
committed
drm/i915: Replace several IS_METEORLAKE with proper IP version checks
Many of the IS_METEORLAKE conditions throughout the driver are supposed to be checks for Xe_LPG and/or Xe_LPM+ IP, not for the MTL platform specifically. Update those checks to ensure that the code will still operate properly if/when these IP versions show up on future platforms. v2: - Update two more conditions (one for pg_enable, one for MTL HuC compatibility). v3: - Don't change GuC/HuC compatibility check, which sounds like it truly is specific to the MTL platform. (Gustavo) - Drop a non-lineage workaround number for the OA timestamp frequency workaround. (Gustavo) Cc: Gustavo Sousa <gustavo.sousa@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230821180619.650007-20-matthew.d.roper@intel.com
1 parent 2e3c369 commit 14128d6

8 files changed

Lines changed: 13 additions & 14 deletions

File tree

drivers/gpu/drm/i915/gem/i915_gem_create.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ static int ext_set_pat(struct i915_user_extension __user *base, void *data)
405405
BUILD_BUG_ON(sizeof(struct drm_i915_gem_create_ext_set_pat) !=
406406
offsetofend(struct drm_i915_gem_create_ext_set_pat, rsvd));
407407

408-
/* Limiting the extension only to Meteor Lake */
409-
if (!IS_METEORLAKE(i915))
408+
/* Limiting the extension only to Xe_LPG and beyond */
409+
if (GRAPHICS_VER_FULL(i915) < IP_VER(12, 70))
410410
return -ENODEV;
411411

412412
if (copy_from_user(&ext, base, sizeof(ext)))

drivers/gpu/drm/i915/gt/intel_engine_pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static void intel_gsc_idle_msg_enable(struct intel_engine_cs *engine)
2121
{
2222
struct drm_i915_private *i915 = engine->i915;
2323

24-
if (IS_METEORLAKE(i915) && engine->id == GSC0) {
24+
if (MEDIA_VER(i915) >= 13 && engine->id == GSC0) {
2525
intel_uncore_write(engine->gt->uncore,
2626
RC_PSMI_CTRL_GSCCS,
2727
_MASKED_BIT_DISABLE(IDLE_MSG_DISABLE));

drivers/gpu/drm/i915/gt/intel_mocs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ static unsigned int get_mocs_settings(const struct drm_i915_private *i915,
495495
memset(table, 0, sizeof(struct drm_i915_mocs_table));
496496

497497
table->unused_entries_index = I915_MOCS_PTE;
498-
if (IS_METEORLAKE(i915)) {
498+
if (IS_GFX_GT_IP_RANGE(&i915->gt0, IP_VER(12, 70), IP_VER(12, 71))) {
499499
table->size = ARRAY_SIZE(mtl_mocs_table);
500500
table->table = mtl_mocs_table;
501501
table->n_entries = MTL_NUM_MOCS_ENTRIES;

drivers/gpu/drm/i915/gt/intel_rc6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)
123123
* temporary wa and should be removed after fixing real cause
124124
* of forcewake timeouts.
125125
*/
126-
if (IS_METEORLAKE(gt->i915))
126+
if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)))
127127
pg_enable =
128128
GEN9_MEDIA_PG_ENABLE |
129129
GEN11_MEDIA_SAMPLER_PG_ENABLE;

drivers/gpu/drm/i915/gt/intel_reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ static int __reset_guc(struct intel_gt *gt)
705705

706706
static bool needs_wa_14015076503(struct intel_gt *gt, intel_engine_mask_t engine_mask)
707707
{
708-
if (!IS_METEORLAKE(gt->i915) || !HAS_ENGINE(gt, GSC0))
708+
if (MEDIA_VER_FULL(gt->i915) != IP_VER(13, 0) || !HAS_ENGINE(gt, GSC0))
709709
return false;
710710

711711
if (!__HAS_ENGINE(engine_mask, GSC0))

drivers/gpu/drm/i915/gt/intel_rps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ void gen6_rps_get_freq_caps(struct intel_rps *rps, struct intel_rps_freq_caps *c
11611161
{
11621162
struct drm_i915_private *i915 = rps_to_i915(rps);
11631163

1164-
if (IS_METEORLAKE(i915))
1164+
if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70))
11651165
return mtl_get_freq_caps(rps, caps);
11661166
else
11671167
return __gen6_rps_get_freq_caps(rps, caps);

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static const char *i915_cache_level_str(struct drm_i915_gem_object *obj)
144144
{
145145
struct drm_i915_private *i915 = obj_to_i915(obj);
146146

147-
if (IS_METEORLAKE(i915)) {
147+
if (IS_GFX_GT_IP_RANGE(to_gt(i915), IP_VER(12, 70), IP_VER(12, 71))) {
148148
switch (obj->pat_index) {
149149
case 0: return " WB";
150150
case 1: return " WT";

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3220,11 +3220,10 @@ get_sseu_config(struct intel_sseu *out_sseu,
32203220
*/
32213221
u32 i915_perf_oa_timestamp_frequency(struct drm_i915_private *i915)
32223222
{
3223-
/*
3224-
* Wa_18013179988:dg2
3225-
* Wa_14015846243:mtl
3226-
*/
3227-
if (IS_DG2(i915) || IS_METEORLAKE(i915)) {
3223+
struct intel_gt *gt = to_gt(i915);
3224+
3225+
/* Wa_18013179988 */
3226+
if (IS_DG2(i915) || IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) {
32283227
intel_wakeref_t wakeref;
32293228
u32 reg, shift;
32303229

@@ -4507,7 +4506,7 @@ static bool xehp_is_valid_b_counter_addr(struct i915_perf *perf, u32 addr)
45074506

45084507
static bool gen12_is_valid_mux_addr(struct i915_perf *perf, u32 addr)
45094508
{
4510-
if (IS_METEORLAKE(perf->i915))
4509+
if (GRAPHICS_VER_FULL(perf->i915) >= IP_VER(12, 70))
45114510
return reg_in_range_table(addr, mtl_oa_mux_regs);
45124511
else
45134512
return reg_in_range_table(addr, gen12_oa_mux_regs);

0 commit comments

Comments
 (0)