2 * SPDX-License-Identifier: MIT
4 * Copyright © 2014-2018 Intel Corporation
8 #include "intel_context.h"
9 #include "intel_workarounds.h"
12 * DOC: Hardware workarounds
14 * This file is intended as a central place to implement most [1]_ of the
15 * required workarounds for hardware to work as originally intended. They fall
16 * in five basic categories depending on how/when they are applied:
18 * - Workarounds that touch registers that are saved/restored to/from the HW
19 * context image. The list is emitted (via Load Register Immediate commands)
20 * everytime a new context is created.
21 * - GT workarounds. The list of these WAs is applied whenever these registers
22 * revert to default values (on GPU reset, suspend/resume [2]_, etc..).
23 * - Display workarounds. The list is applied during display clock-gating
25 * - Workarounds that whitelist a privileged register, so that UMDs can manage
26 * them directly. This is just a special case of a MMMIO workaround (as we
27 * write the list of these to/be-whitelisted registers to some special HW
29 * - Workaround batchbuffers, that get executed automatically by the hardware
30 * on every HW context restore.
32 * .. [1] Please notice that there are other WAs that, due to their nature,
33 * cannot be applied from a central place. Those are peppered around the rest
34 * of the code, as needed.
36 * .. [2] Technically, some registers are powercontext saved & restored, so they
37 * survive a suspend/resume. In practice, writing them again is not too
38 * costly and simplifies things. We can revisit this in the future.
43 * Keep things in this file ordered by WA type, as per the above (context, GT,
44 * display, register whitelist, batchbuffer). Then, inside each type, keep the
47 * - Infrastructure functions and macros
48 * - WAs per platform in standard gen/chrono order
49 * - Public functions to init or apply the given workaround type.
52 static void wa_init_start(struct i915_wa_list *wal, const char *name)
57 #define WA_LIST_CHUNK (1 << 4)
59 static void wa_init_finish(struct i915_wa_list *wal)
61 /* Trim unused entries. */
62 if (!IS_ALIGNED(wal->count, WA_LIST_CHUNK)) {
63 struct i915_wa *list = kmemdup(wal->list,
64 wal->count * sizeof(*list),
76 DRM_DEBUG_DRIVER("Initialized %u %s workarounds\n",
77 wal->wa_count, wal->name);
80 static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
82 unsigned int addr = i915_mmio_reg_offset(wa->reg);
83 unsigned int start = 0, end = wal->count;
84 const unsigned int grow = WA_LIST_CHUNK;
87 GEM_BUG_ON(!is_power_of_2(grow));
89 if (IS_ALIGNED(wal->count, grow)) { /* Either uninitialized or full. */
92 list = kmalloc_array(ALIGN(wal->count + 1, grow), sizeof(*wa),
95 DRM_ERROR("No space for workaround init!\n");
100 memcpy(list, wal->list, sizeof(*wa) * wal->count);
105 while (start < end) {
106 unsigned int mid = start + (end - start) / 2;
108 if (i915_mmio_reg_offset(wal->list[mid].reg) < addr) {
110 } else if (i915_mmio_reg_offset(wal->list[mid].reg) > addr) {
113 wa_ = &wal->list[mid];
115 if ((wa->mask & ~wa_->mask) == 0) {
116 DRM_ERROR("Discarding overwritten w/a for reg %04x (mask: %08x, value: %08x)\n",
117 i915_mmio_reg_offset(wa_->reg),
118 wa_->mask, wa_->val);
120 wa_->val &= ~wa->mask;
125 wa_->mask |= wa->mask;
126 wa_->read |= wa->read;
132 wa_ = &wal->list[wal->count++];
135 while (wa_-- > wal->list) {
136 GEM_BUG_ON(i915_mmio_reg_offset(wa_[0].reg) ==
137 i915_mmio_reg_offset(wa_[1].reg));
138 if (i915_mmio_reg_offset(wa_[1].reg) >
139 i915_mmio_reg_offset(wa_[0].reg))
142 swap(wa_[1], wa_[0]);
147 wa_write_masked_or(struct i915_wa_list *wal, i915_reg_t reg, u32 mask,
150 struct i915_wa wa = {
161 wa_masked_en(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
163 wa_write_masked_or(wal, reg, val, _MASKED_BIT_ENABLE(val));
167 wa_write(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
169 wa_write_masked_or(wal, reg, ~0, val);
173 wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
175 wa_write_masked_or(wal, reg, val, val);
179 ignore_wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 mask, u32 val)
181 struct i915_wa wa = {
185 /* Bonkers HW, skip verifying */
191 #define WA_SET_BIT_MASKED(addr, mask) \
192 wa_write_masked_or(wal, (addr), (mask), _MASKED_BIT_ENABLE(mask))
194 #define WA_CLR_BIT_MASKED(addr, mask) \
195 wa_write_masked_or(wal, (addr), (mask), _MASKED_BIT_DISABLE(mask))
197 #define WA_SET_FIELD_MASKED(addr, mask, value) \
198 wa_write_masked_or(wal, (addr), (mask), _MASKED_FIELD((mask), (value)))
200 static void gen8_ctx_workarounds_init(struct intel_engine_cs *engine,
201 struct i915_wa_list *wal)
203 WA_SET_BIT_MASKED(INSTPM, INSTPM_FORCE_ORDERING);
205 /* WaDisableAsyncFlipPerfMode:bdw,chv */
206 WA_SET_BIT_MASKED(MI_MODE, ASYNC_FLIP_PERF_DISABLE);
208 /* WaDisablePartialInstShootdown:bdw,chv */
209 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
210 PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE);
212 /* Use Force Non-Coherent whenever executing a 3D context. This is a
213 * workaround for for a possible hang in the unlikely event a TLB
214 * invalidation occurs during a PSD flush.
216 /* WaForceEnableNonCoherent:bdw,chv */
217 /* WaHdcDisableFetchWhenMasked:bdw,chv */
218 WA_SET_BIT_MASKED(HDC_CHICKEN0,
219 HDC_DONOT_FETCH_MEM_WHEN_MASKED |
220 HDC_FORCE_NON_COHERENT);
222 /* From the Haswell PRM, Command Reference: Registers, CACHE_MODE_0:
223 * "The Hierarchical Z RAW Stall Optimization allows non-overlapping
224 * polygons in the same 8x4 pixel/sample area to be processed without
225 * stalling waiting for the earlier ones to write to Hierarchical Z
228 * This optimization is off by default for BDW and CHV; turn it on.
230 WA_CLR_BIT_MASKED(CACHE_MODE_0_GEN7, HIZ_RAW_STALL_OPT_DISABLE);
232 /* Wa4x4STCOptimizationDisable:bdw,chv */
233 WA_SET_BIT_MASKED(CACHE_MODE_1, GEN8_4x4_STC_OPTIMIZATION_DISABLE);
236 * BSpec recommends 8x4 when MSAA is used,
237 * however in practice 16x4 seems fastest.
239 * Note that PS/WM thread counts depend on the WIZ hashing
240 * disable bit, which we don't touch here, but it's good
241 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
243 WA_SET_FIELD_MASKED(GEN7_GT_MODE,
244 GEN6_WIZ_HASHING_MASK,
245 GEN6_WIZ_HASHING_16x4);
248 static void bdw_ctx_workarounds_init(struct intel_engine_cs *engine,
249 struct i915_wa_list *wal)
251 struct drm_i915_private *i915 = engine->i915;
253 gen8_ctx_workarounds_init(engine, wal);
255 /* WaDisableThreadStallDopClockGating:bdw (pre-production) */
256 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, STALL_DOP_GATING_DISABLE);
258 /* WaDisableDopClockGating:bdw
260 * Also see the related UCGTCL1 write in broadwell_init_clock_gating()
261 * to disable EUTC clock gating.
263 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
264 DOP_CLOCK_GATING_DISABLE);
266 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
267 GEN8_SAMPLER_POWER_BYPASS_DIS);
269 WA_SET_BIT_MASKED(HDC_CHICKEN0,
270 /* WaForceContextSaveRestoreNonCoherent:bdw */
271 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT |
272 /* WaDisableFenceDestinationToSLM:bdw (pre-prod) */
273 (IS_BDW_GT3(i915) ? HDC_FENCE_DEST_SLM_DISABLE : 0));
276 static void chv_ctx_workarounds_init(struct intel_engine_cs *engine,
277 struct i915_wa_list *wal)
279 gen8_ctx_workarounds_init(engine, wal);
281 /* WaDisableThreadStallDopClockGating:chv */
282 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, STALL_DOP_GATING_DISABLE);
284 /* Improve HiZ throughput on CHV. */
285 WA_SET_BIT_MASKED(HIZ_CHICKEN, CHV_HZ_8X8_MODE_IN_1X);
288 static void gen9_ctx_workarounds_init(struct intel_engine_cs *engine,
289 struct i915_wa_list *wal)
291 struct drm_i915_private *i915 = engine->i915;
294 /* WaCompressedResourceSamplerPbeMediaNewHashMode:skl,kbl
296 * Must match Display Engine. See
297 * WaCompressedResourceDisplayNewHashMode.
299 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
300 GEN9_PBE_COMPRESSED_HASH_SELECTION);
301 WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
302 GEN9_SAMPLER_HASH_COMPRESSED_READ_ADDR);
305 /* WaClearFlowControlGpgpuContextSave:skl,bxt,kbl,glk,cfl */
306 /* WaDisablePartialInstShootdown:skl,bxt,kbl,glk,cfl */
307 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
308 FLOW_CONTROL_ENABLE |
309 PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE);
311 /* Syncing dependencies between camera and graphics:skl,bxt,kbl */
312 if (!IS_COFFEELAKE(i915))
313 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
314 GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC);
316 /* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt,kbl,glk,cfl */
317 /* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt,kbl,cfl */
318 WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
319 GEN9_ENABLE_YV12_BUGFIX |
320 GEN9_ENABLE_GPGPU_PREEMPTION);
322 /* Wa4x4STCOptimizationDisable:skl,bxt,kbl,glk,cfl */
323 /* WaDisablePartialResolveInVc:skl,bxt,kbl,cfl */
324 WA_SET_BIT_MASKED(CACHE_MODE_1,
325 GEN8_4x4_STC_OPTIMIZATION_DISABLE |
326 GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE);
328 /* WaCcsTlbPrefetchDisable:skl,bxt,kbl,glk,cfl */
329 WA_CLR_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN5,
330 GEN9_CCS_TLB_PREFETCH_ENABLE);
332 /* WaForceContextSaveRestoreNonCoherent:skl,bxt,kbl,cfl */
333 WA_SET_BIT_MASKED(HDC_CHICKEN0,
334 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT |
335 HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE);
337 /* WaForceEnableNonCoherent and WaDisableHDCInvalidation are
338 * both tied to WaForceContextSaveRestoreNonCoherent
339 * in some hsds for skl. We keep the tie for all gen9. The
340 * documentation is a bit hazy and so we want to get common behaviour,
341 * even though there is no clear evidence we would need both on kbl/bxt.
342 * This area has been source of system hangs so we play it safe
343 * and mimic the skl regardless of what bspec says.
345 * Use Force Non-Coherent whenever executing a 3D context. This
346 * is a workaround for a possible hang in the unlikely event
347 * a TLB invalidation occurs during a PSD flush.
350 /* WaForceEnableNonCoherent:skl,bxt,kbl,cfl */
351 WA_SET_BIT_MASKED(HDC_CHICKEN0,
352 HDC_FORCE_NON_COHERENT);
354 /* WaDisableSamplerPowerBypassForSOPingPong:skl,bxt,kbl,cfl */
355 if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) || IS_COFFEELAKE(i915))
356 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
357 GEN8_SAMPLER_POWER_BYPASS_DIS);
359 /* WaDisableSTUnitPowerOptimization:skl,bxt,kbl,glk,cfl */
360 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN2, GEN8_ST_PO_DISABLE);
363 * Supporting preemption with fine-granularity requires changes in the
364 * batch buffer programming. Since we can't break old userspace, we
365 * need to set our default preemption level to safe value. Userspace is
366 * still able to use more fine-grained preemption levels, since in
367 * WaEnablePreemptionGranularityControlByUMD we're whitelisting the
368 * per-ctx register. As such, WaDisable{3D,GPGPU}MidCmdPreemption are
369 * not real HW workarounds, but merely a way to start using preemption
370 * while maintaining old contract with userspace.
373 /* WaDisable3DMidCmdPreemption:skl,bxt,glk,cfl,[cnl] */
374 WA_CLR_BIT_MASKED(GEN8_CS_CHICKEN1, GEN9_PREEMPT_3D_OBJECT_LEVEL);
376 /* WaDisableGPGPUMidCmdPreemption:skl,bxt,blk,cfl,[cnl] */
377 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
378 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
379 GEN9_PREEMPT_GPGPU_COMMAND_LEVEL);
381 /* WaClearHIZ_WM_CHICKEN3:bxt,glk */
382 if (IS_GEN9_LP(i915))
383 WA_SET_BIT_MASKED(GEN9_WM_CHICKEN3, GEN9_FACTOR_IN_CLR_VAL_HIZ);
386 static void skl_tune_iz_hashing(struct intel_engine_cs *engine,
387 struct i915_wa_list *wal)
389 struct drm_i915_private *i915 = engine->i915;
390 u8 vals[3] = { 0, 0, 0 };
393 for (i = 0; i < 3; i++) {
397 * Only consider slices where one, and only one, subslice has 7
400 if (!is_power_of_2(RUNTIME_INFO(i915)->sseu.subslice_7eu[i]))
404 * subslice_7eu[i] != 0 (because of the check above) and
405 * ss_max == 4 (maximum number of subslices possible per slice)
409 ss = ffs(RUNTIME_INFO(i915)->sseu.subslice_7eu[i]) - 1;
413 if (vals[0] == 0 && vals[1] == 0 && vals[2] == 0)
416 /* Tune IZ hashing. See intel_device_info_runtime_init() */
417 WA_SET_FIELD_MASKED(GEN7_GT_MODE,
418 GEN9_IZ_HASHING_MASK(2) |
419 GEN9_IZ_HASHING_MASK(1) |
420 GEN9_IZ_HASHING_MASK(0),
421 GEN9_IZ_HASHING(2, vals[2]) |
422 GEN9_IZ_HASHING(1, vals[1]) |
423 GEN9_IZ_HASHING(0, vals[0]));
426 static void skl_ctx_workarounds_init(struct intel_engine_cs *engine,
427 struct i915_wa_list *wal)
429 gen9_ctx_workarounds_init(engine, wal);
430 skl_tune_iz_hashing(engine, wal);
433 static void bxt_ctx_workarounds_init(struct intel_engine_cs *engine,
434 struct i915_wa_list *wal)
436 gen9_ctx_workarounds_init(engine, wal);
438 /* WaDisableThreadStallDopClockGating:bxt */
439 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
440 STALL_DOP_GATING_DISABLE);
442 /* WaToEnableHwFixForPushConstHWBug:bxt */
443 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
444 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
447 static void kbl_ctx_workarounds_init(struct intel_engine_cs *engine,
448 struct i915_wa_list *wal)
450 struct drm_i915_private *i915 = engine->i915;
452 gen9_ctx_workarounds_init(engine, wal);
454 /* WaToEnableHwFixForPushConstHWBug:kbl */
455 if (IS_KBL_REVID(i915, KBL_REVID_C0, REVID_FOREVER))
456 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
457 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
459 /* WaDisableSbeCacheDispatchPortSharing:kbl */
460 WA_SET_BIT_MASKED(GEN7_HALF_SLICE_CHICKEN1,
461 GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE);
464 static void glk_ctx_workarounds_init(struct intel_engine_cs *engine,
465 struct i915_wa_list *wal)
467 gen9_ctx_workarounds_init(engine, wal);
469 /* WaToEnableHwFixForPushConstHWBug:glk */
470 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
471 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
474 static void cfl_ctx_workarounds_init(struct intel_engine_cs *engine,
475 struct i915_wa_list *wal)
477 gen9_ctx_workarounds_init(engine, wal);
479 /* WaToEnableHwFixForPushConstHWBug:cfl */
480 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
481 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
483 /* WaDisableSbeCacheDispatchPortSharing:cfl */
484 WA_SET_BIT_MASKED(GEN7_HALF_SLICE_CHICKEN1,
485 GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE);
488 static void cnl_ctx_workarounds_init(struct intel_engine_cs *engine,
489 struct i915_wa_list *wal)
491 struct drm_i915_private *i915 = engine->i915;
493 /* WaForceContextSaveRestoreNonCoherent:cnl */
494 WA_SET_BIT_MASKED(CNL_HDC_CHICKEN0,
495 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT);
497 /* WaThrottleEUPerfToAvoidTDBackPressure:cnl(pre-prod) */
498 if (IS_CNL_REVID(i915, CNL_REVID_B0, CNL_REVID_B0))
499 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, THROTTLE_12_5);
501 /* WaDisableReplayBufferBankArbitrationOptimization:cnl */
502 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
503 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
505 /* WaDisableEnhancedSBEVertexCaching:cnl (pre-prod) */
506 if (IS_CNL_REVID(i915, 0, CNL_REVID_B0))
507 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
508 GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE);
510 /* WaPushConstantDereferenceHoldDisable:cnl */
511 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2, PUSH_CONSTANT_DEREF_DISABLE);
513 /* FtrEnableFastAnisoL1BankingFix:cnl */
514 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, CNL_FAST_ANISO_L1_BANKING_FIX);
516 /* WaDisable3DMidCmdPreemption:cnl */
517 WA_CLR_BIT_MASKED(GEN8_CS_CHICKEN1, GEN9_PREEMPT_3D_OBJECT_LEVEL);
519 /* WaDisableGPGPUMidCmdPreemption:cnl */
520 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
521 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
522 GEN9_PREEMPT_GPGPU_COMMAND_LEVEL);
524 /* WaDisableEarlyEOT:cnl */
525 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, DISABLE_EARLY_EOT);
528 static void icl_ctx_workarounds_init(struct intel_engine_cs *engine,
529 struct i915_wa_list *wal)
531 struct drm_i915_private *i915 = engine->i915;
533 /* WaDisableBankHangMode:icl */
536 intel_uncore_read(engine->uncore, GEN8_L3CNTLREG) |
539 /* Wa_1604370585:icl (pre-prod)
540 * Formerly known as WaPushConstantDereferenceHoldDisable
542 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
543 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
544 PUSH_CONSTANT_DEREF_DISABLE);
546 /* WaForceEnableNonCoherent:icl
547 * This is not the same workaround as in early Gen9 platforms, where
548 * lacking this could cause system hangs, but coherency performance
549 * overhead is high and only a few compute workloads really need it
550 * (the register is whitelisted in hardware now, so UMDs can opt in
551 * for coherency if they have a good reason).
553 WA_SET_BIT_MASKED(ICL_HDC_MODE, HDC_FORCE_NON_COHERENT);
555 /* Wa_2006611047:icl (pre-prod)
556 * Formerly known as WaDisableImprovedTdlClkGating
558 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
559 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
560 GEN11_TDL_CLOCK_GATING_FIX_DISABLE);
562 /* Wa_2006665173:icl (pre-prod) */
563 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
564 WA_SET_BIT_MASKED(GEN11_COMMON_SLICE_CHICKEN3,
565 GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC);
567 /* WaEnableFloatBlendOptimization:icl */
568 wa_write_masked_or(wal,
570 0, /* write-only, so skip validation */
571 _MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE));
573 /* WaDisableGPGPUMidThreadPreemption:icl */
574 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
575 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
576 GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL);
578 /* allow headerless messages for preemptible GPGPU context */
579 WA_SET_BIT_MASKED(GEN10_SAMPLER_MODE,
580 GEN11_SAMPLER_ENABLE_HEADLESS_MSG);
584 __intel_engine_init_ctx_wa(struct intel_engine_cs *engine,
585 struct i915_wa_list *wal,
588 struct drm_i915_private *i915 = engine->i915;
590 if (engine->class != RENDER_CLASS)
593 wa_init_start(wal, name);
595 if (IS_GEN(i915, 11))
596 icl_ctx_workarounds_init(engine, wal);
597 else if (IS_CANNONLAKE(i915))
598 cnl_ctx_workarounds_init(engine, wal);
599 else if (IS_COFFEELAKE(i915))
600 cfl_ctx_workarounds_init(engine, wal);
601 else if (IS_GEMINILAKE(i915))
602 glk_ctx_workarounds_init(engine, wal);
603 else if (IS_KABYLAKE(i915))
604 kbl_ctx_workarounds_init(engine, wal);
605 else if (IS_BROXTON(i915))
606 bxt_ctx_workarounds_init(engine, wal);
607 else if (IS_SKYLAKE(i915))
608 skl_ctx_workarounds_init(engine, wal);
609 else if (IS_CHERRYVIEW(i915))
610 chv_ctx_workarounds_init(engine, wal);
611 else if (IS_BROADWELL(i915))
612 bdw_ctx_workarounds_init(engine, wal);
613 else if (INTEL_GEN(i915) < 8)
616 MISSING_CASE(INTEL_GEN(i915));
621 void intel_engine_init_ctx_wa(struct intel_engine_cs *engine)
623 __intel_engine_init_ctx_wa(engine, &engine->ctx_wa_list, "context");
626 int intel_engine_emit_ctx_wa(struct i915_request *rq)
628 struct i915_wa_list *wal = &rq->engine->ctx_wa_list;
637 ret = rq->engine->emit_flush(rq, EMIT_BARRIER);
641 cs = intel_ring_begin(rq, (wal->count * 2 + 2));
645 *cs++ = MI_LOAD_REGISTER_IMM(wal->count);
646 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
647 *cs++ = i915_mmio_reg_offset(wa->reg);
652 intel_ring_advance(rq, cs);
654 ret = rq->engine->emit_flush(rq, EMIT_BARRIER);
662 gen9_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
664 /* WaDisableKillLogic:bxt,skl,kbl */
665 if (!IS_COFFEELAKE(i915))
671 /* WaCompressedResourceSamplerPbeMediaNewHashMode:skl,kbl
673 * Must match Display Engine. See
674 * WaCompressedResourceDisplayNewHashMode.
678 MMCD_PCLA | MMCD_HOTSPOT_EN);
681 /* WaDisableHDCInvalidation:skl,bxt,kbl,cfl */
684 BDW_DISABLE_HDC_INVALIDATION);
688 skl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
690 gen9_gt_workarounds_init(i915, wal);
692 /* WaDisableGafsUnitClkGating:skl */
695 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
697 /* WaInPlaceDecompressionHang:skl */
698 if (IS_SKL_REVID(i915, SKL_REVID_H0, REVID_FOREVER))
700 GEN9_GAMT_ECO_REG_RW_IA,
701 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
705 bxt_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
707 gen9_gt_workarounds_init(i915, wal);
709 /* WaInPlaceDecompressionHang:bxt */
711 GEN9_GAMT_ECO_REG_RW_IA,
712 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
716 kbl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
718 gen9_gt_workarounds_init(i915, wal);
720 /* WaDisableDynamicCreditSharing:kbl */
721 if (IS_KBL_REVID(i915, 0, KBL_REVID_B0))
724 GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING);
726 /* WaDisableGafsUnitClkGating:kbl */
729 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
731 /* WaInPlaceDecompressionHang:kbl */
733 GEN9_GAMT_ECO_REG_RW_IA,
734 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
738 glk_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
740 gen9_gt_workarounds_init(i915, wal);
744 cfl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
746 gen9_gt_workarounds_init(i915, wal);
748 /* WaDisableGafsUnitClkGating:cfl */
751 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
753 /* WaInPlaceDecompressionHang:cfl */
755 GEN9_GAMT_ECO_REG_RW_IA,
756 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
760 wa_init_mcr(struct drm_i915_private *i915, struct i915_wa_list *wal)
762 const struct sseu_dev_info *sseu = &RUNTIME_INFO(i915)->sseu;
763 u32 mcr_slice_subslice_mask;
766 * WaProgramMgsrForL3BankSpecificMmioReads: cnl,icl
767 * L3Banks could be fused off in single slice scenario. If that is
768 * the case, we might need to program MCR select to a valid L3Bank
769 * by default, to make sure we correctly read certain registers
770 * later on (in the range 0xB100 - 0xB3FF).
771 * This might be incompatible with
772 * WaProgramMgsrForCorrectSliceSpecificMmioReads.
773 * Fortunately, this should not happen in production hardware, so
774 * we only assert that this is the case (instead of implementing
775 * something more complex that requires checking the range of every
778 if (INTEL_GEN(i915) >= 10 &&
779 is_power_of_2(sseu->slice_mask)) {
781 * read FUSE3 for enabled L3 Bank IDs, if L3 Bank matches
782 * enabled subslice, no need to redirect MCR packet
784 u32 slice = fls(sseu->slice_mask);
786 intel_uncore_read(&i915->uncore, GEN10_MIRROR_FUSE3);
787 u8 ss_mask = sseu->subslice_mask[slice];
789 u8 enabled_mask = (ss_mask | ss_mask >>
790 GEN10_L3BANK_PAIR_COUNT) & GEN10_L3BANK_MASK;
791 u8 disabled_mask = fuse3 & GEN10_L3BANK_MASK;
794 * Production silicon should have matched L3Bank and
797 WARN_ON((enabled_mask & disabled_mask) != enabled_mask);
800 if (INTEL_GEN(i915) >= 11)
801 mcr_slice_subslice_mask = GEN11_MCR_SLICE_MASK |
802 GEN11_MCR_SUBSLICE_MASK;
804 mcr_slice_subslice_mask = GEN8_MCR_SLICE_MASK |
805 GEN8_MCR_SUBSLICE_MASK;
807 * WaProgramMgsrForCorrectSliceSpecificMmioReads:cnl,icl
808 * Before any MMIO read into slice/subslice specific registers, MCR
809 * packet control register needs to be programmed to point to any
810 * enabled s/ss pair. Otherwise, incorrect values will be returned.
811 * This means each subsequent MMIO read will be forwarded to an
812 * specific s/ss combination, but this is OK since these registers
813 * are consistent across s/ss in almost all cases. In the rare
814 * occasions, such as INSTDONE, where this value is dependent
815 * on s/ss combo, the read should be done with read_subslice_reg.
817 wa_write_masked_or(wal,
819 mcr_slice_subslice_mask,
820 intel_calculate_mcr_s_ss_select(i915));
824 cnl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
826 wa_init_mcr(i915, wal);
828 /* WaDisableI2mCycleOnWRPort:cnl (pre-prod) */
829 if (IS_CNL_REVID(i915, CNL_REVID_B0, CNL_REVID_B0))
832 GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT);
834 /* WaInPlaceDecompressionHang:cnl */
836 GEN9_GAMT_ECO_REG_RW_IA,
837 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
841 icl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
843 wa_init_mcr(i915, wal);
845 /* WaInPlaceDecompressionHang:icl */
847 GEN9_GAMT_ECO_REG_RW_IA,
848 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
850 /* WaModifyGamTlbPartitioning:icl */
851 wa_write_masked_or(wal,
852 GEN11_GACB_PERF_CTRL,
853 GEN11_HASH_CTRL_MASK,
854 GEN11_HASH_CTRL_BIT0 | GEN11_HASH_CTRL_BIT4);
857 * Formerly known as WaCL2SFHalfMaxAlloc
861 GEN11_LSN_UNSLCVC_GAFS_HALF_SF_MAXALLOC |
862 GEN11_LSN_UNSLCVC_GAFS_HALF_CL2_MAXALLOC);
865 * Formerly known as WaDisCtxReload
868 GEN8_GAMW_ECO_DEV_RW_IA,
869 GAMW_ECO_DEV_CTX_RELOAD_DISABLE);
871 /* Wa_1405779004:icl (pre-prod) */
872 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
874 SLICE_UNIT_LEVEL_CLKGATE,
875 MSCUNIT_CLKGATE_DIS);
877 /* Wa_1406680159:icl */
879 SUBSLICE_UNIT_LEVEL_CLKGATE,
882 /* Wa_1406838659:icl (pre-prod) */
883 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
885 INF_UNIT_LEVEL_CLKGATE,
889 * Formerly known as WaGamTlbPendError
893 GAMT_CHKN_DISABLE_L3_COH_PIPE);
897 gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal)
899 if (IS_GEN(i915, 11))
900 icl_gt_workarounds_init(i915, wal);
901 else if (IS_CANNONLAKE(i915))
902 cnl_gt_workarounds_init(i915, wal);
903 else if (IS_COFFEELAKE(i915))
904 cfl_gt_workarounds_init(i915, wal);
905 else if (IS_GEMINILAKE(i915))
906 glk_gt_workarounds_init(i915, wal);
907 else if (IS_KABYLAKE(i915))
908 kbl_gt_workarounds_init(i915, wal);
909 else if (IS_BROXTON(i915))
910 bxt_gt_workarounds_init(i915, wal);
911 else if (IS_SKYLAKE(i915))
912 skl_gt_workarounds_init(i915, wal);
913 else if (INTEL_GEN(i915) <= 8)
916 MISSING_CASE(INTEL_GEN(i915));
919 void intel_gt_init_workarounds(struct drm_i915_private *i915)
921 struct i915_wa_list *wal = &i915->gt_wa_list;
923 wa_init_start(wal, "GT");
924 gt_init_workarounds(i915, wal);
928 static enum forcewake_domains
929 wal_get_fw_for_rmw(struct intel_uncore *uncore, const struct i915_wa_list *wal)
931 enum forcewake_domains fw = 0;
935 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
936 fw |= intel_uncore_forcewake_for_reg(uncore,
945 wa_verify(const struct i915_wa *wa, u32 cur, const char *name, const char *from)
947 if ((cur ^ wa->val) & wa->read) {
948 DRM_ERROR("%s workaround lost on %s! (%x=%x/%x, expected %x, mask=%x)\n",
949 name, from, i915_mmio_reg_offset(wa->reg),
960 wa_list_apply(struct intel_uncore *uncore, const struct i915_wa_list *wal)
962 enum forcewake_domains fw;
970 fw = wal_get_fw_for_rmw(uncore, wal);
972 spin_lock_irqsave(&uncore->lock, flags);
973 intel_uncore_forcewake_get__locked(uncore, fw);
975 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
976 intel_uncore_rmw_fw(uncore, wa->reg, wa->mask, wa->val);
977 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
979 intel_uncore_read_fw(uncore, wa->reg),
980 wal->name, "application");
983 intel_uncore_forcewake_put__locked(uncore, fw);
984 spin_unlock_irqrestore(&uncore->lock, flags);
987 void intel_gt_apply_workarounds(struct drm_i915_private *i915)
989 wa_list_apply(&i915->uncore, &i915->gt_wa_list);
992 static bool wa_list_verify(struct intel_uncore *uncore,
993 const struct i915_wa_list *wal,
1000 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1002 intel_uncore_read(uncore, wa->reg),
1008 bool intel_gt_verify_workarounds(struct drm_i915_private *i915,
1011 return wa_list_verify(&i915->uncore, &i915->gt_wa_list, from);
1015 whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg)
1017 struct i915_wa wa = {
1021 if (GEM_DEBUG_WARN_ON(wal->count >= RING_MAX_NONPRIV_SLOTS))
1027 static void gen9_whitelist_build(struct i915_wa_list *w)
1029 /* WaVFEStateAfterPipeControlwithMediaStateClear:skl,bxt,glk,cfl */
1030 whitelist_reg(w, GEN9_CTX_PREEMPT_REG);
1032 /* WaEnablePreemptionGranularityControlByUMD:skl,bxt,kbl,cfl,[cnl] */
1033 whitelist_reg(w, GEN8_CS_CHICKEN1);
1035 /* WaAllowUMDToModifyHDCChicken1:skl,bxt,kbl,glk,cfl */
1036 whitelist_reg(w, GEN8_HDC_CHICKEN1);
1039 static void skl_whitelist_build(struct i915_wa_list *w)
1041 gen9_whitelist_build(w);
1043 /* WaDisableLSQCROPERFforOCL:skl */
1044 whitelist_reg(w, GEN8_L3SQCREG4);
1047 static void bxt_whitelist_build(struct i915_wa_list *w)
1049 gen9_whitelist_build(w);
1052 static void kbl_whitelist_build(struct i915_wa_list *w)
1054 gen9_whitelist_build(w);
1056 /* WaDisableLSQCROPERFforOCL:kbl */
1057 whitelist_reg(w, GEN8_L3SQCREG4);
1060 static void glk_whitelist_build(struct i915_wa_list *w)
1062 gen9_whitelist_build(w);
1064 /* WA #0862: Userspace has to set "Barrier Mode" to avoid hangs. */
1065 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);
1068 static void cfl_whitelist_build(struct i915_wa_list *w)
1070 gen9_whitelist_build(w);
1073 static void cnl_whitelist_build(struct i915_wa_list *w)
1075 /* WaEnablePreemptionGranularityControlByUMD:cnl */
1076 whitelist_reg(w, GEN8_CS_CHICKEN1);
1079 static void icl_whitelist_build(struct i915_wa_list *w)
1081 /* WaAllowUMDToModifyHalfSliceChicken7:icl */
1082 whitelist_reg(w, GEN9_HALF_SLICE_CHICKEN7);
1084 /* WaAllowUMDToModifySamplerMode:icl */
1085 whitelist_reg(w, GEN10_SAMPLER_MODE);
1087 /* WaEnableStateCacheRedirectToCS:icl */
1088 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);
1091 void intel_engine_init_whitelist(struct intel_engine_cs *engine)
1093 struct drm_i915_private *i915 = engine->i915;
1094 struct i915_wa_list *w = &engine->whitelist;
1096 if (engine->class != RENDER_CLASS)
1099 wa_init_start(w, "whitelist");
1101 if (IS_GEN(i915, 11))
1102 icl_whitelist_build(w);
1103 else if (IS_CANNONLAKE(i915))
1104 cnl_whitelist_build(w);
1105 else if (IS_COFFEELAKE(i915))
1106 cfl_whitelist_build(w);
1107 else if (IS_GEMINILAKE(i915))
1108 glk_whitelist_build(w);
1109 else if (IS_KABYLAKE(i915))
1110 kbl_whitelist_build(w);
1111 else if (IS_BROXTON(i915))
1112 bxt_whitelist_build(w);
1113 else if (IS_SKYLAKE(i915))
1114 skl_whitelist_build(w);
1115 else if (INTEL_GEN(i915) <= 8)
1118 MISSING_CASE(INTEL_GEN(i915));
1123 void intel_engine_apply_whitelist(struct intel_engine_cs *engine)
1125 const struct i915_wa_list *wal = &engine->whitelist;
1126 struct intel_uncore *uncore = engine->uncore;
1127 const u32 base = engine->mmio_base;
1134 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1135 intel_uncore_write(uncore,
1136 RING_FORCE_TO_NONPRIV(base, i),
1137 i915_mmio_reg_offset(wa->reg));
1139 /* And clear the rest just in case of garbage */
1140 for (; i < RING_MAX_NONPRIV_SLOTS; i++)
1141 intel_uncore_write(uncore,
1142 RING_FORCE_TO_NONPRIV(base, i),
1143 i915_mmio_reg_offset(RING_NOPID(base)));
1147 rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1149 struct drm_i915_private *i915 = engine->i915;
1151 if (IS_GEN(i915, 11)) {
1152 /* This is not an Wa. Enable for better image quality */
1155 _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE);
1157 /* WaPipelineFlushCoherentLines:icl */
1158 ignore_wa_write_or(wal,
1160 GEN8_LQSC_FLUSH_COHERENT_LINES,
1161 GEN8_LQSC_FLUSH_COHERENT_LINES);
1165 * Formerly known as WaGAPZPriorityScheme
1169 GEN11_ARBITRATION_PRIO_ORDER_MASK);
1173 * Formerly known as WaL3BankAddressHashing
1175 wa_write_masked_or(wal,
1177 GEN11_HASH_CTRL_EXCL_MASK,
1178 GEN11_HASH_CTRL_EXCL_BIT0);
1179 wa_write_masked_or(wal,
1181 GEN11_BANK_HASH_ADDR_EXCL_MASK,
1182 GEN11_BANK_HASH_ADDR_EXCL_BIT0);
1186 * Formerly known as WaDisableCleanEvicts
1188 ignore_wa_write_or(wal,
1190 GEN11_LQSC_CLEAN_EVICT_DISABLE,
1191 GEN11_LQSC_CLEAN_EVICT_DISABLE);
1193 /* WaForwardProgressSoftReset:icl */
1195 GEN10_SCRATCH_LNCF2,
1196 PMFLUSHDONE_LNICRSDROP |
1197 PMFLUSH_GAPL3UNBLOCK |
1198 PMFLUSHDONE_LNEBLK);
1200 /* Wa_1406609255:icl (pre-prod) */
1201 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
1204 GEN7_DISABLE_DEMAND_PREFETCH |
1205 GEN7_DISABLE_SAMPLER_PREFETCH);
1208 if (IS_GEN_RANGE(i915, 9, 11)) {
1209 /* FtrPerCtxtPreemptionGranularityControl:skl,bxt,kbl,cfl,cnl,icl */
1211 GEN7_FF_SLICE_CS_CHICKEN1,
1212 GEN9_FFSC_PERCTX_PREEMPT_CTRL);
1215 if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) || IS_COFFEELAKE(i915)) {
1216 /* WaEnableGapsTsvCreditFix:skl,kbl,cfl */
1219 GEN9_GAPS_TSV_CREDIT_DISABLE);
1222 if (IS_BROXTON(i915)) {
1223 /* WaDisablePooledEuLoadBalancingFix:bxt */
1225 FF_SLICE_CS_CHICKEN2,
1226 GEN9_POOLED_EU_LOAD_BALANCING_FIX_DISABLE);
1229 if (IS_GEN(i915, 9)) {
1230 /* WaContextSwitchWithConcurrentTLBInvalidate:skl,bxt,kbl,glk,cfl */
1232 GEN9_CSFE_CHICKEN1_RCS,
1233 GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE);
1235 /* WaEnableLbsSlaRetryTimerDecrement:skl,bxt,kbl,glk,cfl */
1238 GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE);
1240 /* WaProgramL3SqcReg1DefaultForPerf:bxt,glk */
1241 if (IS_GEN9_LP(i915))
1242 wa_write_masked_or(wal,
1244 L3_PRIO_CREDITS_MASK,
1245 L3_GENERAL_PRIO_CREDITS(62) |
1246 L3_HIGH_PRIO_CREDITS(2));
1248 /* WaOCLCoherentLineFlush:skl,bxt,kbl,cfl */
1251 GEN8_LQSC_FLUSH_COHERENT_LINES);
1256 xcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1258 struct drm_i915_private *i915 = engine->i915;
1260 /* WaKBLVECSSemaphoreWaitPoll:kbl */
1261 if (IS_KBL_REVID(i915, KBL_REVID_A0, KBL_REVID_E0)) {
1263 RING_SEMA_WAIT_POLL(engine->mmio_base),
1269 engine_init_workarounds(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1271 if (I915_SELFTEST_ONLY(INTEL_GEN(engine->i915) < 8))
1274 if (engine->id == RCS0)
1275 rcs_engine_wa_init(engine, wal);
1277 xcs_engine_wa_init(engine, wal);
1280 void intel_engine_init_workarounds(struct intel_engine_cs *engine)
1282 struct i915_wa_list *wal = &engine->wa_list;
1284 if (GEM_WARN_ON(INTEL_GEN(engine->i915) < 8))
1287 wa_init_start(wal, engine->name);
1288 engine_init_workarounds(engine, wal);
1289 wa_init_finish(wal);
1292 void intel_engine_apply_workarounds(struct intel_engine_cs *engine)
1294 wa_list_apply(engine->uncore, &engine->wa_list);
1297 static struct i915_vma *
1298 create_scratch(struct i915_address_space *vm, int count)
1300 struct drm_i915_gem_object *obj;
1301 struct i915_vma *vma;
1305 size = round_up(count * sizeof(u32), PAGE_SIZE);
1306 obj = i915_gem_object_create_internal(vm->i915, size);
1308 return ERR_CAST(obj);
1310 i915_gem_object_set_cache_coherency(obj, I915_CACHE_LLC);
1312 vma = i915_vma_instance(obj, vm, NULL);
1318 err = i915_vma_pin(vma, 0, 0,
1319 i915_vma_is_ggtt(vma) ? PIN_GLOBAL : PIN_USER);
1326 i915_gem_object_put(obj);
1327 return ERR_PTR(err);
1331 wa_list_srm(struct i915_request *rq,
1332 const struct i915_wa_list *wal,
1333 struct i915_vma *vma)
1335 const struct i915_wa *wa;
1339 srm = MI_STORE_REGISTER_MEM | MI_SRM_LRM_GLOBAL_GTT;
1340 if (INTEL_GEN(rq->i915) >= 8)
1343 cs = intel_ring_begin(rq, 4 * wal->count);
1347 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
1349 *cs++ = i915_mmio_reg_offset(wa->reg);
1350 *cs++ = i915_ggtt_offset(vma) + sizeof(u32) * i;
1353 intel_ring_advance(rq, cs);
1358 static int engine_wa_list_verify(struct intel_context *ce,
1359 const struct i915_wa_list * const wal,
1362 const struct i915_wa *wa;
1363 struct i915_request *rq;
1364 struct i915_vma *vma;
1372 vma = create_scratch(&ce->engine->i915->ggtt.vm, wal->count);
1374 return PTR_ERR(vma);
1376 rq = intel_context_create_request(ce);
1382 err = wa_list_srm(rq, wal, vma);
1386 i915_request_add(rq);
1387 if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
1392 results = i915_gem_object_pin_map(vma->obj, I915_MAP_WB);
1393 if (IS_ERR(results)) {
1394 err = PTR_ERR(results);
1399 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1400 if (!wa_verify(wa, results[i], wal->name, from))
1403 i915_gem_object_unpin_map(vma->obj);
1406 i915_vma_unpin(vma);
1411 int intel_engine_verify_workarounds(struct intel_engine_cs *engine,
1414 return engine_wa_list_verify(engine->kernel_context,
1419 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
1420 #include "selftest_workarounds.c"