Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-intel-gt-next-2023-09-28' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

Driver Changes:

Fixes/improvements/new stuff:

- Fix TLB-Invalidation seqno store [mtl] (Alan Previn)
- Force a reset on internal GuC error [guc] (John Harrison)
- Define GSC fw [gsc] (Daniele Ceraolo Spurio)
- Update workaround 14016712196 [dg2/mtl] (Tejas Upadhyay)
- Mark requests for GuC virtual engines to avoid use-after-free (Andrzej Hajda)
- Add Wa_14015150844 [dg2/mtl] (Shekhar Chauhan)
- Prevent error pointer dereference (Dan Carpenter)
- Add Wa_18022495364 [tgl,adl,rpl] (Dnyaneshwar Bhadane)
- Fix GuC PMU by moving execlist stats initialization to execlist specific setup (Umesh Nerlige Ramappa)
- Fix PXP firmware load [pxp/mtl] (Alan Previn)
- Fix execution/context state of PXP contexts (Alan Previn)
- Limit the length of an sg list to the requested length (Matthew Wilcox)
- Fix reservation address in ggtt_reserve_guc_top [guc] (Javier Pello)
- Add Wa_18028616096 [dg2] (Shekhar Chauhan)
- Get runtime pm in busyness worker only if already active [guc/pmu] (Umesh Nerlige Ramappa)
- Don't set PIPE_CONTROL_FLUSH_L3 for aux inval (Nirmoy Das)

Future platform enablement:

- Fix and consolidate some workaround checks, make others IP version based [mtl] (Matt Roper)
- Replace Meteorlake subplatforms with IP version checks (Matt Roper)
- Adding DeviceID for Arrowlake-S under MTL [mtl] (Nemesa Garg)
- Run relevant bits of debugfs drop_caches per GT (Tvrtko Ursulin)

Miscellaneous:

- Remove Wa_15010599737 [dg2] (Shekhar Chauhan)
- Align igt_spinner_create_request with hangcheck [selftests] (Jonathan Cavitt)
- Remove pre-production workarounds [dg2] (Matt Roper)
- Tidy some workaround definitions (Matt Roper)
- Wait longer for tasks in migrate selftest [gt] (Jonathan Cavitt)
- Skip WA verification for GEN7_MISCCPCTL on DG2 [gt] (Andrzej Hajda)
- Silence injected failure in the load via GSC path [huc] (Daniele Ceraolo Spurio)
- Refactor deprecated strncpy (Justin Stitt)
- Update RC6 mask for mtl_drpc [debugfs/mtl] (Badal Nilawar)
- Remove a static inline that requires including i915_drv.h [gt] (Jani Nikula)
- Remove inlines from i915_gem_execbuffer.c [gem] (Jani Nikula)
- Remove gtt_offset from stream->oa_buffer.head/.tail [perf] (Ashutosh Dixit)
- Do not disable preemption for resets (Tvrtko Ursulin)

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/ZRVzL02VFuwIkcGl@tursulin-desk

+525 -705
+1 -5
drivers/gpu/drm/i915/display/skl_universal_plane.c
··· 20 20 #include "skl_scaler.h" 21 21 #include "skl_universal_plane.h" 22 22 #include "skl_watermark.h" 23 + #include "gt/intel_gt.h" 23 24 #include "pxp/intel_pxp.h" 24 25 25 26 static const u32 skl_plane_formats[] = { ··· 2169 2168 static bool skl_plane_has_rc_ccs(struct drm_i915_private *i915, 2170 2169 enum pipe pipe, enum plane_id plane_id) 2171 2170 { 2172 - /* Wa_14017240301 */ 2173 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2174 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) 2175 - return false; 2176 - 2177 2171 /* Wa_22011186057 */ 2178 2172 if (IS_ALDERLAKE_P(i915) && IS_DISPLAY_STEP(i915, STEP_A0, STEP_B0)) 2179 2173 return false;
+2 -2
drivers/gpu/drm/i915/gem/i915_gem_create.c
··· 405 405 BUILD_BUG_ON(sizeof(struct drm_i915_gem_create_ext_set_pat) != 406 406 offsetofend(struct drm_i915_gem_create_ext_set_pat, rsvd)); 407 407 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)) 410 410 return -ENODEV; 411 411 412 412 if (copy_from_user(&ext, base, sizeof(ext)))
+10 -10
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
··· 321 321 static void eb_unpin_engine(struct i915_execbuffer *eb); 322 322 static void eb_capture_release(struct i915_execbuffer *eb); 323 323 324 - static inline bool eb_use_cmdparser(const struct i915_execbuffer *eb) 324 + static bool eb_use_cmdparser(const struct i915_execbuffer *eb) 325 325 { 326 326 return intel_engine_requires_cmd_parser(eb->context->engine) || 327 327 (intel_engine_using_cmd_parser(eb->context->engine) && ··· 433 433 return pin_flags; 434 434 } 435 435 436 - static inline int 436 + static int 437 437 eb_pin_vma(struct i915_execbuffer *eb, 438 438 const struct drm_i915_gem_exec_object2 *entry, 439 439 struct eb_vma *ev) ··· 486 486 return 0; 487 487 } 488 488 489 - static inline void 489 + static void 490 490 eb_unreserve_vma(struct eb_vma *ev) 491 491 { 492 492 if (unlikely(ev->flags & __EXEC_OBJECT_HAS_FENCE)) ··· 548 548 return 0; 549 549 } 550 550 551 - static inline bool 551 + static bool 552 552 is_batch_buffer(struct i915_execbuffer *eb, unsigned int buffer_idx) 553 553 { 554 554 return eb->args->flags & I915_EXEC_BATCH_FIRST ? ··· 628 628 return 0; 629 629 } 630 630 631 - static inline int use_cpu_reloc(const struct reloc_cache *cache, 632 - const struct drm_i915_gem_object *obj) 631 + static int use_cpu_reloc(const struct reloc_cache *cache, 632 + const struct drm_i915_gem_object *obj) 633 633 { 634 634 if (!i915_gem_object_has_struct_page(obj)) 635 635 return false; ··· 1107 1107 kfree(eb->buckets); 1108 1108 } 1109 1109 1110 - static inline u64 1110 + static u64 1111 1111 relocation_target(const struct drm_i915_gem_relocation_entry *reloc, 1112 1112 const struct i915_vma *target) 1113 1113 { ··· 1128 1128 cache->node.flags = 0; 1129 1129 } 1130 1130 1131 - static inline void *unmask_page(unsigned long p) 1131 + static void *unmask_page(unsigned long p) 1132 1132 { 1133 1133 return (void *)(uintptr_t)(p & PAGE_MASK); 1134 1134 } 1135 1135 1136 - static inline unsigned int unmask_flags(unsigned long p) 1136 + static unsigned int unmask_flags(unsigned long p) 1137 1137 { 1138 1138 return p & ~PAGE_MASK; 1139 1139 } 1140 1140 1141 1141 #define KMAP 0x4 /* after CLFLUSH_FLAGS */ 1142 1142 1143 - static inline struct i915_ggtt *cache_to_ggtt(struct reloc_cache *cache) 1143 + static struct i915_ggtt *cache_to_ggtt(struct reloc_cache *cache) 1144 1144 { 1145 1145 struct drm_i915_private *i915 = 1146 1146 container_of(cache, struct i915_execbuffer, reloc_cache)->i915;
+7 -4
drivers/gpu/drm/i915/gem/i915_gem_shmem.c
··· 100 100 st->nents = 0; 101 101 for (i = 0; i < page_count; i++) { 102 102 struct folio *folio; 103 + unsigned long nr_pages; 103 104 const unsigned int shrink[] = { 104 105 I915_SHRINK_BOUND | I915_SHRINK_UNBOUND, 105 106 0, ··· 151 150 } 152 151 } while (1); 153 152 153 + nr_pages = min_t(unsigned long, 154 + folio_nr_pages(folio), page_count - i); 154 155 if (!i || 155 156 sg->length >= max_segment || 156 157 folio_pfn(folio) != next_pfn) { ··· 160 157 sg = sg_next(sg); 161 158 162 159 st->nents++; 163 - sg_set_folio(sg, folio, folio_size(folio), 0); 160 + sg_set_folio(sg, folio, nr_pages * PAGE_SIZE, 0); 164 161 } else { 165 162 /* XXX: could overflow? */ 166 - sg->length += folio_size(folio); 163 + sg->length += nr_pages * PAGE_SIZE; 167 164 } 168 - next_pfn = folio_pfn(folio) + folio_nr_pages(folio); 169 - i += folio_nr_pages(folio) - 1; 165 + next_pfn = folio_pfn(folio) + nr_pages; 166 + i += nr_pages - 1; 170 167 171 168 /* Check that the i965g/gm workaround works. */ 172 169 GEM_BUG_ON(gfp & __GFP_DMA32 && next_pfn >= 0x00100000UL);
+1 -1
drivers/gpu/drm/i915/gem/selftests/mock_context.c
··· 36 36 if (name) { 37 37 struct i915_ppgtt *ppgtt; 38 38 39 - strncpy(ctx->name, name, sizeof(ctx->name) - 1); 39 + strscpy(ctx->name, name, sizeof(ctx->name)); 40 40 41 41 ppgtt = mock_ppgtt(i915, name); 42 42 if (!ppgtt)
+15 -6
drivers/gpu/drm/i915/gt/gen8_engine_cs.c
··· 4 4 */ 5 5 6 6 #include "gen8_engine_cs.h" 7 - #include "i915_drv.h" 8 7 #include "intel_engine_regs.h" 9 8 #include "intel_gpu_commands.h" 9 + #include "intel_gt.h" 10 10 #include "intel_lrc.h" 11 11 #include "intel_ring.h" 12 12 ··· 226 226 static int mtl_dummy_pipe_control(struct i915_request *rq) 227 227 { 228 228 /* Wa_14016712196 */ 229 - if (IS_MTL_GRAPHICS_STEP(rq->i915, M, STEP_A0, STEP_B0) || 230 - IS_MTL_GRAPHICS_STEP(rq->i915, P, STEP_A0, STEP_B0)) { 229 + if (IS_GFX_GT_IP_RANGE(rq->engine->gt, IP_VER(12, 70), IP_VER(12, 71)) || 230 + IS_DG2(rq->i915)) { 231 231 u32 *cs; 232 232 233 233 /* dummy PIPE_CONTROL + depth flush */ ··· 271 271 if (GRAPHICS_VER_FULL(rq->i915) >= IP_VER(12, 70)) 272 272 bit_group_0 |= PIPE_CONTROL_CCS_FLUSH; 273 273 274 + /* 275 + * L3 fabric flush is needed for AUX CCS invalidation 276 + * which happens as part of pipe-control so we can 277 + * ignore PIPE_CONTROL_FLUSH_L3. Also PIPE_CONTROL_FLUSH_L3 278 + * deals with Protected Memory which is not needed for 279 + * AUX CCS invalidation and lead to unwanted side effects. 280 + */ 281 + if (mode & EMIT_FLUSH) 282 + bit_group_1 |= PIPE_CONTROL_FLUSH_L3; 283 + 274 284 bit_group_1 |= PIPE_CONTROL_TILE_CACHE_FLUSH; 275 - bit_group_1 |= PIPE_CONTROL_FLUSH_L3; 276 285 bit_group_1 |= PIPE_CONTROL_RENDER_TARGET_CACHE_FLUSH; 277 286 bit_group_1 |= PIPE_CONTROL_DEPTH_CACHE_FLUSH; 278 287 /* Wa_1409600907:tgl,adl-p */ ··· 808 799 u32 *gen12_emit_fini_breadcrumb_rcs(struct i915_request *rq, u32 *cs) 809 800 { 810 801 struct drm_i915_private *i915 = rq->i915; 802 + struct intel_gt *gt = rq->engine->gt; 811 803 u32 flags = (PIPE_CONTROL_CS_STALL | 812 804 PIPE_CONTROL_TLB_INVALIDATE | 813 805 PIPE_CONTROL_TILE_CACHE_FLUSH | ··· 819 809 PIPE_CONTROL_FLUSH_ENABLE); 820 810 821 811 /* Wa_14016712196 */ 822 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 823 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) 812 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) || IS_DG2(i915)) 824 813 /* dummy PIPE_CONTROL + depth flush */ 825 814 cs = gen12_emit_pipe_control(cs, 0, 826 815 PIPE_CONTROL_DEPTH_CACHE_FLUSH, 0);
+1 -4
drivers/gpu/drm/i915/gt/intel_engine_cs.c
··· 558 558 DRIVER_CAPS(i915)->has_logical_contexts = true; 559 559 560 560 ewma__engine_latency_init(&engine->latency); 561 - seqcount_init(&engine->stats.execlists.lock); 562 561 563 562 ATOMIC_INIT_NOTIFIER_HEAD(&engine->context_status_notifier); 564 563 ··· 1616 1617 * Wa_22011802037: Prior to doing a reset, ensure CS is 1617 1618 * stopped, set ring stop bit and prefetch disable bit to halt CS 1618 1619 */ 1619 - if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) || 1620 - (GRAPHICS_VER(engine->i915) >= 11 && 1621 - GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 70))) 1620 + if (intel_engine_reset_needs_wa_22011802037(engine->gt)) 1622 1621 intel_uncore_write_fw(uncore, RING_MODE_GEN7(engine->mmio_base), 1623 1622 _MASKED_BIT_ENABLE(GEN12_GFX_PREFETCH_DISABLE)); 1624 1623
+1 -1
drivers/gpu/drm/i915/gt/intel_engine_pm.c
··· 21 21 { 22 22 struct drm_i915_private *i915 = engine->i915; 23 23 24 - if (IS_METEORLAKE(i915) && engine->id == GSC0) { 24 + if (MEDIA_VER(i915) >= 13 && engine->id == GSC0) { 25 25 intel_uncore_write(engine->gt->uncore, 26 26 RC_PSMI_CTRL_GSCCS, 27 27 _MASKED_BIT_DISABLE(IDLE_MSG_DISABLE));
+1
drivers/gpu/drm/i915/gt/intel_engine_regs.h
··· 177 177 #define CTX_CTRL_RS_CTX_ENABLE REG_BIT(1) 178 178 #define CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT REG_BIT(2) 179 179 #define CTX_CTRL_INHIBIT_SYN_CTX_SWITCH REG_BIT(3) 180 + #define GEN12_CTX_CTRL_RUNALONE_MODE REG_BIT(7) 180 181 #define GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE REG_BIT(8) 181 182 #define RING_CTX_SR_CTL(base) _MMIO((base) + 0x244) 182 183 #define RING_SEMA_WAIT_POLL(base) _MMIO((base) + 0x24c)
+3 -3
drivers/gpu/drm/i915/gt/intel_execlists_submission.c
··· 3001 3001 * Wa_22011802037: In addition to stopping the cs, we need 3002 3002 * to wait for any pending mi force wakeups 3003 3003 */ 3004 - if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) || 3005 - (GRAPHICS_VER(engine->i915) >= 11 && 3006 - GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 70))) 3004 + if (intel_engine_reset_needs_wa_22011802037(engine->gt)) 3007 3005 intel_engine_wait_for_pending_mi_fw(engine); 3008 3006 3009 3007 engine->execlists.reset_ccid = active_ccid(engine); ··· 3547 3549 3548 3550 logical_ring_default_vfuncs(engine); 3549 3551 logical_ring_default_irqs(engine); 3552 + 3553 + seqcount_init(&engine->stats.execlists.lock); 3550 3554 3551 3555 if (engine->flags & I915_ENGINE_HAS_RCS_REG_STATE) 3552 3556 rcs_submission_override(engine);
+17 -6
drivers/gpu/drm/i915/gt/intel_ggtt.c
··· 511 511 vm->clear_range(vm, vma_res->start, vma_res->vma_size); 512 512 } 513 513 514 + /* 515 + * Reserve the top of the GuC address space for firmware images. Addresses 516 + * beyond GUC_GGTT_TOP in the GuC address space are inaccessible by GuC, 517 + * which makes for a suitable range to hold GuC/HuC firmware images if the 518 + * size of the GGTT is 4G. However, on a 32-bit platform the size of the GGTT 519 + * is limited to 2G, which is less than GUC_GGTT_TOP, but we reserve a chunk 520 + * of the same size anyway, which is far more than needed, to keep the logic 521 + * in uc_fw_ggtt_offset() simple. 522 + */ 523 + #define GUC_TOP_RESERVE_SIZE (SZ_4G - GUC_GGTT_TOP) 524 + 514 525 static int ggtt_reserve_guc_top(struct i915_ggtt *ggtt) 515 526 { 516 - u64 size; 527 + u64 offset; 517 528 int ret; 518 529 519 530 if (!intel_uc_uses_guc(&ggtt->vm.gt->uc)) 520 531 return 0; 521 532 522 - GEM_BUG_ON(ggtt->vm.total <= GUC_GGTT_TOP); 523 - size = ggtt->vm.total - GUC_GGTT_TOP; 533 + GEM_BUG_ON(ggtt->vm.total <= GUC_TOP_RESERVE_SIZE); 534 + offset = ggtt->vm.total - GUC_TOP_RESERVE_SIZE; 524 535 525 - ret = i915_gem_gtt_reserve(&ggtt->vm, NULL, &ggtt->uc_fw, size, 526 - GUC_GGTT_TOP, I915_COLOR_UNEVICTABLE, 527 - PIN_NOEVICT); 536 + ret = i915_gem_gtt_reserve(&ggtt->vm, NULL, &ggtt->uc_fw, 537 + GUC_TOP_RESERVE_SIZE, offset, 538 + I915_COLOR_UNEVICTABLE, PIN_NOEVICT); 528 539 if (ret) 529 540 drm_dbg(&ggtt->vm.i915->drm, 530 541 "Failed to reserve top of GGTT for GuC\n");
+5
drivers/gpu/drm/i915/gt/intel_gt.c
··· 1019 1019 else 1020 1020 return I915_MAP_WC; 1021 1021 } 1022 + 1023 + bool intel_gt_needs_wa_22016122933(struct intel_gt *gt) 1024 + { 1025 + return MEDIA_VER_FULL(gt->i915) == IP_VER(13, 0) && gt->type == GT_MEDIA; 1026 + }
+64 -5
drivers/gpu/drm/i915/gt/intel_gt.h
··· 6 6 #ifndef __INTEL_GT__ 7 7 #define __INTEL_GT__ 8 8 9 - #include "i915_drv.h" 10 9 #include "intel_engine_types.h" 11 10 #include "intel_gt_types.h" 12 11 #include "intel_reset.h" 13 12 14 13 struct drm_i915_private; 15 14 struct drm_printer; 15 + 16 + /* 17 + * Check that the GT is a graphics GT and has an IP version within the 18 + * specified range (inclusive). 19 + */ 20 + #define IS_GFX_GT_IP_RANGE(gt, from, until) ( \ 21 + BUILD_BUG_ON_ZERO((from) < IP_VER(2, 0)) + \ 22 + BUILD_BUG_ON_ZERO((until) < (from)) + \ 23 + ((gt)->type != GT_MEDIA && \ 24 + GRAPHICS_VER_FULL((gt)->i915) >= (from) && \ 25 + GRAPHICS_VER_FULL((gt)->i915) <= (until))) 26 + 27 + /* 28 + * Check that the GT is a media GT and has an IP version within the 29 + * specified range (inclusive). 30 + * 31 + * Only usable on platforms with a standalone media design (i.e., IP version 13 32 + * and higher). 33 + */ 34 + #define IS_MEDIA_GT_IP_RANGE(gt, from, until) ( \ 35 + BUILD_BUG_ON_ZERO((from) < IP_VER(13, 0)) + \ 36 + BUILD_BUG_ON_ZERO((until) < (from)) + \ 37 + ((gt) && (gt)->type == GT_MEDIA && \ 38 + MEDIA_VER_FULL((gt)->i915) >= (from) && \ 39 + MEDIA_VER_FULL((gt)->i915) <= (until))) 40 + 41 + /* 42 + * Check that the GT is a graphics GT with a specific IP version and has 43 + * a stepping in the range [from, until). The lower stepping bound is 44 + * inclusive, the upper bound is exclusive. The most common use-case of this 45 + * macro is for checking bounds for workarounds, which usually have a stepping 46 + * ("from") at which the hardware issue is first present and another stepping 47 + * ("until") at which a hardware fix is present and the software workaround is 48 + * no longer necessary. E.g., 49 + * 50 + * IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) 51 + * IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_B1, STEP_FOREVER) 52 + * 53 + * "STEP_FOREVER" can be passed as "until" for workarounds that have no upper 54 + * stepping bound for the specified IP version. 55 + */ 56 + #define IS_GFX_GT_IP_STEP(gt, ipver, from, until) ( \ 57 + BUILD_BUG_ON_ZERO((until) <= (from)) + \ 58 + (IS_GFX_GT_IP_RANGE((gt), (ipver), (ipver)) && \ 59 + IS_GRAPHICS_STEP((gt)->i915, (from), (until)))) 60 + 61 + /* 62 + * Check that the GT is a media GT with a specific IP version and has 63 + * a stepping in the range [from, until). The lower stepping bound is 64 + * inclusive, the upper bound is exclusive. The most common use-case of this 65 + * macro is for checking bounds for workarounds, which usually have a stepping 66 + * ("from") at which the hardware issue is first present and another stepping 67 + * ("until") at which a hardware fix is present and the software workaround is 68 + * no longer necessary. "STEP_FOREVER" can be passed as "until" for 69 + * workarounds that have no upper stepping bound for the specified IP version. 70 + * 71 + * This macro may only be used to match on platforms that have a standalone 72 + * media design (i.e., media version 13 or higher). 73 + */ 74 + #define IS_MEDIA_GT_IP_STEP(gt, ipver, from, until) ( \ 75 + BUILD_BUG_ON_ZERO((until) <= (from)) + \ 76 + (IS_MEDIA_GT_IP_RANGE((gt), (ipver), (ipver)) && \ 77 + IS_MEDIA_STEP((gt)->i915, (from), (until)))) 16 78 17 79 #define GT_TRACE(gt, fmt, ...) do { \ 18 80 const struct intel_gt *gt__ __maybe_unused = (gt); \ ··· 87 25 return !gt->info.id; 88 26 } 89 27 90 - static inline bool intel_gt_needs_wa_22016122933(struct intel_gt *gt) 91 - { 92 - return MEDIA_VER_FULL(gt->i915) == IP_VER(13, 0) && gt->type == GT_MEDIA; 93 - } 28 + bool intel_gt_needs_wa_22016122933(struct intel_gt *gt); 94 29 95 30 static inline struct intel_gt *uc_to_gt(struct intel_uc *uc) 96 31 {
+3 -3
drivers/gpu/drm/i915/gt/intel_gt_mcr.c
··· 4 4 */ 5 5 6 6 #include "i915_drv.h" 7 - 7 + #include "intel_gt.h" 8 8 #include "intel_gt_mcr.h" 9 9 #include "intel_gt_print.h" 10 10 #include "intel_gt_regs.h" ··· 166 166 gt->steering_table[OADDRM] = xelpmp_oaddrm_steering_table; 167 167 } else if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)) { 168 168 /* Wa_14016747170 */ 169 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 170 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) 169 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 170 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) 171 171 fuse = REG_FIELD_GET(MTL_GT_L3_EXC_MASK, 172 172 intel_uncore_read(gt->uncore, 173 173 MTL_GT_ACTIVITY_FACTOR));
-1
drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
··· 290 290 seq_puts(m, "RC6\n"); 291 291 break; 292 292 default: 293 - MISSING_CASE(REG_FIELD_GET(MTL_CC_MASK, gt_core_status)); 294 293 seq_puts(m, "Unknown\n"); 295 294 break; 296 295 }
+6 -4
drivers/gpu/drm/i915/gt/intel_gt_regs.h
··· 26 26 #define MTL_CAGF_MASK REG_GENMASK(8, 0) 27 27 #define MTL_CC0 0x0 28 28 #define MTL_CC6 0x3 29 - #define MTL_CC_MASK REG_GENMASK(12, 9) 29 + #define MTL_CC_MASK REG_GENMASK(10, 9) 30 30 31 31 /* RPM unit config (Gen8+) */ 32 32 #define RPM_CONFIG0 _MMIO(0xd00) ··· 164 164 #define GEN9_CSFE_CHICKEN1_RCS _MMIO(0x20d4) 165 165 #define GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE (1 << 2) 166 166 #define GEN11_ENABLE_32_PLANE_MODE (1 << 7) 167 + #define GEN12_CS_DEBUG_MODE2 _MMIO(0x20d8) 168 + #define INSTRUCTION_STATE_CACHE_INVALIDATE REG_BIT(6) 167 169 168 170 #define GEN7_FF_SLICE_CS_CHICKEN1 _MMIO(0x20e0) 169 171 #define GEN9_FFSC_PERCTX_PREEMPT_CTRL (1 << 14) ··· 413 411 #define GEN9_FACTOR_IN_CLR_VAL_HIZ (1 << 9) 414 412 415 413 #define XEHP_CULLBIT1 MCR_REG(0x6100) 416 - 417 - #define CHICKEN_RASTER_1 MCR_REG(0x6204) 418 - #define DIS_SF_ROUND_NEAREST_EVEN REG_BIT(8) 419 414 420 415 #define CHICKEN_RASTER_2 MCR_REG(0x6208) 421 416 #define TBIMR_FAST_CLIP REG_BIT(5) ··· 1220 1221 1221 1222 #define XEHP_HDC_CHICKEN0 MCR_REG(0xe5f0) 1222 1223 #define LSC_L1_FLUSH_CTL_3D_DATAPORT_FLUSH_EVENTS_MASK REG_GENMASK(13, 11) 1224 + #define DIS_ATOMIC_CHAINING_TYPED_WRITES REG_BIT(3) 1225 + 1223 1226 #define ICL_HDC_MODE MCR_REG(0xe5f4) 1224 1227 1225 1228 #define EU_PERF_CNTL2 PERF_REG(0xe658) ··· 1232 1231 #define DISABLE_D8_D16_COASLESCE REG_BIT(30) 1233 1232 #define FORCE_1_SUB_MESSAGE_PER_FRAGMENT REG_BIT(15) 1234 1233 #define LSC_CHICKEN_BIT_0_UDW MCR_REG(0xe7c8 + 4) 1234 + #define UGM_FRAGMENT_THRESHOLD_TO_3 REG_BIT(58 - 32) 1235 1235 #define DIS_CHAIN_2XSIMD8 REG_BIT(55 - 32) 1236 1236 #define FORCE_SLM_FENCE_SCOPE_TO_TILE REG_BIT(42 - 32) 1237 1237 #define FORCE_UGM_FENCE_SCOPE_TO_TILE REG_BIT(41 - 32)
+43 -36
drivers/gpu/drm/i915/gt/intel_lrc.c
··· 845 845 lrc_ring_indirect_offset_default(engine) << 6; 846 846 } 847 847 848 + static bool ctx_needs_runalone(const struct intel_context *ce) 849 + { 850 + struct i915_gem_context *gem_ctx; 851 + bool ctx_is_protected = false; 852 + 853 + /* 854 + * On MTL and newer platforms, protected contexts require setting 855 + * the LRC run-alone bit or else the encryption will not happen. 856 + */ 857 + if (GRAPHICS_VER_FULL(ce->engine->i915) >= IP_VER(12, 70) && 858 + (ce->engine->class == COMPUTE_CLASS || ce->engine->class == RENDER_CLASS)) { 859 + rcu_read_lock(); 860 + gem_ctx = rcu_dereference(ce->gem_context); 861 + if (gem_ctx) 862 + ctx_is_protected = gem_ctx->uses_protected_content; 863 + rcu_read_unlock(); 864 + } 865 + 866 + return ctx_is_protected; 867 + } 868 + 848 869 static void init_common_regs(u32 * const regs, 849 870 const struct intel_context *ce, 850 871 const struct intel_engine_cs *engine, ··· 881 860 if (GRAPHICS_VER(engine->i915) < 11) 882 861 ctl |= _MASKED_BIT_DISABLE(CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT | 883 862 CTX_CTRL_RS_CTX_ENABLE); 863 + if (ctx_needs_runalone(ce)) 864 + ctl |= _MASKED_BIT_ENABLE(GEN12_CTX_CTRL_RUNALONE_MODE); 884 865 regs[CTX_CONTEXT_CONTROL] = ctl; 885 866 886 867 regs[CTX_TIMESTAMP] = ce->stats.runtime.last; ··· 1117 1094 I915_BO_ALLOC_PM_VOLATILE); 1118 1095 if (IS_ERR(obj)) { 1119 1096 obj = i915_gem_object_create_shmem(engine->i915, context_size); 1097 + if (IS_ERR(obj)) 1098 + return ERR_CAST(obj); 1099 + 1120 1100 /* 1121 1101 * Wa_22016122933: For Media version 13.0, all Media GT shared 1122 1102 * memory needs to be mapped as WC on CPU side and UC (PAT ··· 1128 1102 if (intel_gt_needs_wa_22016122933(engine->gt)) 1129 1103 i915_gem_object_set_cache_coherency(obj, I915_CACHE_NONE); 1130 1104 } 1131 - if (IS_ERR(obj)) 1132 - return ERR_CAST(obj); 1133 1105 1134 1106 vma = i915_vma_instance(obj, &engine->gt->ggtt->vm, NULL); 1135 1107 if (IS_ERR(vma)) { ··· 1340 1316 } 1341 1317 1342 1318 /* 1343 - * On DG2 during context restore of a preempted context in GPGPU mode, 1344 - * RCS restore hang is detected. This is extremely timing dependent. 1345 - * To address this below sw wabb is implemented for DG2 A steppings. 1346 - */ 1347 - static u32 * 1348 - dg2_emit_rcs_hang_wabb(const struct intel_context *ce, u32 *cs) 1349 - { 1350 - *cs++ = MI_LOAD_REGISTER_IMM(1); 1351 - *cs++ = i915_mmio_reg_offset(GEN12_STATE_ACK_DEBUG(ce->engine->mmio_base)); 1352 - *cs++ = 0x21; 1353 - 1354 - *cs++ = MI_LOAD_REGISTER_REG; 1355 - *cs++ = i915_mmio_reg_offset(RING_NOPID(ce->engine->mmio_base)); 1356 - *cs++ = i915_mmio_reg_offset(XEHP_CULLBIT1); 1357 - 1358 - *cs++ = MI_LOAD_REGISTER_REG; 1359 - *cs++ = i915_mmio_reg_offset(RING_NOPID(ce->engine->mmio_base)); 1360 - *cs++ = i915_mmio_reg_offset(XEHP_CULLBIT2); 1361 - 1362 - return cs; 1363 - } 1364 - 1365 - /* 1366 1319 * The bspec's tuning guide asks us to program a vertical watermark value of 1367 1320 * 0x3FF. However this register is not saved/restored properly by the 1368 1321 * hardware, so we're required to apply the desired value via INDIRECT_CTX ··· 1357 1356 } 1358 1357 1359 1358 static u32 * 1359 + gen12_invalidate_state_cache(u32 *cs) 1360 + { 1361 + *cs++ = MI_LOAD_REGISTER_IMM(1); 1362 + *cs++ = i915_mmio_reg_offset(GEN12_CS_DEBUG_MODE2); 1363 + *cs++ = _MASKED_BIT_ENABLE(INSTRUCTION_STATE_CACHE_INVALIDATE); 1364 + return cs; 1365 + } 1366 + 1367 + static u32 * 1360 1368 gen12_emit_indirect_ctx_rcs(const struct intel_context *ce, u32 *cs) 1361 1369 { 1362 1370 cs = gen12_emit_timestamp_wa(ce, cs); 1363 1371 cs = gen12_emit_cmd_buf_wa(ce, cs); 1364 1372 cs = gen12_emit_restore_scratch(ce, cs); 1365 1373 1366 - /* Wa_22011450934:dg2 */ 1367 - if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_A0, STEP_B0) || 1368 - IS_DG2_GRAPHICS_STEP(ce->engine->i915, G11, STEP_A0, STEP_B0)) 1369 - cs = dg2_emit_rcs_hang_wabb(ce, cs); 1370 - 1371 1374 /* Wa_16013000631:dg2 */ 1372 - if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_B0, STEP_C0) || 1373 - IS_DG2_G11(ce->engine->i915)) 1375 + if (IS_DG2_G11(ce->engine->i915)) 1374 1376 cs = gen8_emit_pipe_control(cs, PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE, 0); 1375 1377 1376 1378 cs = gen12_emit_aux_table_inv(ce->engine, cs); 1377 1379 1380 + /* Wa_18022495364 */ 1381 + if (IS_GFX_GT_IP_RANGE(ce->engine->gt, IP_VER(12, 0), IP_VER(12, 10))) 1382 + cs = gen12_invalidate_state_cache(cs); 1383 + 1378 1384 /* Wa_16014892111 */ 1379 - if (IS_MTL_GRAPHICS_STEP(ce->engine->i915, M, STEP_A0, STEP_B0) || 1380 - IS_MTL_GRAPHICS_STEP(ce->engine->i915, P, STEP_A0, STEP_B0) || 1385 + if (IS_GFX_GT_IP_STEP(ce->engine->gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 1386 + IS_GFX_GT_IP_STEP(ce->engine->gt, IP_VER(12, 71), STEP_A0, STEP_B0) || 1381 1387 IS_DG2(ce->engine->i915)) 1382 1388 cs = dg2_emit_draw_watermark_setting(cs); 1383 1389 ··· 1398 1390 cs = gen12_emit_restore_scratch(ce, cs); 1399 1391 1400 1392 /* Wa_16013000631:dg2 */ 1401 - if (IS_DG2_GRAPHICS_STEP(ce->engine->i915, G10, STEP_B0, STEP_C0) || 1402 - IS_DG2_G11(ce->engine->i915)) 1393 + if (IS_DG2_G11(ce->engine->i915)) 1403 1394 if (ce->engine->class == COMPUTE_CLASS) 1404 1395 cs = gen8_emit_pipe_control(cs, 1405 1396 PIPE_CONTROL_INSTRUCTION_CACHE_INVALIDATE,
+3 -20
drivers/gpu/drm/i915/gt/intel_mocs.c
··· 404 404 MOCS_ENTRY(3, 0, L3_3_WB | L3_LKUP(1)), 405 405 }; 406 406 407 - static const struct drm_i915_mocs_entry dg2_mocs_table_g10_ax[] = { 408 - /* Wa_14011441408: Set Go to Memory for MOCS#0 */ 409 - MOCS_ENTRY(0, 0, L3_1_UC | L3_GLBGO(1) | L3_LKUP(1)), 410 - /* UC - Coherent; GO:Memory */ 411 - MOCS_ENTRY(1, 0, L3_1_UC | L3_GLBGO(1) | L3_LKUP(1)), 412 - /* UC - Non-Coherent; GO:Memory */ 413 - MOCS_ENTRY(2, 0, L3_1_UC | L3_GLBGO(1)), 414 - 415 - /* WB - LC */ 416 - MOCS_ENTRY(3, 0, L3_3_WB | L3_LKUP(1)), 417 - }; 418 - 419 407 static const struct drm_i915_mocs_entry pvc_mocs_table[] = { 420 408 /* Error */ 421 409 MOCS_ENTRY(0, 0, L3_3_WB), ··· 495 507 memset(table, 0, sizeof(struct drm_i915_mocs_table)); 496 508 497 509 table->unused_entries_index = I915_MOCS_PTE; 498 - if (IS_METEORLAKE(i915)) { 510 + if (IS_GFX_GT_IP_RANGE(&i915->gt0, IP_VER(12, 70), IP_VER(12, 71))) { 499 511 table->size = ARRAY_SIZE(mtl_mocs_table); 500 512 table->table = mtl_mocs_table; 501 513 table->n_entries = MTL_NUM_MOCS_ENTRIES; ··· 509 521 table->wb_index = 2; 510 522 table->unused_entries_index = 2; 511 523 } else if (IS_DG2(i915)) { 512 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0)) { 513 - table->size = ARRAY_SIZE(dg2_mocs_table_g10_ax); 514 - table->table = dg2_mocs_table_g10_ax; 515 - } else { 516 - table->size = ARRAY_SIZE(dg2_mocs_table); 517 - table->table = dg2_mocs_table; 518 - } 524 + table->size = ARRAY_SIZE(dg2_mocs_table); 525 + table->table = dg2_mocs_table; 519 526 table->uc_index = 1; 520 527 table->n_entries = GEN9_NUM_MOCS_ENTRIES; 521 528 table->unused_entries_index = 3;
+3 -6
drivers/gpu/drm/i915/gt/intel_rc6.c
··· 118 118 GEN6_RC_CTL_EI_MODE(1); 119 119 120 120 /* 121 - * Wa_16011777198 and BSpec 52698 - Render powergating must be off. 121 + * BSpec 52698 - Render powergating must be off. 122 122 * FIXME BSpec is outdated, disabling powergating for MTL is just 123 123 * temporary wa and should be removed after fixing real cause 124 124 * of forcewake timeouts. 125 125 */ 126 - if (IS_METEORLAKE(gt->i915) || 127 - IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_C0) || 128 - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_B0)) 126 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) 129 127 pg_enable = 130 128 GEN9_MEDIA_PG_ENABLE | 131 129 GEN11_MEDIA_SAMPLER_PG_ENABLE; ··· 524 526 return false; 525 527 } 526 528 527 - if (IS_MTL_MEDIA_STEP(gt->i915, STEP_A0, STEP_B0) && 528 - gt->type == GT_MEDIA) { 529 + if (IS_MEDIA_GT_IP_STEP(gt, IP_VER(13, 0), STEP_A0, STEP_B0)) { 529 530 drm_notice(&i915->drm, 530 531 "Media RC6 disabled on A step\n"); 531 532 return false;
+25 -9
drivers/gpu/drm/i915/gt/intel_reset.c
··· 161 161 struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev); 162 162 int err; 163 163 164 - /* Assert reset for at least 20 usec, and wait for acknowledgement. */ 164 + /* Assert reset for at least 50 usec, and wait for acknowledgement. */ 165 165 pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE); 166 166 udelay(50); 167 - err = wait_for_atomic(i915_in_reset(pdev), 50); 167 + err = _wait_for_atomic(i915_in_reset(pdev), 50000, 0); 168 168 169 169 /* Clear the reset request. */ 170 170 pci_write_config_byte(pdev, I915_GDRST, 0); 171 171 udelay(50); 172 172 if (!err) 173 - err = wait_for_atomic(!i915_in_reset(pdev), 50); 173 + err = _wait_for_atomic(!i915_in_reset(pdev), 50000, 0); 174 174 175 175 return err; 176 176 } ··· 190 190 struct pci_dev *pdev = to_pci_dev(gt->i915->drm.dev); 191 191 192 192 pci_write_config_byte(pdev, I915_GDRST, GRDOM_RESET_ENABLE); 193 - return wait_for_atomic(g4x_reset_complete(pdev), 50); 193 + return _wait_for_atomic(g4x_reset_complete(pdev), 50000, 0); 194 194 } 195 195 196 196 static int g4x_do_reset(struct intel_gt *gt, ··· 207 207 208 208 pci_write_config_byte(pdev, I915_GDRST, 209 209 GRDOM_MEDIA | GRDOM_RESET_ENABLE); 210 - ret = wait_for_atomic(g4x_reset_complete(pdev), 50); 210 + ret = _wait_for_atomic(g4x_reset_complete(pdev), 50000, 0); 211 211 if (ret) { 212 212 GT_TRACE(gt, "Wait for media reset failed\n"); 213 213 goto out; ··· 215 215 216 216 pci_write_config_byte(pdev, I915_GDRST, 217 217 GRDOM_RENDER | GRDOM_RESET_ENABLE); 218 - ret = wait_for_atomic(g4x_reset_complete(pdev), 50); 218 + ret = _wait_for_atomic(g4x_reset_complete(pdev), 50000, 0); 219 219 if (ret) { 220 220 GT_TRACE(gt, "Wait for render reset failed\n"); 221 221 goto out; ··· 705 705 706 706 static bool needs_wa_14015076503(struct intel_gt *gt, intel_engine_mask_t engine_mask) 707 707 { 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)) 709 709 return false; 710 710 711 711 if (!__HAS_ENGINE(engine_mask, GSC0)) ··· 785 785 reset_mask = wa_14015076503_start(gt, engine_mask, !retry); 786 786 787 787 GT_TRACE(gt, "engine_mask=%x\n", reset_mask); 788 - preempt_disable(); 789 788 ret = reset(gt, reset_mask, retry); 790 - preempt_enable(); 791 789 792 790 wa_14015076503_end(gt, reset_mask); 793 791 } ··· 1628 1630 cancel_delayed_work_sync(&w->work); 1629 1631 destroy_delayed_work_on_stack(&w->work); 1630 1632 w->gt = NULL; 1633 + } 1634 + 1635 + /* 1636 + * Wa_22011802037 requires that we (or the GuC) ensure that no command 1637 + * streamers are executing MI_FORCE_WAKE while an engine reset is initiated. 1638 + */ 1639 + bool intel_engine_reset_needs_wa_22011802037(struct intel_gt *gt) 1640 + { 1641 + if (GRAPHICS_VER(gt->i915) < 11) 1642 + return false; 1643 + 1644 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0)) 1645 + return true; 1646 + 1647 + if (GRAPHICS_VER_FULL(gt->i915) >= IP_VER(12, 70)) 1648 + return false; 1649 + 1650 + return true; 1631 1651 } 1632 1652 1633 1653 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
+2
drivers/gpu/drm/i915/gt/intel_reset.h
··· 78 78 bool intel_has_gpu_reset(const struct intel_gt *gt); 79 79 bool intel_has_reset_engine(const struct intel_gt *gt); 80 80 81 + bool intel_engine_reset_needs_wa_22011802037(struct intel_gt *gt); 82 + 81 83 #endif /* I915_RESET_H */
+1 -1
drivers/gpu/drm/i915/gt/intel_rps.c
··· 1161 1161 { 1162 1162 struct drm_i915_private *i915 = rps_to_i915(rps); 1163 1163 1164 - if (IS_METEORLAKE(i915)) 1164 + if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)) 1165 1165 return mtl_get_freq_caps(rps, caps); 1166 1166 else 1167 1167 return __gen6_rps_get_freq_caps(rps, caps);
+115 -296
drivers/gpu/drm/i915/gt/intel_workarounds.c
··· 764 764 { 765 765 dg2_ctx_gt_tuning_init(engine, wal); 766 766 767 - /* Wa_16011186671:dg2_g11 */ 768 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G11, STEP_A0, STEP_B0)) { 769 - wa_mcr_masked_dis(wal, VFLSKPD, DIS_MULT_MISS_RD_SQUASH); 770 - wa_mcr_masked_en(wal, VFLSKPD, DIS_OVER_FETCH_CACHE); 771 - } 772 - 773 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_A0, STEP_B0)) { 774 - /* Wa_14010469329:dg2_g10 */ 775 - wa_mcr_masked_en(wal, XEHP_COMMON_SLICE_CHICKEN3, 776 - XEHP_DUAL_SIMD8_SEQ_MERGE_DISABLE); 777 - 778 - /* 779 - * Wa_22010465075:dg2_g10 780 - * Wa_22010613112:dg2_g10 781 - * Wa_14010698770:dg2_g10 782 - */ 783 - wa_mcr_masked_en(wal, XEHP_COMMON_SLICE_CHICKEN3, 784 - GEN12_DISABLE_CPS_AWARE_COLOR_PIPE); 785 - } 786 - 787 767 /* Wa_16013271637:dg2 */ 788 768 wa_mcr_masked_en(wal, XEHP_SLICE_COMMON_ECO_CHICKEN1, 789 769 MSC_MSAA_REODER_BUF_BYPASS_DISABLE); 790 770 791 771 /* Wa_14014947963:dg2 */ 792 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_B0, STEP_FOREVER) || 793 - IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) 794 - wa_masked_field_set(wal, VF_PREEMPTION, PREEMPTION_VERTEX_COUNT, 0x4000); 772 + wa_masked_field_set(wal, VF_PREEMPTION, PREEMPTION_VERTEX_COUNT, 0x4000); 795 773 796 774 /* Wa_18018764978:dg2 */ 797 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_C0, STEP_FOREVER) || 798 - IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) 799 - wa_mcr_masked_en(wal, XEHP_PSS_MODE2, SCOREBOARD_STALL_FLUSH_CONTROL); 800 - 801 - /* Wa_15010599737:dg2 */ 802 - wa_mcr_masked_en(wal, CHICKEN_RASTER_1, DIS_SF_ROUND_NEAREST_EVEN); 775 + wa_mcr_masked_en(wal, XEHP_PSS_MODE2, SCOREBOARD_STALL_FLUSH_CONTROL); 803 776 804 777 /* Wa_18019271663:dg2 */ 805 778 wa_masked_en(wal, CACHE_MODE_1, MSAA_OPTIMIZATION_REDUC_DISABLE); 806 779 } 807 780 808 - static void mtl_ctx_gt_tuning_init(struct intel_engine_cs *engine, 809 - struct i915_wa_list *wal) 781 + static void xelpg_ctx_gt_tuning_init(struct intel_engine_cs *engine, 782 + struct i915_wa_list *wal) 810 783 { 811 - struct drm_i915_private *i915 = engine->i915; 784 + struct intel_gt *gt = engine->gt; 812 785 813 786 dg2_ctx_gt_tuning_init(engine, wal); 814 787 815 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_B0, STEP_FOREVER) || 816 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_B0, STEP_FOREVER)) 788 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_B0, STEP_FOREVER) || 789 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_B0, STEP_FOREVER)) 817 790 wa_add(wal, DRAW_WATERMARK, VERT_WM_VAL, 0x3FF, 0, false); 818 791 } 819 792 820 - static void mtl_ctx_workarounds_init(struct intel_engine_cs *engine, 821 - struct i915_wa_list *wal) 793 + static void xelpg_ctx_workarounds_init(struct intel_engine_cs *engine, 794 + struct i915_wa_list *wal) 822 795 { 823 - struct drm_i915_private *i915 = engine->i915; 796 + struct intel_gt *gt = engine->gt; 824 797 825 - mtl_ctx_gt_tuning_init(engine, wal); 798 + xelpg_ctx_gt_tuning_init(engine, wal); 826 799 827 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 828 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) { 800 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 801 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) { 829 802 /* Wa_14014947963 */ 830 803 wa_masked_field_set(wal, VF_PREEMPTION, 831 804 PREEMPTION_VERTEX_COUNT, 0x4000); ··· 904 931 if (engine->class != RENDER_CLASS) 905 932 goto done; 906 933 907 - if (IS_METEORLAKE(i915)) 908 - mtl_ctx_workarounds_init(engine, wal); 934 + if (IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71))) 935 + xelpg_ctx_workarounds_init(engine, wal); 909 936 else if (IS_PONTEVECCHIO(i915)) 910 937 ; /* noop; none at this time */ 911 938 else if (IS_DG2(i915)) ··· 1579 1606 static void 1580 1607 dg2_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal) 1581 1608 { 1582 - struct intel_engine_cs *engine; 1583 - int id; 1584 - 1585 1609 xehp_init_mcr(gt, wal); 1586 1610 1587 1611 /* Wa_14011060649:dg2 */ 1588 1612 wa_14011060649(gt, wal); 1589 - 1590 - /* 1591 - * Although there are per-engine instances of these registers, 1592 - * they technically exist outside the engine itself and are not 1593 - * impacted by engine resets. Furthermore, they're part of the 1594 - * GuC blacklist so trying to treat them as engine workarounds 1595 - * will result in GuC initialization failure and a wedged GPU. 1596 - */ 1597 - for_each_engine(engine, gt, id) { 1598 - if (engine->class != VIDEO_DECODE_CLASS) 1599 - continue; 1600 - 1601 - /* Wa_16010515920:dg2_g10 */ 1602 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_B0)) 1603 - wa_write_or(wal, VDBOX_CGCTL3F18(engine->mmio_base), 1604 - ALNUNIT_CLKGATE_DIS); 1605 - } 1606 1613 1607 1614 if (IS_DG2_G10(gt->i915)) { 1608 1615 /* Wa_22010523718:dg2 */ ··· 1594 1641 DSS_ROUTER_CLKGATE_DIS); 1595 1642 } 1596 1643 1597 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_B0) || 1598 - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_B0)) { 1599 - /* Wa_14012362059:dg2 */ 1600 - wa_mcr_write_or(wal, XEHP_MERT_MOD_CTRL, FORCE_MISS_FTLB); 1601 - } 1602 - 1603 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_B0)) { 1604 - /* Wa_14010948348:dg2_g10 */ 1605 - wa_write_or(wal, UNSLCGCTL9430, MSQDUNIT_CLKGATE_DIS); 1606 - 1607 - /* Wa_14011037102:dg2_g10 */ 1608 - wa_write_or(wal, UNSLCGCTL9444, LTCDD_CLKGATE_DIS); 1609 - 1610 - /* Wa_14011371254:dg2_g10 */ 1611 - wa_mcr_write_or(wal, XEHP_SLICE_UNIT_LEVEL_CLKGATE, NODEDSS_CLKGATE_DIS); 1612 - 1613 - /* Wa_14011431319:dg2_g10 */ 1614 - wa_write_or(wal, UNSLCGCTL9440, GAMTLBOACS_CLKGATE_DIS | 1615 - GAMTLBVDBOX7_CLKGATE_DIS | 1616 - GAMTLBVDBOX6_CLKGATE_DIS | 1617 - GAMTLBVDBOX5_CLKGATE_DIS | 1618 - GAMTLBVDBOX4_CLKGATE_DIS | 1619 - GAMTLBVDBOX3_CLKGATE_DIS | 1620 - GAMTLBVDBOX2_CLKGATE_DIS | 1621 - GAMTLBVDBOX1_CLKGATE_DIS | 1622 - GAMTLBVDBOX0_CLKGATE_DIS | 1623 - GAMTLBKCR_CLKGATE_DIS | 1624 - GAMTLBGUC_CLKGATE_DIS | 1625 - GAMTLBBLT_CLKGATE_DIS); 1626 - wa_write_or(wal, UNSLCGCTL9444, GAMTLBGFXA0_CLKGATE_DIS | 1627 - GAMTLBGFXA1_CLKGATE_DIS | 1628 - GAMTLBCOMPA0_CLKGATE_DIS | 1629 - GAMTLBCOMPA1_CLKGATE_DIS | 1630 - GAMTLBCOMPB0_CLKGATE_DIS | 1631 - GAMTLBCOMPB1_CLKGATE_DIS | 1632 - GAMTLBCOMPC0_CLKGATE_DIS | 1633 - GAMTLBCOMPC1_CLKGATE_DIS | 1634 - GAMTLBCOMPD0_CLKGATE_DIS | 1635 - GAMTLBCOMPD1_CLKGATE_DIS | 1636 - GAMTLBMERT_CLKGATE_DIS | 1637 - GAMTLBVEBOX3_CLKGATE_DIS | 1638 - GAMTLBVEBOX2_CLKGATE_DIS | 1639 - GAMTLBVEBOX1_CLKGATE_DIS | 1640 - GAMTLBVEBOX0_CLKGATE_DIS); 1641 - 1642 - /* Wa_14010569222:dg2_g10 */ 1643 - wa_write_or(wal, UNSLICE_UNIT_LEVEL_CLKGATE, 1644 - GAMEDIA_CLKGATE_DIS); 1645 - 1646 - /* Wa_14011028019:dg2_g10 */ 1647 - wa_mcr_write_or(wal, SSMCGCTL9530, RTFUNIT_CLKGATE_DIS); 1648 - 1649 - /* Wa_14010680813:dg2_g10 */ 1650 - wa_mcr_write_or(wal, XEHP_GAMSTLB_CTRL, 1651 - CONTROL_BLOCK_CLKGATE_DIS | 1652 - EGRESS_BLOCK_CLKGATE_DIS | 1653 - TAG_BLOCK_CLKGATE_DIS); 1654 - } 1655 - 1656 1644 /* Wa_14014830051:dg2 */ 1657 1645 wa_mcr_write_clr(wal, SARB_CHICKEN1, COMP_CKN_IN); 1658 1646 1659 - /* Wa_14015795083 */ 1660 - wa_write_clr(wal, GEN7_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE); 1647 + /* 1648 + * Wa_14015795083 1649 + * Skip verification for possibly locked register. 1650 + */ 1651 + wa_add(wal, GEN7_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE, 1652 + 0, 0, false); 1661 1653 1662 1654 /* Wa_18018781329 */ 1663 1655 wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB); ··· 1645 1747 /* Wa_22016670082 */ 1646 1748 wa_write_or(wal, GEN12_SQCNT1, GEN12_STRICT_RAR_ENABLE); 1647 1749 1648 - if (IS_MTL_GRAPHICS_STEP(gt->i915, M, STEP_A0, STEP_B0) || 1649 - IS_MTL_GRAPHICS_STEP(gt->i915, P, STEP_A0, STEP_B0)) { 1750 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 1751 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) { 1650 1752 /* Wa_14014830051 */ 1651 1753 wa_mcr_write_clr(wal, SARB_CHICKEN1, COMP_CKN_IN); 1652 1754 ··· 1689 1791 */ 1690 1792 static void gt_tuning_settings(struct intel_gt *gt, struct i915_wa_list *wal) 1691 1793 { 1692 - if (IS_METEORLAKE(gt->i915)) { 1693 - if (gt->type != GT_MEDIA) 1694 - wa_mcr_write_or(wal, XEHP_L3SCQREG7, BLEND_FILL_CACHING_OPT_DIS); 1695 - 1794 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) { 1795 + wa_mcr_write_or(wal, XEHP_L3SCQREG7, BLEND_FILL_CACHING_OPT_DIS); 1696 1796 wa_mcr_write_or(wal, XEHP_SQCM, EN_32B_ACCESS); 1697 1797 } 1698 1798 ··· 1714 1818 gt_tuning_settings(gt, wal); 1715 1819 1716 1820 if (gt->type == GT_MEDIA) { 1717 - if (MEDIA_VER(i915) >= 13) 1821 + if (MEDIA_VER_FULL(i915) == IP_VER(13, 0)) 1718 1822 xelpmp_gt_workarounds_init(gt, wal); 1719 1823 else 1720 - MISSING_CASE(MEDIA_VER(i915)); 1824 + MISSING_CASE(MEDIA_VER_FULL(i915)); 1721 1825 1722 1826 return; 1723 1827 } 1724 1828 1725 - if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 70)) 1829 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) 1726 1830 xelpg_gt_workarounds_init(gt, wal); 1727 1831 else if (IS_PONTEVECCHIO(i915)) 1728 1832 pvc_gt_workarounds_init(gt, wal); ··· 2138 2242 2139 2243 switch (engine->class) { 2140 2244 case RENDER_CLASS: 2141 - /* 2142 - * Wa_1507100340:dg2_g10 2143 - * 2144 - * This covers 4 registers which are next to one another : 2145 - * - PS_INVOCATION_COUNT 2146 - * - PS_INVOCATION_COUNT_UDW 2147 - * - PS_DEPTH_COUNT 2148 - * - PS_DEPTH_COUNT_UDW 2149 - */ 2150 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_A0, STEP_B0)) 2151 - whitelist_reg_ext(w, PS_INVOCATION_COUNT, 2152 - RING_FORCE_TO_NONPRIV_ACCESS_RD | 2153 - RING_FORCE_TO_NONPRIV_RANGE_4); 2154 - 2155 2245 /* Required by recommended tuning setting (not a workaround) */ 2156 2246 whitelist_mcr_reg(w, XEHP_COMMON_SLICE_CHICKEN3); 2157 2247 2158 - break; 2159 - case COMPUTE_CLASS: 2160 - /* Wa_16011157294:dg2_g10 */ 2161 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_A0, STEP_B0)) 2162 - whitelist_reg(w, GEN9_CTX_PREEMPT_REG); 2163 2248 break; 2164 2249 default: 2165 2250 break; ··· 2171 2294 blacklist_trtt(engine); 2172 2295 } 2173 2296 2174 - static void mtl_whitelist_build(struct intel_engine_cs *engine) 2297 + static void xelpg_whitelist_build(struct intel_engine_cs *engine) 2175 2298 { 2176 2299 struct i915_wa_list *w = &engine->whitelist; 2177 2300 ··· 2193 2316 2194 2317 wa_init_start(w, engine->gt, "whitelist", engine->name); 2195 2318 2196 - if (IS_METEORLAKE(i915)) 2197 - mtl_whitelist_build(engine); 2319 + if (engine->gt->type == GT_MEDIA) 2320 + ; /* none yet */ 2321 + else if (IS_GFX_GT_IP_RANGE(engine->gt, IP_VER(12, 70), IP_VER(12, 71))) 2322 + xelpg_whitelist_build(engine); 2198 2323 else if (IS_PONTEVECCHIO(i915)) 2199 2324 pvc_whitelist_build(engine); 2200 2325 else if (IS_DG2(i915)) ··· 2294 2415 } 2295 2416 } 2296 2417 2297 - static bool needs_wa_1308578152(struct intel_engine_cs *engine) 2298 - { 2299 - return intel_sseu_find_first_xehp_dss(&engine->gt->info.sseu, 0, 0) >= 2300 - GEN_DSS_PER_GSLICE; 2301 - } 2302 - 2303 2418 static void 2304 2419 rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) 2305 2420 { 2306 2421 struct drm_i915_private *i915 = engine->i915; 2422 + struct intel_gt *gt = engine->gt; 2307 2423 2308 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2309 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) { 2424 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 2425 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) { 2310 2426 /* Wa_22014600077 */ 2311 2427 wa_mcr_masked_en(wal, GEN10_CACHE_MODE_SS, 2312 2428 ENABLE_EU_COUNT_FOR_TDL_FLUSH); 2313 2429 } 2314 2430 2315 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2316 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0) || 2317 - IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_FOREVER) || 2318 - IS_DG2_G11(i915) || IS_DG2_G12(i915)) { 2431 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 2432 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0) || 2433 + IS_DG2(i915)) { 2319 2434 /* Wa_1509727124 */ 2320 2435 wa_mcr_masked_en(wal, GEN10_SAMPLER_MODE, 2321 2436 SC_DISABLE_POWER_OPTIMIZATION_EBB); 2322 2437 } 2323 2438 2324 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_FOREVER) || 2325 - IS_DG2_G11(i915) || IS_DG2_G12(i915) || 2326 - IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0)) { 2439 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 2440 + IS_DG2(i915)) { 2327 2441 /* Wa_22012856258 */ 2328 2442 wa_mcr_masked_en(wal, GEN8_ROW_CHICKEN2, 2329 2443 GEN12_DISABLE_READ_SUPPRESSION); 2330 2444 } 2331 2445 2332 - if (IS_DG2_GRAPHICS_STEP(i915, G11, STEP_A0, STEP_B0)) { 2333 - /* Wa_14013392000:dg2_g11 */ 2334 - wa_mcr_masked_en(wal, GEN8_ROW_CHICKEN2, GEN12_ENABLE_LARGE_GRF_MODE); 2335 - } 2336 - 2337 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0) || 2338 - IS_DG2_GRAPHICS_STEP(i915, G11, STEP_A0, STEP_B0)) { 2339 - /* Wa_14012419201:dg2 */ 2340 - wa_mcr_masked_en(wal, GEN9_ROW_CHICKEN4, 2341 - GEN12_DISABLE_HDR_PAST_PAYLOAD_HOLD_FIX); 2342 - } 2343 - 2344 - /* Wa_1308578152:dg2_g10 when first gslice is fused off */ 2345 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_C0) && 2346 - needs_wa_1308578152(engine)) { 2347 - wa_masked_dis(wal, GEN12_CS_DEBUG_MODE1_CCCSUNIT_BE_COMMON, 2348 - GEN12_REPLAY_MODE_GRANULARITY); 2349 - } 2350 - 2351 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_FOREVER) || 2352 - IS_DG2_G11(i915) || IS_DG2_G12(i915)) { 2446 + if (IS_DG2(i915)) { 2353 2447 /* 2354 2448 * Wa_22010960976:dg2 2355 2449 * Wa_14013347512:dg2 ··· 2331 2479 LSC_L1_FLUSH_CTL_3D_DATAPORT_FLUSH_EVENTS_MASK); 2332 2480 } 2333 2481 2334 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0)) { 2335 - /* 2336 - * Wa_1608949956:dg2_g10 2337 - * Wa_14010198302:dg2_g10 2338 - */ 2339 - wa_mcr_masked_en(wal, GEN8_ROW_CHICKEN, 2340 - MDQ_ARBITRATION_MODE | UGM_BACKUP_MODE); 2482 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) || 2483 + IS_DG2(i915)) { 2484 + /* Wa_14015150844 */ 2485 + wa_mcr_add(wal, XEHP_HDC_CHICKEN0, 0, 2486 + _MASKED_BIT_ENABLE(DIS_ATOMIC_CHAINING_TYPED_WRITES), 2487 + 0, true); 2341 2488 } 2342 2489 2343 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0)) 2344 - /* Wa_22010430635:dg2 */ 2345 - wa_mcr_masked_en(wal, 2346 - GEN9_ROW_CHICKEN4, 2347 - GEN12_DISABLE_GRF_CLEAR); 2348 - 2349 - /* Wa_14013202645:dg2 */ 2350 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_C0) || 2351 - IS_DG2_GRAPHICS_STEP(i915, G11, STEP_A0, STEP_B0)) 2352 - wa_mcr_write_or(wal, RT_CTRL, DIS_NULL_QUERY); 2353 - 2354 - /* Wa_22012532006:dg2 */ 2355 - if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_A0, STEP_C0) || 2356 - IS_DG2_GRAPHICS_STEP(engine->i915, G11, STEP_A0, STEP_B0)) 2357 - wa_mcr_masked_en(wal, GEN9_HALF_SLICE_CHICKEN7, 2358 - DG2_DISABLE_ROUND_ENABLE_ALLOW_FOR_SSLA); 2359 - 2360 - if (IS_DG2_GRAPHICS_STEP(i915, G11, STEP_B0, STEP_FOREVER) || 2361 - IS_DG2_G10(i915)) { 2490 + if (IS_DG2_G11(i915) || IS_DG2_G10(i915)) { 2362 2491 /* Wa_22014600077:dg2 */ 2363 2492 wa_mcr_add(wal, GEN10_CACHE_MODE_SS, 0, 2364 2493 _MASKED_BIT_ENABLE(ENABLE_EU_COUNT_FOR_TDL_FLUSH), 2365 2494 0 /* Wa_14012342262 write-only reg, so skip verification */, 2366 2495 true); 2496 + } 2497 + 2498 + if (IS_DG2(i915) || IS_ALDERLAKE_P(i915) || IS_ALDERLAKE_S(i915) || 2499 + IS_DG1(i915) || IS_ROCKETLAKE(i915) || IS_TIGERLAKE(i915)) { 2500 + /* 2501 + * Wa_1606700617:tgl,dg1,adl-p 2502 + * Wa_22010271021:tgl,rkl,dg1,adl-s,adl-p 2503 + * Wa_14010826681:tgl,dg1,rkl,adl-p 2504 + * Wa_18019627453:dg2 2505 + */ 2506 + wa_masked_en(wal, 2507 + GEN9_CS_DEBUG_MODE1, 2508 + FF_DOP_CLOCK_GATE_DISABLE); 2367 2509 } 2368 2510 2369 2511 if (IS_ALDERLAKE_P(i915) || IS_ALDERLAKE_S(i915) || IS_DG1(i915) || ··· 2373 2527 */ 2374 2528 wa_write_or(wal, GEN7_FF_THREAD_MODE, 2375 2529 GEN12_FF_TESSELATION_DOP_GATE_DISABLE); 2376 - } 2377 2530 2378 - if (IS_ALDERLAKE_P(i915) || IS_DG2(i915) || IS_ALDERLAKE_S(i915) || 2379 - IS_DG1(i915) || IS_ROCKETLAKE(i915) || IS_TIGERLAKE(i915)) { 2380 - /* 2381 - * Wa_1606700617:tgl,dg1,adl-p 2382 - * Wa_22010271021:tgl,rkl,dg1,adl-s,adl-p 2383 - * Wa_14010826681:tgl,dg1,rkl,adl-p 2384 - * Wa_18019627453:dg2 2385 - */ 2386 - wa_masked_en(wal, 2387 - GEN9_CS_DEBUG_MODE1, 2388 - FF_DOP_CLOCK_GATE_DISABLE); 2531 + /* Wa_1406941453:tgl,rkl,dg1,adl-s,adl-p */ 2532 + wa_mcr_masked_en(wal, 2533 + GEN10_SAMPLER_MODE, 2534 + ENABLE_SMALLPL); 2389 2535 } 2390 2536 2391 2537 if (IS_ALDERLAKE_P(i915) || IS_ALDERLAKE_S(i915) || ··· 2402 2564 RING_PSMI_CTL(RENDER_RING_BASE), 2403 2565 GEN12_WAIT_FOR_EVENT_POWER_DOWN_DISABLE | 2404 2566 GEN8_RC_SEMA_IDLE_MSG_DISABLE); 2405 - } 2406 - 2407 - if (IS_DG1(i915) || IS_ROCKETLAKE(i915) || IS_TIGERLAKE(i915) || 2408 - IS_ALDERLAKE_S(i915) || IS_ALDERLAKE_P(i915)) { 2409 - /* Wa_1406941453:tgl,rkl,dg1,adl-s,adl-p */ 2410 - wa_mcr_masked_en(wal, 2411 - GEN10_SAMPLER_MODE, 2412 - ENABLE_SMALLPL); 2413 2567 } 2414 2568 2415 2569 if (GRAPHICS_VER(i915) == 11) { ··· 2805 2975 * function invoked by __intel_engine_init_ctx_wa(). 2806 2976 */ 2807 2977 static void 2808 - add_render_compute_tuning_settings(struct drm_i915_private *i915, 2978 + add_render_compute_tuning_settings(struct intel_gt *gt, 2809 2979 struct i915_wa_list *wal) 2810 2980 { 2811 - if (IS_METEORLAKE(i915) || IS_DG2(i915)) 2981 + struct drm_i915_private *i915 = gt->i915; 2982 + 2983 + if (IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71)) || IS_DG2(i915)) 2812 2984 wa_mcr_write_clr_set(wal, RT_CTRL, STACKID_CTRL, STACKID_CTRL_512); 2813 2985 2814 2986 /* ··· 2839 3007 general_render_compute_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) 2840 3008 { 2841 3009 struct drm_i915_private *i915 = engine->i915; 3010 + struct intel_gt *gt = engine->gt; 2842 3011 2843 - add_render_compute_tuning_settings(i915, wal); 3012 + add_render_compute_tuning_settings(gt, wal); 2844 3013 2845 3014 if (GRAPHICS_VER(i915) >= 11) { 2846 3015 /* This is not a Wa (although referred to as ··· 2862 3029 GEN11_INDIRECT_STATE_BASE_ADDR_OVERRIDE); 2863 3030 } 2864 3031 2865 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_B0, STEP_FOREVER) || 2866 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_B0, STEP_FOREVER)) 3032 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_B0, STEP_FOREVER) || 3033 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_B0, STEP_FOREVER)) 2867 3034 /* Wa_14017856879 */ 2868 3035 wa_mcr_masked_en(wal, GEN9_ROW_CHICKEN3, MTL_DISABLE_FIX_FOR_EOT_FLUSH); 2869 3036 2870 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2871 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) 3037 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 3038 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) 2872 3039 /* 2873 3040 * Wa_14017066071 2874 3041 * Wa_14017654203 ··· 2876 3043 wa_mcr_masked_en(wal, GEN10_SAMPLER_MODE, 2877 3044 MTL_DISABLE_SAMPLER_SC_OOO); 2878 3045 2879 - if (IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0)) 3046 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0)) 2880 3047 /* Wa_22015279794 */ 2881 3048 wa_mcr_masked_en(wal, GEN10_CACHE_MODE_SS, 2882 3049 DISABLE_PREFETCH_INTO_IC); 2883 3050 2884 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2885 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0) || 2886 - IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_FOREVER) || 2887 - IS_DG2_G11(i915) || IS_DG2_G12(i915)) { 3051 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 3052 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0) || 3053 + IS_DG2(i915)) { 2888 3054 /* Wa_22013037850 */ 2889 3055 wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0_UDW, 2890 3056 DISABLE_128B_EVICTION_COMMAND_UDW); 3057 + 3058 + /* Wa_18017747507 */ 3059 + wa_masked_en(wal, VFG_PREEMPTION_CHICKEN, POLYGON_TRIFAN_LINELOOP_DISABLE); 2891 3060 } 2892 3061 2893 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2894 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0) || 3062 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 3063 + IS_GFX_GT_IP_STEP(gt, IP_VER(12, 71), STEP_A0, STEP_B0) || 2895 3064 IS_PONTEVECCHIO(i915) || 2896 3065 IS_DG2(i915)) { 2897 3066 /* Wa_22014226127 */ 2898 3067 wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0, DISABLE_D8_D16_COASLESCE); 2899 3068 } 2900 3069 2901 - if (IS_MTL_GRAPHICS_STEP(i915, M, STEP_A0, STEP_B0) || 2902 - IS_MTL_GRAPHICS_STEP(i915, P, STEP_A0, STEP_B0) || 2903 - IS_DG2(i915)) { 2904 - /* Wa_18017747507 */ 2905 - wa_masked_en(wal, VFG_PREEMPTION_CHICKEN, POLYGON_TRIFAN_LINELOOP_DISABLE); 3070 + if (IS_PONTEVECCHIO(i915) || IS_DG2(i915)) { 3071 + /* Wa_14015227452:dg2,pvc */ 3072 + wa_mcr_masked_en(wal, GEN9_ROW_CHICKEN4, XEHP_DIS_BBL_SYSPIPE); 3073 + 3074 + /* Wa_16015675438:dg2,pvc */ 3075 + wa_masked_en(wal, FF_SLICE_CS_CHICKEN2, GEN12_PERF_FIX_BALANCING_CFE_DISABLE); 2906 3076 } 2907 3077 2908 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_B0, STEP_C0) || 2909 - IS_DG2_G11(i915)) { 3078 + if (IS_DG2(i915)) { 3079 + /* 3080 + * Wa_16011620976:dg2_g11 3081 + * Wa_22015475538:dg2 3082 + */ 3083 + wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0_UDW, DIS_CHAIN_2XSIMD8); 3084 + } 3085 + 3086 + if (IS_DG2_G11(i915)) { 2910 3087 /* 2911 3088 * Wa_22012826095:dg2 2912 3089 * Wa_22013059131:dg2 ··· 2928 3085 /* Wa_22013059131:dg2 */ 2929 3086 wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0, 2930 3087 FORCE_1_SUB_MESSAGE_PER_FRAGMENT); 3088 + 3089 + /* 3090 + * Wa_22012654132 3091 + * 3092 + * Note that register 0xE420 is write-only and cannot be read 3093 + * back for verification on DG2 (due to Wa_14012342262), so 3094 + * we need to explicitly skip the readback. 3095 + */ 3096 + wa_mcr_add(wal, GEN10_CACHE_MODE_SS, 0, 3097 + _MASKED_BIT_ENABLE(ENABLE_PREFETCH_INTO_IC), 3098 + 0 /* write-only, so skip validation */, 3099 + true); 2931 3100 } 2932 3101 2933 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0)) { 2934 - /* 2935 - * Wa_14010918519:dg2_g10 2936 - * 2937 - * LSC_CHICKEN_BIT_0 always reads back as 0 is this stepping, 2938 - * so ignoring verification. 2939 - */ 2940 - wa_mcr_add(wal, LSC_CHICKEN_BIT_0_UDW, 0, 2941 - FORCE_SLM_FENCE_SCOPE_TO_TILE | FORCE_UGM_FENCE_SCOPE_TO_TILE, 2942 - 0, false); 3102 + if (IS_DG2_G10(i915) || IS_DG2_G12(i915)) { 3103 + /* Wa_18028616096 */ 3104 + wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0_UDW, UGM_FRAGMENT_THRESHOLD_TO_3); 2943 3105 } 2944 3106 2945 3107 if (IS_XEHPSDV(i915)) { ··· 2962 3114 wa_mcr_masked_en(wal, GEN8_HALF_SLICE_CHICKEN1, 2963 3115 GEN7_PSD_SINGLE_PORT_DISPATCH_ENABLE); 2964 3116 } 2965 - 2966 - if (IS_DG2(i915) || IS_PONTEVECCHIO(i915)) { 2967 - /* Wa_14015227452:dg2,pvc */ 2968 - wa_mcr_masked_en(wal, GEN9_ROW_CHICKEN4, XEHP_DIS_BBL_SYSPIPE); 2969 - 2970 - /* Wa_16015675438:dg2,pvc */ 2971 - wa_masked_en(wal, FF_SLICE_CS_CHICKEN2, GEN12_PERF_FIX_BALANCING_CFE_DISABLE); 2972 - } 2973 - 2974 - if (IS_DG2(i915)) { 2975 - /* 2976 - * Wa_16011620976:dg2_g11 2977 - * Wa_22015475538:dg2 2978 - */ 2979 - wa_mcr_write_or(wal, LSC_CHICKEN_BIT_0_UDW, DIS_CHAIN_2XSIMD8); 2980 - } 2981 - 2982 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_C0) || IS_DG2_G11(i915)) 2983 - /* 2984 - * Wa_22012654132 2985 - * 2986 - * Note that register 0xE420 is write-only and cannot be read 2987 - * back for verification on DG2 (due to Wa_14012342262), so 2988 - * we need to explicitly skip the readback. 2989 - */ 2990 - wa_mcr_add(wal, GEN10_CACHE_MODE_SS, 0, 2991 - _MASKED_BIT_ENABLE(ENABLE_PREFETCH_INTO_IC), 2992 - 0 /* write-only, so skip validation */, 2993 - true); 2994 3117 } 2995 3118 2996 3119 static void
+1 -1
drivers/gpu/drm/i915/gt/selftest_migrate.c
··· 710 710 thread[i].tsk = tsk; 711 711 } 712 712 713 - msleep(10); /* start all threads before we kthread_stop() */ 713 + msleep(10 * n_cpus); /* start all threads before we kthread_stop() */ 714 714 715 715 for (i = 0; i < n_cpus; ++i) { 716 716 struct task_struct *tsk = thread[i].tsk;
+18 -2
drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c
··· 81 81 82 82 i915_request_add(rq); 83 83 84 - if (!err && i915_request_wait(rq, 0, msecs_to_jiffies(500)) < 0) 85 - err = -ETIME; 84 + if (!err) { 85 + /* 86 + * Start timeout for i915_request_wait only after considering one possible 87 + * pending GSC-HECI submission cycle on the other (non-privileged) path. 88 + */ 89 + if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS)) 90 + drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm, 91 + "Delay in gsc-heci-priv submission to gsccs-hw"); 92 + if (i915_request_wait(rq, 0, msecs_to_jiffies(GSC_HECI_REPLY_LATENCY_MS)) < 0) 93 + err = -ETIME; 94 + } 86 95 87 96 i915_request_put(rq); 88 97 ··· 195 186 i915_request_add(rq); 196 187 197 188 if (!err) { 189 + /* 190 + * Start timeout for i915_request_wait only after considering one possible 191 + * pending GSC-HECI submission cycle on the other (privileged) path. 192 + */ 193 + if (wait_for(i915_request_started(rq), GSC_HECI_REPLY_LATENCY_MS)) 194 + drm_dbg(&gsc_uc_to_gt(gsc)->i915->drm, 195 + "Delay in gsc-heci-non-priv submission to gsccs-hw"); 198 196 if (i915_request_wait(rq, I915_WAIT_INTERRUPTIBLE, 199 197 msecs_to_jiffies(timeout_ms)) < 0) 200 198 err = -ETIME;
+6
drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h
··· 12 12 struct intel_context; 13 13 struct intel_gsc_uc; 14 14 15 + #define GSC_HECI_REPLY_LATENCY_MS 500 16 + /* 17 + * Max FW response time is 500ms, but this should be counted from the time the 18 + * command has hit the GSC-CS hardware, not the preceding handoff to GuC CTB. 19 + */ 20 + 15 21 struct intel_gsc_mtl_header { 16 22 u32 validity_marker; 17 23 #define GSC_HECI_VALIDITY_MARKER 0xA578875A
+45 -19
drivers/gpu/drm/i915/gt/uc/intel_guc.c
··· 159 159 gen11_reset_guc_interrupts(guc); 160 160 } 161 161 162 + static void guc_dead_worker_func(struct work_struct *w) 163 + { 164 + struct intel_guc *guc = container_of(w, struct intel_guc, dead_guc_worker); 165 + struct intel_gt *gt = guc_to_gt(guc); 166 + unsigned long last = guc->last_dead_guc_jiffies; 167 + unsigned long delta = jiffies_to_msecs(jiffies - last); 168 + 169 + if (delta < 500) { 170 + intel_gt_set_wedged(gt); 171 + } else { 172 + intel_gt_handle_error(gt, ALL_ENGINES, I915_ERROR_CAPTURE, "dead GuC"); 173 + guc->last_dead_guc_jiffies = jiffies; 174 + } 175 + } 176 + 162 177 void intel_guc_init_early(struct intel_guc *guc) 163 178 { 164 179 struct intel_gt *gt = guc_to_gt(guc); ··· 185 170 intel_guc_submission_init_early(guc); 186 171 intel_guc_slpc_init_early(&guc->slpc); 187 172 intel_guc_rc_init_early(guc); 173 + 174 + INIT_WORK(&guc->dead_guc_worker, guc_dead_worker_func); 188 175 189 176 mutex_init(&guc->send_mutex); 190 177 spin_lock_init(&guc->irq_lock); ··· 289 272 GRAPHICS_VER_FULL(gt->i915) < IP_VER(12, 50)) 290 273 flags |= GUC_WA_POLLCS; 291 274 292 - /* Wa_16011759253:dg2_g10:a0 */ 293 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_B0)) 294 - flags |= GUC_WA_GAM_CREDITS; 295 - 296 275 /* Wa_14014475959 */ 297 - if (IS_MTL_GRAPHICS_STEP(gt->i915, M, STEP_A0, STEP_B0) || 276 + if (IS_GFX_GT_IP_STEP(gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 298 277 IS_DG2(gt->i915)) 299 278 flags |= GUC_WA_HOLD_CCS_SWITCHOUT; 300 279 301 280 /* 302 - * Wa_14012197797:dg2_g10:a0,dg2_g11:a0 303 - * Wa_22011391025:dg2_g10,dg2_g11,dg2_g12 281 + * Wa_14012197797 282 + * Wa_22011391025 304 283 * 305 284 * The same WA bit is used for both and 22011391025 is applicable to 306 285 * all DG2. ··· 305 292 flags |= GUC_WA_DUAL_QUEUE; 306 293 307 294 /* Wa_22011802037: graphics version 11/12 */ 308 - if (IS_MTL_GRAPHICS_STEP(gt->i915, M, STEP_A0, STEP_B0) || 309 - (GRAPHICS_VER(gt->i915) >= 11 && 310 - GRAPHICS_VER_FULL(gt->i915) < IP_VER(12, 70))) 295 + if (intel_engine_reset_needs_wa_22011802037(gt)) 311 296 flags |= GUC_WA_PRE_PARSER; 312 297 313 - /* Wa_16011777198:dg2 */ 314 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_C0) || 315 - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_B0)) 316 - flags |= GUC_WA_RCS_RESET_BEFORE_RC6; 317 - 318 298 /* 319 - * Wa_22012727170:dg2_g10[a0-c0), dg2_g11[a0..) 320 - * Wa_22012727685:dg2_g11[a0..) 299 + * Wa_22012727170 300 + * Wa_22012727685 321 301 */ 322 - if (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_C0) || 323 - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_FOREVER)) 302 + if (IS_DG2_G11(gt->i915)) 324 303 flags |= GUC_WA_CONTEXT_ISOLATION; 325 304 326 305 /* Wa_16015675438 */ ··· 466 461 if (!intel_uc_fw_is_loadable(&guc->fw)) 467 462 return; 468 463 464 + flush_work(&guc->dead_guc_worker); 465 + 469 466 if (intel_guc_slpc_is_used(guc)) 470 467 intel_guc_slpc_fini(&guc->slpc); 471 468 ··· 592 585 return ret; 593 586 } 594 587 588 + int intel_guc_crash_process_msg(struct intel_guc *guc, u32 action) 589 + { 590 + if (action == INTEL_GUC_ACTION_NOTIFY_CRASH_DUMP_POSTED) 591 + guc_err(guc, "Crash dump notification\n"); 592 + else if (action == INTEL_GUC_ACTION_NOTIFY_EXCEPTION) 593 + guc_err(guc, "Exception notification\n"); 594 + else 595 + guc_err(guc, "Unknown crash notification: 0x%04X\n", action); 596 + 597 + queue_work(system_unbound_wq, &guc->dead_guc_worker); 598 + 599 + return 0; 600 + } 601 + 595 602 int intel_guc_to_host_process_recv_msg(struct intel_guc *guc, 596 603 const u32 *payload, u32 len) 597 604 { ··· 621 600 guc_err(guc, "Received early crash dump notification!\n"); 622 601 if (msg & INTEL_GUC_RECV_MSG_EXCEPTION) 623 602 guc_err(guc, "Received early exception notification!\n"); 603 + 604 + if (msg & (INTEL_GUC_RECV_MSG_CRASH_DUMP_POSTED | INTEL_GUC_RECV_MSG_EXCEPTION)) 605 + queue_work(system_unbound_wq, &guc->dead_guc_worker); 624 606 625 607 return 0; 626 608 } ··· 664 640 return 0; 665 641 666 642 if (intel_guc_submission_is_used(guc)) { 643 + flush_work(&guc->dead_guc_worker); 644 + 667 645 /* 668 646 * This H2G MMIO command tears down the GuC in two steps. First it will 669 647 * generate a G2H CTB for every active context indicating a reset. In
+15
drivers/gpu/drm/i915/gt/uc/intel_guc.h
··· 266 266 unsigned long last_stat_jiffies; 267 267 } timestamp; 268 268 269 + /** 270 + * @dead_guc_worker: Asynchronous worker thread for forcing a GuC reset. 271 + * Specifically used when the G2H handler wants to issue a reset. Resets 272 + * require flushing the G2H queue. So, the G2H processing itself must not 273 + * trigger a reset directly. Instead, go via this worker. 274 + */ 275 + struct work_struct dead_guc_worker; 276 + /** 277 + * @last_dead_guc_jiffies: timestamp of previous 'dead guc' occurrance 278 + * used to prevent a fundamentally broken system from continuously 279 + * reloading the GuC. 280 + */ 281 + unsigned long last_dead_guc_jiffies; 282 + 269 283 #ifdef CONFIG_DRM_I915_SELFTEST 270 284 /** 271 285 * @number_guc_id_stolen: The number of guc_ids that have been stolen ··· 490 476 const u32 *msg, u32 len); 491 477 int intel_guc_error_capture_process_msg(struct intel_guc *guc, 492 478 const u32 *msg, u32 len); 479 + int intel_guc_crash_process_msg(struct intel_guc *guc, u32 action); 493 480 494 481 struct intel_engine_cs * 495 482 intel_guc_lookup_engine(struct intel_guc *guc, u8 guc_class, u8 instance);
+1 -5
drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
··· 1112 1112 ret = 0; 1113 1113 break; 1114 1114 case INTEL_GUC_ACTION_NOTIFY_CRASH_DUMP_POSTED: 1115 - CT_ERROR(ct, "Received GuC crash dump notification!\n"); 1116 - ret = 0; 1117 - break; 1118 1115 case INTEL_GUC_ACTION_NOTIFY_EXCEPTION: 1119 - CT_ERROR(ct, "Received GuC exception notification!\n"); 1120 - ret = 0; 1116 + ret = intel_guc_crash_process_msg(guc, action); 1121 1117 break; 1122 1118 default: 1123 1119 ret = -EOPNOTSUPP;
-63
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.c
··· 138 138 return ret > 0 ? -EPROTO : ret; 139 139 } 140 140 141 - static int guc_action_slpc_unset_param(struct intel_guc *guc, u8 id) 142 - { 143 - u32 request[] = { 144 - GUC_ACTION_HOST2GUC_PC_SLPC_REQUEST, 145 - SLPC_EVENT(SLPC_EVENT_PARAMETER_UNSET, 1), 146 - id, 147 - }; 148 - 149 - return intel_guc_send(guc, request, ARRAY_SIZE(request)); 150 - } 151 - 152 141 static bool slpc_is_running(struct intel_guc_slpc *slpc) 153 142 { 154 143 return slpc_get_state(slpc) == SLPC_GLOBAL_STATE_RUNNING; ··· 186 197 id, value, ERR_PTR(ret)); 187 198 188 199 return ret; 189 - } 190 - 191 - static int slpc_unset_param(struct intel_guc_slpc *slpc, u8 id) 192 - { 193 - struct intel_guc *guc = slpc_to_guc(slpc); 194 - 195 - GEM_BUG_ON(id >= SLPC_MAX_PARAM); 196 - 197 - return guc_action_slpc_unset_param(guc, id); 198 200 } 199 201 200 202 static int slpc_force_min_freq(struct intel_guc_slpc *slpc, u32 freq) ··· 650 670 651 671 if (!slpc->boost_freq) 652 672 slpc->boost_freq = slpc->rp0_freq; 653 - } 654 - 655 - /** 656 - * intel_guc_slpc_override_gucrc_mode() - override GUCRC mode 657 - * @slpc: pointer to intel_guc_slpc. 658 - * @mode: new value of the mode. 659 - * 660 - * This function will override the GUCRC mode. 661 - * 662 - * Return: 0 on success, non-zero error code on failure. 663 - */ 664 - int intel_guc_slpc_override_gucrc_mode(struct intel_guc_slpc *slpc, u32 mode) 665 - { 666 - int ret; 667 - struct drm_i915_private *i915 = slpc_to_i915(slpc); 668 - intel_wakeref_t wakeref; 669 - 670 - if (mode >= SLPC_GUCRC_MODE_MAX) 671 - return -EINVAL; 672 - 673 - with_intel_runtime_pm(&i915->runtime_pm, wakeref) { 674 - ret = slpc_set_param(slpc, SLPC_PARAM_PWRGATE_RC_MODE, mode); 675 - if (ret) 676 - guc_err(slpc_to_guc(slpc), "Override RC mode %d failed: %pe\n", 677 - mode, ERR_PTR(ret)); 678 - } 679 - 680 - return ret; 681 - } 682 - 683 - int intel_guc_slpc_unset_gucrc_mode(struct intel_guc_slpc *slpc) 684 - { 685 - struct drm_i915_private *i915 = slpc_to_i915(slpc); 686 - intel_wakeref_t wakeref; 687 - int ret = 0; 688 - 689 - with_intel_runtime_pm(&i915->runtime_pm, wakeref) { 690 - ret = slpc_unset_param(slpc, SLPC_PARAM_PWRGATE_RC_MODE); 691 - if (ret) 692 - guc_err(slpc_to_guc(slpc), "Unsetting RC mode failed: %pe\n", ERR_PTR(ret)); 693 - } 694 - 695 - return ret; 696 673 } 697 674 698 675 /*
-2
drivers/gpu/drm/i915/gt/uc/intel_guc_slpc.h
··· 44 44 void intel_guc_pm_intrmsk_enable(struct intel_gt *gt); 45 45 void intel_guc_slpc_boost(struct intel_guc_slpc *slpc); 46 46 void intel_guc_slpc_dec_waiters(struct intel_guc_slpc *slpc); 47 - int intel_guc_slpc_unset_gucrc_mode(struct intel_guc_slpc *slpc); 48 - int intel_guc_slpc_override_gucrc_mode(struct intel_guc_slpc *slpc, u32 mode); 49 47 int intel_guc_slpc_set_ignore_eff_freq(struct intel_guc_slpc *slpc, bool val); 50 48 51 49 #endif
+37 -7
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
··· 1433 1433 int srcu, ret; 1434 1434 1435 1435 /* 1436 + * Ideally the busyness worker should take a gt pm wakeref because the 1437 + * worker only needs to be active while gt is awake. However, the 1438 + * gt_park path cancels the worker synchronously and this complicates 1439 + * the flow if the worker is also running at the same time. The cancel 1440 + * waits for the worker and when the worker releases the wakeref, that 1441 + * would call gt_park and would lead to a deadlock. 1442 + * 1443 + * The resolution is to take the global pm wakeref if runtime pm is 1444 + * already active. If not, we don't need to update the busyness stats as 1445 + * the stats would already be updated when the gt was parked. 1446 + * 1447 + * Note: 1448 + * - We do not requeue the worker if we cannot take a reference to runtime 1449 + * pm since intel_guc_busyness_unpark would requeue the worker in the 1450 + * resume path. 1451 + * 1452 + * - If the gt was parked longer than time taken for GT timestamp to roll 1453 + * over, we ignore those rollovers since we don't care about tracking 1454 + * the exact GT time. We only care about roll overs when the gt is 1455 + * active and running workloads. 1456 + * 1457 + * - There is a window of time between gt_park and runtime suspend, 1458 + * where the worker may run. This is acceptable since the worker will 1459 + * not find any new data to update busyness. 1460 + */ 1461 + wakeref = intel_runtime_pm_get_if_active(&gt->i915->runtime_pm); 1462 + if (!wakeref) 1463 + return; 1464 + 1465 + /* 1436 1466 * Synchronize with gt reset to make sure the worker does not 1437 1467 * corrupt the engine/guc stats. NB: can't actually block waiting 1438 1468 * for a reset to complete as the reset requires flushing out ··· 1470 1440 */ 1471 1441 ret = intel_gt_reset_trylock(gt, &srcu); 1472 1442 if (ret) 1473 - return; 1443 + goto err_trylock; 1474 1444 1475 - with_intel_runtime_pm(&gt->i915->runtime_pm, wakeref) 1476 - __update_guc_busyness_stats(guc); 1445 + __update_guc_busyness_stats(guc); 1477 1446 1478 1447 /* adjust context stats for overflow */ 1479 1448 xa_for_each(&guc->context_lookup, index, ce) ··· 1481 1452 intel_gt_reset_unlock(gt, srcu); 1482 1453 1483 1454 guc_enable_busyness_worker(guc); 1455 + 1456 + err_trylock: 1457 + intel_runtime_pm_put(&gt->i915->runtime_pm, wakeref); 1484 1458 } 1485 1459 1486 1460 static int guc_action_enable_usage_stats(struct intel_guc *guc) ··· 1690 1658 * Wa_22011802037: In addition to stopping the cs, we need 1691 1659 * to wait for any pending mi force wakeups 1692 1660 */ 1693 - if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) || 1694 - (GRAPHICS_VER(engine->i915) >= 11 && 1695 - GRAPHICS_VER_FULL(engine->i915) < IP_VER(12, 70))) { 1661 + if (intel_engine_reset_needs_wa_22011802037(engine->gt)) { 1696 1662 intel_engine_stop_cs(engine); 1697 1663 intel_engine_wait_for_pending_mi_fw(engine); 1698 1664 } ··· 4297 4267 4298 4268 /* Wa_14014475959:dg2 */ 4299 4269 if (engine->class == COMPUTE_CLASS) 4300 - if (IS_MTL_GRAPHICS_STEP(engine->i915, M, STEP_A0, STEP_B0) || 4270 + if (IS_GFX_GT_IP_STEP(engine->gt, IP_VER(12, 70), STEP_A0, STEP_B0) || 4301 4271 IS_DG2(engine->i915)) 4302 4272 engine->flags |= I915_ENGINE_USES_WA_HOLD_CCS_SWITCHOUT; 4303 4273
+24 -8
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c
··· 132 132 fw_def(SKYLAKE, 0, huc_mmp(skl, 2, 0, 0)) 133 133 134 134 /* 135 + * The GSC FW has multiple version (see intel_gsc_uc.h for details); since what 136 + * we care about is the interface, we use the compatibility version in the 137 + * binary names. 138 + * Same as with the GuC, a major version bump indicate a 139 + * backward-incompatible change, while a minor version bump indicates a 140 + * backward-compatible one, so we use only the former in the file name. 141 + */ 142 + #define INTEL_GSC_FIRMWARE_DEFS(fw_def, gsc_def) \ 143 + fw_def(METEORLAKE, 0, gsc_def(mtl, 1, 0)) 144 + 145 + /* 135 146 * Set of macros for producing a list of filenames from the above table. 136 147 */ 137 148 #define __MAKE_UC_FW_PATH_BLANK(prefix_, name_) \ ··· 177 166 #define MAKE_HUC_FW_PATH_MMP(prefix_, major_, minor_, patch_) \ 178 167 __MAKE_UC_FW_PATH_MMP(prefix_, "huc", major_, minor_, patch_) 179 168 169 + #define MAKE_GSC_FW_PATH(prefix_, major_, minor_) \ 170 + __MAKE_UC_FW_PATH_MAJOR(prefix_, "gsc", major_) 171 + 180 172 /* 181 173 * All blobs need to be declared via MODULE_FIRMWARE(). 182 174 * This first expansion of the table macros is solely to provide ··· 190 176 191 177 INTEL_GUC_FIRMWARE_DEFS(INTEL_UC_MODULE_FW, MAKE_GUC_FW_PATH_MAJOR, MAKE_GUC_FW_PATH_MMP) 192 178 INTEL_HUC_FIRMWARE_DEFS(INTEL_UC_MODULE_FW, MAKE_HUC_FW_PATH_BLANK, MAKE_HUC_FW_PATH_MMP, MAKE_HUC_FW_PATH_GSC) 179 + INTEL_GSC_FIRMWARE_DEFS(INTEL_UC_MODULE_FW, MAKE_GSC_FW_PATH) 193 180 194 181 /* 195 182 * The next expansion of the table macros (in __uc_fw_auto_select below) provides ··· 240 225 #define HUC_FW_BLOB_GSC(prefix_) \ 241 226 UC_FW_BLOB_NEW(0, 0, 0, true, MAKE_HUC_FW_PATH_GSC(prefix_)) 242 227 228 + #define GSC_FW_BLOB(prefix_, major_, minor_) \ 229 + UC_FW_BLOB_NEW(major_, minor_, 0, true, \ 230 + MAKE_GSC_FW_PATH(prefix_, major_, minor_)) 231 + 243 232 struct __packed uc_fw_platform_requirement { 244 233 enum intel_platform p; 245 234 u8 rev; /* first platform rev using this FW */ ··· 270 251 INTEL_HUC_FIRMWARE_DEFS(MAKE_FW_LIST, HUC_FW_BLOB, HUC_FW_BLOB_MMP, HUC_FW_BLOB_GSC) 271 252 }; 272 253 254 + static const struct uc_fw_platform_requirement blobs_gsc[] = { 255 + INTEL_GSC_FIRMWARE_DEFS(MAKE_FW_LIST, GSC_FW_BLOB) 256 + }; 257 + 273 258 static const struct fw_blobs_by_type blobs_all[INTEL_UC_FW_NUM_TYPES] = { 274 259 [INTEL_UC_FW_TYPE_GUC] = { blobs_guc, ARRAY_SIZE(blobs_guc) }, 275 260 [INTEL_UC_FW_TYPE_HUC] = { blobs_huc, ARRAY_SIZE(blobs_huc) }, 261 + [INTEL_UC_FW_TYPE_GSC] = { blobs_gsc, ARRAY_SIZE(blobs_gsc) }, 276 262 }; 277 263 278 264 static void ··· 289 265 u8 rev = INTEL_REVID(i915); 290 266 int i; 291 267 bool found; 292 - 293 - /* 294 - * GSC FW support is still not fully in place, so we're not defining 295 - * the FW blob yet because we don't want the driver to attempt to load 296 - * it until we're ready for it. 297 - */ 298 - if (uc_fw->type == INTEL_UC_FW_TYPE_GSC) 299 - return; 300 268 301 269 /* 302 270 * The only difference between the ADL GuC FWs is the HWConfig support.
+8 -4
drivers/gpu/drm/i915/i915_debugfs.c
··· 144 144 { 145 145 struct drm_i915_private *i915 = obj_to_i915(obj); 146 146 147 - if (IS_METEORLAKE(i915)) { 147 + if (IS_GFX_GT_IP_RANGE(to_gt(i915), IP_VER(12, 70), IP_VER(12, 71))) { 148 148 switch (obj->pat_index) { 149 149 case 0: return " WB"; 150 150 case 1: return " WT"; ··· 740 740 i915_drop_caches_set(void *data, u64 val) 741 741 { 742 742 struct drm_i915_private *i915 = data; 743 + struct intel_gt *gt; 743 744 unsigned int flags; 745 + unsigned int i; 744 746 int ret; 745 747 746 748 drm_dbg(&i915->drm, "Dropping caches: 0x%08llx [0x%08llx]\n", 747 749 val, val & DROP_ALL); 748 750 749 - ret = gt_drop_caches(to_gt(i915), val); 750 - if (ret) 751 - return ret; 751 + for_each_gt(gt, i915, i) { 752 + ret = gt_drop_caches(gt, val); 753 + if (ret) 754 + return ret; 755 + } 752 756 753 757 fs_reclaim_acquire(GFP_KERNEL); 754 758 flags = memalloc_noreclaim_save();
-31
drivers/gpu/drm/i915/i915_drv.h
··· 573 573 #define IS_PONTEVECCHIO(i915) IS_PLATFORM(i915, INTEL_PONTEVECCHIO) 574 574 #define IS_METEORLAKE(i915) IS_PLATFORM(i915, INTEL_METEORLAKE) 575 575 576 - #define IS_METEORLAKE_M(i915) \ 577 - IS_SUBPLATFORM(i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_M) 578 - #define IS_METEORLAKE_P(i915) \ 579 - IS_SUBPLATFORM(i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_P) 580 576 #define IS_DG2_G10(i915) \ 581 577 IS_SUBPLATFORM(i915, INTEL_DG2, INTEL_SUBPLATFORM_G10) 582 578 #define IS_DG2_G11(i915) \ ··· 654 658 #define IS_XEHPSDV_GRAPHICS_STEP(__i915, since, until) \ 655 659 (IS_XEHPSDV(__i915) && IS_GRAPHICS_STEP(__i915, since, until)) 656 660 657 - #define IS_MTL_GRAPHICS_STEP(__i915, variant, since, until) \ 658 - (IS_SUBPLATFORM(__i915, INTEL_METEORLAKE, INTEL_SUBPLATFORM_##variant) && \ 659 - IS_GRAPHICS_STEP(__i915, since, until)) 660 - 661 661 #define IS_MTL_DISPLAY_STEP(__i915, since, until) \ 662 662 (IS_METEORLAKE(__i915) && \ 663 663 IS_DISPLAY_STEP(__i915, since, until)) 664 - 665 - #define IS_MTL_MEDIA_STEP(__i915, since, until) \ 666 - (IS_METEORLAKE(__i915) && \ 667 - IS_MEDIA_STEP(__i915, since, until)) 668 - 669 - /* 670 - * DG2 hardware steppings are a bit unusual. The hardware design was forked to 671 - * create three variants (G10, G11, and G12) which each have distinct 672 - * workaround sets. The G11 and G12 forks of the DG2 design reset the GT 673 - * stepping back to "A0" for their first iterations, even though they're more 674 - * similar to a G10 B0 stepping and G10 C0 stepping respectively in terms of 675 - * functionality and workarounds. However the display stepping does not reset 676 - * in the same manner --- a specific stepping like "B0" has a consistent 677 - * meaning regardless of whether it belongs to a G10, G11, or G12 DG2. 678 - * 679 - * TLDR: All GT workarounds and stepping-specific logic must be applied in 680 - * relation to a specific subplatform (G10/G11/G12), whereas display workarounds 681 - * and stepping-specific logic will be applied with a general DG2-wide stepping 682 - * number. 683 - */ 684 - #define IS_DG2_GRAPHICS_STEP(__i915, variant, since, until) \ 685 - (IS_SUBPLATFORM(__i915, INTEL_DG2, INTEL_SUBPLATFORM_##variant) && \ 686 - IS_GRAPHICS_STEP(__i915, since, until)) 687 664 688 665 #define IS_DG2_DISPLAY_STEP(__i915, since, until) \ 689 666 (IS_DG2(__i915) && \
+22 -88
drivers/gpu/drm/i915/i915_perf.c
··· 543 543 { 544 544 u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); 545 545 int report_size = stream->oa_buffer.format->size; 546 - u32 head, tail, read_tail; 546 + u32 tail, hw_tail; 547 547 unsigned long flags; 548 548 bool pollin; 549 - u32 hw_tail; 550 549 u32 partial_report_size; 551 550 552 551 /* We have to consider the (unlikely) possibility that read() errors ··· 555 556 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); 556 557 557 558 hw_tail = stream->perf->ops.oa_hw_tail_read(stream); 559 + hw_tail -= gtt_offset; 558 560 559 561 /* The tail pointer increases in 64 byte increments, not in report_size 560 562 * steps. Also the report size may not be a power of 2. Compute ··· 566 566 567 567 /* Subtract partial amount off the tail */ 568 568 hw_tail = OA_TAKEN(hw_tail, partial_report_size); 569 - 570 - /* NB: The head we observe here might effectively be a little 571 - * out of date. If a read() is in progress, the head could be 572 - * anywhere between this head and stream->oa_buffer.tail. 573 - */ 574 - head = stream->oa_buffer.head - gtt_offset; 575 - read_tail = stream->oa_buffer.tail - gtt_offset; 576 569 577 570 tail = hw_tail; 578 571 ··· 580 587 * memory in the order they were written to. 581 588 * If not : (╯°□°)╯︵ ┻━┻ 582 589 */ 583 - while (OA_TAKEN(tail, read_tail) >= report_size) { 590 + while (OA_TAKEN(tail, stream->oa_buffer.tail) >= report_size) { 584 591 void *report = stream->oa_buffer.vaddr + tail; 585 592 586 593 if (oa_report_id(stream, report) || ··· 594 601 __ratelimit(&stream->perf->tail_pointer_race)) 595 602 drm_notice(&stream->uncore->i915->drm, 596 603 "unlanded report(s) head=0x%x tail=0x%x hw_tail=0x%x\n", 597 - head, tail, hw_tail); 604 + stream->oa_buffer.head, tail, hw_tail); 598 605 599 - stream->oa_buffer.tail = gtt_offset + tail; 606 + stream->oa_buffer.tail = tail; 600 607 601 608 pollin = OA_TAKEN(stream->oa_buffer.tail, 602 609 stream->oa_buffer.head) >= report_size; ··· 747 754 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); 748 755 749 756 /* 750 - * NB: oa_buffer.head/tail include the gtt_offset which we don't want 751 - * while indexing relative to oa_buf_base. 752 - */ 753 - head -= gtt_offset; 754 - tail -= gtt_offset; 755 - 756 - /* 757 757 * An out of bounds or misaligned head or tail pointer implies a driver 758 758 * bug since we validate + align the tail pointers we read from the 759 759 * hardware and we are in full control of the head pointer which should ··· 881 895 * We removed the gtt_offset for the copy loop above, indexing 882 896 * relative to oa_buf_base so put back here... 883 897 */ 884 - head += gtt_offset; 885 898 intel_uncore_write(uncore, oaheadptr, 886 - head & GEN12_OAG_OAHEADPTR_MASK); 899 + (head + gtt_offset) & GEN12_OAG_OAHEADPTR_MASK); 887 900 stream->oa_buffer.head = head; 888 901 889 902 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); ··· 1027 1042 1028 1043 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); 1029 1044 1030 - /* NB: oa_buffer.head/tail include the gtt_offset which we don't want 1031 - * while indexing relative to oa_buf_base. 1032 - */ 1033 - head -= gtt_offset; 1034 - tail -= gtt_offset; 1035 - 1036 1045 /* An out of bounds or misaligned head or tail pointer implies a driver 1037 1046 * bug since we validate + align the tail pointers we read from the 1038 1047 * hardware and we are in full control of the head pointer which should ··· 1089 1110 if (start_offset != *offset) { 1090 1111 spin_lock_irqsave(&stream->oa_buffer.ptr_lock, flags); 1091 1112 1092 - /* We removed the gtt_offset for the copy loop above, indexing 1093 - * relative to oa_buf_base so put back here... 1094 - */ 1095 - head += gtt_offset; 1096 - 1097 1113 intel_uncore_write(uncore, GEN7_OASTATUS2, 1098 - (head & GEN7_OASTATUS2_HEAD_MASK) | 1114 + ((head + gtt_offset) & GEN7_OASTATUS2_HEAD_MASK) | 1099 1115 GEN7_OASTATUS2_MEM_SELECT_GGTT); 1100 1116 stream->oa_buffer.head = head; 1101 1117 ··· 1649 1675 1650 1676 free_oa_buffer(stream); 1651 1677 1652 - /* 1653 - * Wa_16011777198:dg2: Unset the override of GUCRC mode to enable rc6. 1654 - */ 1655 - if (stream->override_gucrc) 1656 - drm_WARN_ON(&gt->i915->drm, 1657 - intel_guc_slpc_unset_gucrc_mode(&gt->uc.guc.slpc)); 1658 - 1659 1678 intel_uncore_forcewake_put(stream->uncore, FORCEWAKE_ALL); 1660 1679 intel_engine_pm_put(stream->engine); 1661 1680 ··· 1678 1711 */ 1679 1712 intel_uncore_write(uncore, GEN7_OASTATUS2, /* head */ 1680 1713 gtt_offset | GEN7_OASTATUS2_MEM_SELECT_GGTT); 1681 - stream->oa_buffer.head = gtt_offset; 1714 + stream->oa_buffer.head = 0; 1682 1715 1683 1716 intel_uncore_write(uncore, GEN7_OABUFFER, gtt_offset); 1684 1717 ··· 1686 1719 gtt_offset | OABUFFER_SIZE_16M); 1687 1720 1688 1721 /* Mark that we need updated tail pointers to read from... */ 1689 - stream->oa_buffer.tail = gtt_offset; 1722 + stream->oa_buffer.tail = 0; 1690 1723 1691 1724 spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); 1692 1725 ··· 1720 1753 1721 1754 intel_uncore_write(uncore, GEN8_OASTATUS, 0); 1722 1755 intel_uncore_write(uncore, GEN8_OAHEADPTR, gtt_offset); 1723 - stream->oa_buffer.head = gtt_offset; 1756 + stream->oa_buffer.head = 0; 1724 1757 1725 1758 intel_uncore_write(uncore, GEN8_OABUFFER_UDW, 0); 1726 1759 ··· 1737 1770 intel_uncore_write(uncore, GEN8_OATAILPTR, gtt_offset & GEN8_OATAILPTR_MASK); 1738 1771 1739 1772 /* Mark that we need updated tail pointers to read from... */ 1740 - stream->oa_buffer.tail = gtt_offset; 1773 + stream->oa_buffer.tail = 0; 1741 1774 1742 1775 /* 1743 1776 * Reset state used to recognise context switches, affecting which ··· 1774 1807 intel_uncore_write(uncore, __oa_regs(stream)->oa_status, 0); 1775 1808 intel_uncore_write(uncore, __oa_regs(stream)->oa_head_ptr, 1776 1809 gtt_offset & GEN12_OAG_OAHEADPTR_MASK); 1777 - stream->oa_buffer.head = gtt_offset; 1810 + stream->oa_buffer.head = 0; 1778 1811 1779 1812 /* 1780 1813 * PRM says: ··· 1790 1823 gtt_offset & GEN12_OAG_OATAILPTR_MASK); 1791 1824 1792 1825 /* Mark that we need updated tail pointers to read from... */ 1793 - stream->oa_buffer.tail = gtt_offset; 1826 + stream->oa_buffer.tail = 0; 1794 1827 1795 1828 /* 1796 1829 * Reset state used to recognise context switches, affecting which ··· 3194 3227 */ 3195 3228 u32 i915_perf_oa_timestamp_frequency(struct drm_i915_private *i915) 3196 3229 { 3197 - /* 3198 - * Wa_18013179988:dg2 3199 - * Wa_14015846243:mtl 3200 - */ 3201 - if (IS_DG2(i915) || IS_METEORLAKE(i915)) { 3230 + struct intel_gt *gt = to_gt(i915); 3231 + 3232 + /* Wa_18013179988 */ 3233 + if (IS_DG2(i915) || IS_GFX_GT_IP_RANGE(gt, IP_VER(12, 70), IP_VER(12, 71))) { 3202 3234 intel_wakeref_t wakeref; 3203 3235 u32 reg, shift; 3204 3236 ··· 3238 3272 struct drm_i915_private *i915 = stream->perf->i915; 3239 3273 struct i915_perf *perf = stream->perf; 3240 3274 struct i915_perf_group *g; 3241 - struct intel_gt *gt; 3242 3275 int ret; 3243 3276 3244 3277 if (!props->engine) { ··· 3245 3280 "OA engine not specified\n"); 3246 3281 return -EINVAL; 3247 3282 } 3248 - gt = props->engine->gt; 3249 3283 g = props->engine->oa_group; 3250 3284 3251 3285 /* ··· 3345 3381 intel_engine_pm_get(stream->engine); 3346 3382 intel_uncore_forcewake_get(stream->uncore, FORCEWAKE_ALL); 3347 3383 3348 - /* 3349 - * Wa_16011777198:dg2: GuC resets render as part of the Wa. This causes 3350 - * OA to lose the configuration state. Prevent this by overriding GUCRC 3351 - * mode. 3352 - */ 3353 - if (intel_uc_uses_guc_rc(&gt->uc) && 3354 - (IS_DG2_GRAPHICS_STEP(gt->i915, G10, STEP_A0, STEP_C0) || 3355 - IS_DG2_GRAPHICS_STEP(gt->i915, G11, STEP_A0, STEP_B0))) { 3356 - ret = intel_guc_slpc_override_gucrc_mode(&gt->uc.guc.slpc, 3357 - SLPC_GUCRC_MODE_GUCRC_NO_RC6); 3358 - if (ret) { 3359 - drm_dbg(&stream->perf->i915->drm, 3360 - "Unable to override gucrc mode\n"); 3361 - goto err_gucrc; 3362 - } 3363 - 3364 - stream->override_gucrc = true; 3365 - } 3366 - 3367 3384 ret = alloc_oa_buffer(stream); 3368 3385 if (ret) 3369 3386 goto err_oa_buf_alloc; ··· 3381 3436 free_oa_buffer(stream); 3382 3437 3383 3438 err_oa_buf_alloc: 3384 - if (stream->override_gucrc) 3385 - intel_guc_slpc_unset_gucrc_mode(&gt->uc.guc.slpc); 3386 - 3387 - err_gucrc: 3388 3439 intel_uncore_forcewake_put(stream->uncore, FORCEWAKE_ALL); 3389 3440 intel_engine_pm_put(stream->engine); 3390 3441 ··· 4164 4223 * C6 disable in BIOS. Fail if Media C6 is enabled on steppings where OAM 4165 4224 * does not work as expected. 4166 4225 */ 4167 - if (IS_MTL_MEDIA_STEP(props->engine->i915, STEP_A0, STEP_C0) && 4226 + if (IS_MEDIA_GT_IP_STEP(props->engine->gt, IP_VER(13, 0), STEP_A0, STEP_C0) && 4168 4227 props->engine->oa_group->type == TYPE_OAM && 4169 4228 intel_check_bios_c6_setup(&props->engine->gt->rc6)) { 4170 4229 drm_dbg(&perf->i915->drm, ··· 4480 4539 4481 4540 static bool gen12_is_valid_mux_addr(struct i915_perf *perf, u32 addr) 4482 4541 { 4483 - if (IS_METEORLAKE(perf->i915)) 4542 + if (GRAPHICS_VER_FULL(perf->i915) >= IP_VER(12, 70)) 4484 4543 return reg_in_range_table(addr, mtl_oa_mux_regs); 4485 4544 else 4486 4545 return reg_in_range_table(addr, gen12_oa_mux_regs); ··· 5273 5332 * C6 disable in BIOS. If Media C6 is enabled in BIOS, return version 6 5274 5333 * to indicate that OA media is not supported. 5275 5334 */ 5276 - if (IS_MTL_MEDIA_STEP(i915, STEP_A0, STEP_C0)) { 5277 - struct intel_gt *gt; 5278 - int i; 5279 - 5280 - for_each_gt(gt, i915, i) { 5281 - if (gt->type == GT_MEDIA && 5282 - intel_check_bios_c6_setup(&gt->rc6)) 5283 - return 6; 5284 - } 5285 - } 5335 + if (IS_MEDIA_GT_IP_STEP(i915->media_gt, IP_VER(13, 0), STEP_A0, STEP_C0) && 5336 + intel_check_bios_c6_setup(&i915->media_gt->rc6)) 5337 + return 6; 5286 5338 5287 5339 return 7; 5288 5340 }
-6
drivers/gpu/drm/i915/i915_perf_types.h
··· 338 338 * buffer should be checked for available data. 339 339 */ 340 340 u64 poll_oa_period; 341 - 342 - /** 343 - * @override_gucrc: GuC RC has been overridden for the perf stream, 344 - * and we need to restore the default configuration on release. 345 - */ 346 - bool override_gucrc; 347 341 }; 348 342 349 343 /**
-8
drivers/gpu/drm/i915/intel_clock_gating.c
··· 396 396 /* Wa_22010954014:dg2 */ 397 397 intel_uncore_rmw(&i915->uncore, XEHP_CLOCK_GATE_DIS, 0, 398 398 SGSI_SIDECLK_DIS); 399 - 400 - /* 401 - * Wa_14010733611:dg2_g10 402 - * Wa_22010146351:dg2_g10 403 - */ 404 - if (IS_DG2_GRAPHICS_STEP(i915, G10, STEP_A0, STEP_B0)) 405 - intel_uncore_rmw(&i915->uncore, XEHP_CLOCK_GATE_DIS, 0, 406 - SGR_DIS | SGGI_DIS); 407 399 } 408 400 409 401 static void pvc_init_clock_gating(struct drm_i915_private *i915)
-14
drivers/gpu/drm/i915/intel_device_info.c
··· 206 206 INTEL_DG2_G12_IDS(0), 207 207 }; 208 208 209 - static const u16 subplatform_m_ids[] = { 210 - INTEL_MTL_M_IDS(0), 211 - }; 212 - 213 - static const u16 subplatform_p_ids[] = { 214 - INTEL_MTL_P_IDS(0), 215 - }; 216 - 217 209 static bool find_devid(u16 id, const u16 *p, unsigned int num) 218 210 { 219 211 for (; num; num--, p++) { ··· 267 275 } else if (find_devid(devid, subplatform_g12_ids, 268 276 ARRAY_SIZE(subplatform_g12_ids))) { 269 277 mask = BIT(INTEL_SUBPLATFORM_G12); 270 - } else if (find_devid(devid, subplatform_m_ids, 271 - ARRAY_SIZE(subplatform_m_ids))) { 272 - mask = BIT(INTEL_SUBPLATFORM_M); 273 - } else if (find_devid(devid, subplatform_p_ids, 274 - ARRAY_SIZE(subplatform_p_ids))) { 275 - mask = BIT(INTEL_SUBPLATFORM_P); 276 278 } 277 279 278 280 GEM_BUG_ON(mask & ~INTEL_SUBPLATFORM_MASK);
-4
drivers/gpu/drm/i915/intel_device_info.h
··· 129 129 #define INTEL_SUBPLATFORM_N 1 130 130 #define INTEL_SUBPLATFORM_RPLU 2 131 131 132 - /* MTL */ 133 - #define INTEL_SUBPLATFORM_M 0 134 - #define INTEL_SUBPLATFORM_P 1 135 - 136 132 enum intel_ppgtt_type { 137 133 INTEL_PPGTT_NONE = I915_GEM_PPGTT_NONE, 138 134 INTEL_PPGTT_ALIASING = I915_GEM_PPGTT_ALIASING,
+2 -2
drivers/gpu/drm/i915/pxp/intel_pxp_cmd_interface_43.h
··· 14 14 #define PXP43_CMDID_NEW_HUC_AUTH 0x0000003F /* MTL+ */ 15 15 #define PXP43_CMDID_INIT_SESSION 0x00000036 16 16 17 - /* PXP-Packet sizes for MTL's GSCCS-HECI instruction */ 18 - #define PXP43_MAX_HECI_INOUT_SIZE (SZ_32K) 17 + /* PXP-Packet sizes for MTL's GSCCS-HECI instruction is spec'd at 65K before page alignment*/ 18 + #define PXP43_MAX_HECI_INOUT_SIZE (PAGE_ALIGN(SZ_64K + SZ_1K)) 19 19 20 20 /* PXP-Packet size for MTL's NEW_HUC_AUTH instruction */ 21 21 #define PXP43_HUC_AUTH_INOUT_SIZE (SZ_4K)
+1 -1
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
··· 111 111 112 112 ret = intel_gsc_uc_heci_cmd_submit_nonpriv(&gt->uc.gsc, 113 113 exec_res->ce, &pkt, exec_res->bb_vaddr, 114 - GSC_REPLY_LATENCY_MS); 114 + GSC_HECI_REPLY_LATENCY_MS); 115 115 if (ret) { 116 116 drm_err(&i915->drm, "failed to send gsc PXP msg (%d)\n", ret); 117 117 goto unlock;
+4 -6
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
··· 8 8 9 9 #include <linux/types.h> 10 10 11 + #include "gt/uc/intel_gsc_uc_heci_cmd_submit.h" 12 + 11 13 struct intel_pxp; 12 14 13 - #define GSC_REPLY_LATENCY_MS 210 14 - /* 15 - * Max FW response time is 200ms, to which we add 10ms to account for overhead 16 - * such as request preparation, GuC submission to hw and pipeline completion times. 17 - */ 18 15 #define GSC_PENDING_RETRY_MAXCOUNT 40 19 16 #define GSC_PENDING_RETRY_PAUSE_MS 50 20 - #define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS) 17 + #define GSCFW_MAX_ROUND_TRIP_LATENCY_MS (GSC_HECI_REPLY_LATENCY_MS + \ 18 + (GSC_PENDING_RETRY_MAXCOUNT * GSC_PENDING_RETRY_PAUSE_MS)) 21 19 22 20 #ifdef CONFIG_DRM_I915_PXP 23 21 void intel_pxp_gsccs_fini(struct intel_pxp *pxp);
+4 -2
drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
··· 9 9 #include <drm/i915_component.h> 10 10 11 11 #include "gem/i915_gem_lmem.h" 12 + #include "gt/intel_gt_print.h" 12 13 13 14 #include "i915_drv.h" 14 15 #include "gt/intel_gt.h" ··· 156 155 { 157 156 struct drm_i915_private *i915 = kdev_to_i915(i915_kdev); 158 157 struct intel_pxp *pxp = i915->pxp; 159 - struct intel_uc *uc = &pxp->ctrl_gt->uc; 158 + struct intel_gt *gt = pxp->ctrl_gt; 159 + struct intel_uc *uc = &gt->uc; 160 160 intel_wakeref_t wakeref; 161 161 int ret = 0; 162 162 ··· 177 175 /* load huc via pxp */ 178 176 ret = intel_huc_fw_load_and_auth_via_gsc(&uc->huc); 179 177 if (ret < 0) 180 - drm_err(&i915->drm, "failed to load huc via gsc %d\n", ret); 178 + gt_probe_error(gt, "failed to load huc via gsc %d\n", ret); 181 179 } 182 180 } 183 181
+3
drivers/gpu/drm/i915/selftests/igt_spinner.c
··· 179 179 180 180 *batch++ = arbitration_command; 181 181 182 + memset32(batch, MI_NOOP, 128); 183 + batch += 128; 184 + 182 185 if (GRAPHICS_VER(rq->i915) >= 8) 183 186 *batch++ = MI_BATCH_BUFFER_START | BIT(8) | 1; 184 187 else if (IS_HASWELL(rq->i915))
+5 -9
include/drm/i915_pciids.h
··· 738 738 #define INTEL_ATS_M_IDS(info) \ 739 739 INTEL_ATS_M150_IDS(info), \ 740 740 INTEL_ATS_M75_IDS(info) 741 - /* MTL */ 742 - #define INTEL_MTL_M_IDS(info) \ 743 - INTEL_VGA_DEVICE(0x7D40, info), \ 744 - INTEL_VGA_DEVICE(0x7D60, info) 745 741 746 - #define INTEL_MTL_P_IDS(info) \ 742 + /* MTL */ 743 + #define INTEL_MTL_IDS(info) \ 744 + INTEL_VGA_DEVICE(0x7D40, info), \ 747 745 INTEL_VGA_DEVICE(0x7D45, info), \ 748 746 INTEL_VGA_DEVICE(0x7D55, info), \ 747 + INTEL_VGA_DEVICE(0x7D60, info), \ 748 + INTEL_VGA_DEVICE(0x7D67, info), \ 749 749 INTEL_VGA_DEVICE(0x7DD5, info) 750 - 751 - #define INTEL_MTL_IDS(info) \ 752 - INTEL_MTL_M_IDS(info), \ 753 - INTEL_MTL_P_IDS(info) 754 750 755 751 #endif /* _I915_PCIIDS_H */