2 * SPDX-License-Identifier: MIT
4 * Copyright © 2014-2018 Intel Corporation
8 #include "intel_workarounds.h"
11 * DOC: Hardware workarounds
13 * This file is intended as a central place to implement most [1]_ of the
14 * required workarounds for hardware to work as originally intended. They fall
15 * in five basic categories depending on how/when they are applied:
17 * - Workarounds that touch registers that are saved/restored to/from the HW
18 * context image. The list is emitted (via Load Register Immediate commands)
19 * everytime a new context is created.
20 * - GT workarounds. The list of these WAs is applied whenever these registers
21 * revert to default values (on GPU reset, suspend/resume [2]_, etc..).
22 * - Display workarounds. The list is applied during display clock-gating
24 * - Workarounds that whitelist a privileged register, so that UMDs can manage
25 * them directly. This is just a special case of a MMMIO workaround (as we
26 * write the list of these to/be-whitelisted registers to some special HW
28 * - Workaround batchbuffers, that get executed automatically by the hardware
29 * on every HW context restore.
31 * .. [1] Please notice that there are other WAs that, due to their nature,
32 * cannot be applied from a central place. Those are peppered around the rest
33 * of the code, as needed.
35 * .. [2] Technically, some registers are powercontext saved & restored, so they
36 * survive a suspend/resume. In practice, writing them again is not too
37 * costly and simplifies things. We can revisit this in the future.
42 * Keep things in this file ordered by WA type, as per the above (context, GT,
43 * display, register whitelist, batchbuffer). Then, inside each type, keep the
46 * - Infrastructure functions and macros
47 * - WAs per platform in standard gen/chrono order
48 * - Public functions to init or apply the given workaround type.
51 static void wa_init_start(struct i915_wa_list *wal, const char *name)
56 #define WA_LIST_CHUNK (1 << 4)
58 static void wa_init_finish(struct i915_wa_list *wal)
60 /* Trim unused entries. */
61 if (!IS_ALIGNED(wal->count, WA_LIST_CHUNK)) {
62 struct i915_wa *list = kmemdup(wal->list,
63 wal->count * sizeof(*list),
75 DRM_DEBUG_DRIVER("Initialized %u %s workarounds\n",
76 wal->wa_count, wal->name);
79 static void _wa_add(struct i915_wa_list *wal, const struct i915_wa *wa)
81 unsigned int addr = i915_mmio_reg_offset(wa->reg);
82 unsigned int start = 0, end = wal->count;
83 const unsigned int grow = WA_LIST_CHUNK;
86 GEM_BUG_ON(!is_power_of_2(grow));
88 if (IS_ALIGNED(wal->count, grow)) { /* Either uninitialized or full. */
91 list = kmalloc_array(ALIGN(wal->count + 1, grow), sizeof(*wa),
94 DRM_ERROR("No space for workaround init!\n");
99 memcpy(list, wal->list, sizeof(*wa) * wal->count);
104 while (start < end) {
105 unsigned int mid = start + (end - start) / 2;
107 if (i915_mmio_reg_offset(wal->list[mid].reg) < addr) {
109 } else if (i915_mmio_reg_offset(wal->list[mid].reg) > addr) {
112 wa_ = &wal->list[mid];
114 if ((wa->mask & ~wa_->mask) == 0) {
115 DRM_ERROR("Discarding overwritten w/a for reg %04x (mask: %08x, value: %08x)\n",
116 i915_mmio_reg_offset(wa_->reg),
117 wa_->mask, wa_->val);
119 wa_->val &= ~wa->mask;
124 wa_->mask |= wa->mask;
125 wa_->read |= wa->read;
131 wa_ = &wal->list[wal->count++];
134 while (wa_-- > wal->list) {
135 GEM_BUG_ON(i915_mmio_reg_offset(wa_[0].reg) ==
136 i915_mmio_reg_offset(wa_[1].reg));
137 if (i915_mmio_reg_offset(wa_[1].reg) >
138 i915_mmio_reg_offset(wa_[0].reg))
141 swap(wa_[1], wa_[0]);
146 wa_write_masked_or(struct i915_wa_list *wal, i915_reg_t reg, u32 mask,
149 struct i915_wa wa = {
160 wa_masked_en(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
162 wa_write_masked_or(wal, reg, val, _MASKED_BIT_ENABLE(val));
166 wa_write(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
168 wa_write_masked_or(wal, reg, ~0, val);
172 wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 val)
174 wa_write_masked_or(wal, reg, val, val);
178 ignore_wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 mask, u32 val)
180 struct i915_wa wa = {
184 /* Bonkers HW, skip verifying */
190 #define WA_SET_BIT_MASKED(addr, mask) \
191 wa_write_masked_or(wal, (addr), (mask), _MASKED_BIT_ENABLE(mask))
193 #define WA_CLR_BIT_MASKED(addr, mask) \
194 wa_write_masked_or(wal, (addr), (mask), _MASKED_BIT_DISABLE(mask))
196 #define WA_SET_FIELD_MASKED(addr, mask, value) \
197 wa_write_masked_or(wal, (addr), (mask), _MASKED_FIELD((mask), (value)))
199 static void gen8_ctx_workarounds_init(struct intel_engine_cs *engine,
200 struct i915_wa_list *wal)
202 WA_SET_BIT_MASKED(INSTPM, INSTPM_FORCE_ORDERING);
204 /* WaDisableAsyncFlipPerfMode:bdw,chv */
205 WA_SET_BIT_MASKED(MI_MODE, ASYNC_FLIP_PERF_DISABLE);
207 /* WaDisablePartialInstShootdown:bdw,chv */
208 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
209 PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE);
211 /* Use Force Non-Coherent whenever executing a 3D context. This is a
212 * workaround for for a possible hang in the unlikely event a TLB
213 * invalidation occurs during a PSD flush.
215 /* WaForceEnableNonCoherent:bdw,chv */
216 /* WaHdcDisableFetchWhenMasked:bdw,chv */
217 WA_SET_BIT_MASKED(HDC_CHICKEN0,
218 HDC_DONOT_FETCH_MEM_WHEN_MASKED |
219 HDC_FORCE_NON_COHERENT);
221 /* From the Haswell PRM, Command Reference: Registers, CACHE_MODE_0:
222 * "The Hierarchical Z RAW Stall Optimization allows non-overlapping
223 * polygons in the same 8x4 pixel/sample area to be processed without
224 * stalling waiting for the earlier ones to write to Hierarchical Z
227 * This optimization is off by default for BDW and CHV; turn it on.
229 WA_CLR_BIT_MASKED(CACHE_MODE_0_GEN7, HIZ_RAW_STALL_OPT_DISABLE);
231 /* Wa4x4STCOptimizationDisable:bdw,chv */
232 WA_SET_BIT_MASKED(CACHE_MODE_1, GEN8_4x4_STC_OPTIMIZATION_DISABLE);
235 * BSpec recommends 8x4 when MSAA is used,
236 * however in practice 16x4 seems fastest.
238 * Note that PS/WM thread counts depend on the WIZ hashing
239 * disable bit, which we don't touch here, but it's good
240 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
242 WA_SET_FIELD_MASKED(GEN7_GT_MODE,
243 GEN6_WIZ_HASHING_MASK,
244 GEN6_WIZ_HASHING_16x4);
247 static void bdw_ctx_workarounds_init(struct intel_engine_cs *engine,
248 struct i915_wa_list *wal)
250 struct drm_i915_private *i915 = engine->i915;
252 gen8_ctx_workarounds_init(engine, wal);
254 /* WaDisableThreadStallDopClockGating:bdw (pre-production) */
255 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, STALL_DOP_GATING_DISABLE);
257 /* WaDisableDopClockGating:bdw
259 * Also see the related UCGTCL1 write in broadwell_init_clock_gating()
260 * to disable EUTC clock gating.
262 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
263 DOP_CLOCK_GATING_DISABLE);
265 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
266 GEN8_SAMPLER_POWER_BYPASS_DIS);
268 WA_SET_BIT_MASKED(HDC_CHICKEN0,
269 /* WaForceContextSaveRestoreNonCoherent:bdw */
270 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT |
271 /* WaDisableFenceDestinationToSLM:bdw (pre-prod) */
272 (IS_BDW_GT3(i915) ? HDC_FENCE_DEST_SLM_DISABLE : 0));
275 static void chv_ctx_workarounds_init(struct intel_engine_cs *engine,
276 struct i915_wa_list *wal)
278 gen8_ctx_workarounds_init(engine, wal);
280 /* WaDisableThreadStallDopClockGating:chv */
281 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, STALL_DOP_GATING_DISABLE);
283 /* Improve HiZ throughput on CHV. */
284 WA_SET_BIT_MASKED(HIZ_CHICKEN, CHV_HZ_8X8_MODE_IN_1X);
287 static void gen9_ctx_workarounds_init(struct intel_engine_cs *engine,
288 struct i915_wa_list *wal)
290 struct drm_i915_private *i915 = engine->i915;
293 /* WaCompressedResourceSamplerPbeMediaNewHashMode:skl,kbl
295 * Must match Display Engine. See
296 * WaCompressedResourceDisplayNewHashMode.
298 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
299 GEN9_PBE_COMPRESSED_HASH_SELECTION);
300 WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
301 GEN9_SAMPLER_HASH_COMPRESSED_READ_ADDR);
304 /* WaClearFlowControlGpgpuContextSave:skl,bxt,kbl,glk,cfl */
305 /* WaDisablePartialInstShootdown:skl,bxt,kbl,glk,cfl */
306 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
307 FLOW_CONTROL_ENABLE |
308 PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE);
310 /* Syncing dependencies between camera and graphics:skl,bxt,kbl */
311 if (!IS_COFFEELAKE(i915))
312 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
313 GEN9_DISABLE_OCL_OOB_SUPPRESS_LOGIC);
315 /* WaEnableYV12BugFixInHalfSliceChicken7:skl,bxt,kbl,glk,cfl */
316 /* WaEnableSamplerGPGPUPreemptionSupport:skl,bxt,kbl,cfl */
317 WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
318 GEN9_ENABLE_YV12_BUGFIX |
319 GEN9_ENABLE_GPGPU_PREEMPTION);
321 /* Wa4x4STCOptimizationDisable:skl,bxt,kbl,glk,cfl */
322 /* WaDisablePartialResolveInVc:skl,bxt,kbl,cfl */
323 WA_SET_BIT_MASKED(CACHE_MODE_1,
324 GEN8_4x4_STC_OPTIMIZATION_DISABLE |
325 GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE);
327 /* WaCcsTlbPrefetchDisable:skl,bxt,kbl,glk,cfl */
328 WA_CLR_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN5,
329 GEN9_CCS_TLB_PREFETCH_ENABLE);
331 /* WaForceContextSaveRestoreNonCoherent:skl,bxt,kbl,cfl */
332 WA_SET_BIT_MASKED(HDC_CHICKEN0,
333 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT |
334 HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE);
336 /* WaForceEnableNonCoherent and WaDisableHDCInvalidation are
337 * both tied to WaForceContextSaveRestoreNonCoherent
338 * in some hsds for skl. We keep the tie for all gen9. The
339 * documentation is a bit hazy and so we want to get common behaviour,
340 * even though there is no clear evidence we would need both on kbl/bxt.
341 * This area has been source of system hangs so we play it safe
342 * and mimic the skl regardless of what bspec says.
344 * Use Force Non-Coherent whenever executing a 3D context. This
345 * is a workaround for a possible hang in the unlikely event
346 * a TLB invalidation occurs during a PSD flush.
349 /* WaForceEnableNonCoherent:skl,bxt,kbl,cfl */
350 WA_SET_BIT_MASKED(HDC_CHICKEN0,
351 HDC_FORCE_NON_COHERENT);
353 /* WaDisableSamplerPowerBypassForSOPingPong:skl,bxt,kbl,cfl */
354 if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) || IS_COFFEELAKE(i915))
355 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3,
356 GEN8_SAMPLER_POWER_BYPASS_DIS);
358 /* WaDisableSTUnitPowerOptimization:skl,bxt,kbl,glk,cfl */
359 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN2, GEN8_ST_PO_DISABLE);
362 * Supporting preemption with fine-granularity requires changes in the
363 * batch buffer programming. Since we can't break old userspace, we
364 * need to set our default preemption level to safe value. Userspace is
365 * still able to use more fine-grained preemption levels, since in
366 * WaEnablePreemptionGranularityControlByUMD we're whitelisting the
367 * per-ctx register. As such, WaDisable{3D,GPGPU}MidCmdPreemption are
368 * not real HW workarounds, but merely a way to start using preemption
369 * while maintaining old contract with userspace.
372 /* WaDisable3DMidCmdPreemption:skl,bxt,glk,cfl,[cnl] */
373 WA_CLR_BIT_MASKED(GEN8_CS_CHICKEN1, GEN9_PREEMPT_3D_OBJECT_LEVEL);
375 /* WaDisableGPGPUMidCmdPreemption:skl,bxt,blk,cfl,[cnl] */
376 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
377 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
378 GEN9_PREEMPT_GPGPU_COMMAND_LEVEL);
380 /* WaClearHIZ_WM_CHICKEN3:bxt,glk */
381 if (IS_GEN9_LP(i915))
382 WA_SET_BIT_MASKED(GEN9_WM_CHICKEN3, GEN9_FACTOR_IN_CLR_VAL_HIZ);
385 static void skl_tune_iz_hashing(struct intel_engine_cs *engine,
386 struct i915_wa_list *wal)
388 struct drm_i915_private *i915 = engine->i915;
389 u8 vals[3] = { 0, 0, 0 };
392 for (i = 0; i < 3; i++) {
396 * Only consider slices where one, and only one, subslice has 7
399 if (!is_power_of_2(RUNTIME_INFO(i915)->sseu.subslice_7eu[i]))
403 * subslice_7eu[i] != 0 (because of the check above) and
404 * ss_max == 4 (maximum number of subslices possible per slice)
408 ss = ffs(RUNTIME_INFO(i915)->sseu.subslice_7eu[i]) - 1;
412 if (vals[0] == 0 && vals[1] == 0 && vals[2] == 0)
415 /* Tune IZ hashing. See intel_device_info_runtime_init() */
416 WA_SET_FIELD_MASKED(GEN7_GT_MODE,
417 GEN9_IZ_HASHING_MASK(2) |
418 GEN9_IZ_HASHING_MASK(1) |
419 GEN9_IZ_HASHING_MASK(0),
420 GEN9_IZ_HASHING(2, vals[2]) |
421 GEN9_IZ_HASHING(1, vals[1]) |
422 GEN9_IZ_HASHING(0, vals[0]));
425 static void skl_ctx_workarounds_init(struct intel_engine_cs *engine,
426 struct i915_wa_list *wal)
428 gen9_ctx_workarounds_init(engine, wal);
429 skl_tune_iz_hashing(engine, wal);
432 static void bxt_ctx_workarounds_init(struct intel_engine_cs *engine,
433 struct i915_wa_list *wal)
435 gen9_ctx_workarounds_init(engine, wal);
437 /* WaDisableThreadStallDopClockGating:bxt */
438 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,
439 STALL_DOP_GATING_DISABLE);
441 /* WaToEnableHwFixForPushConstHWBug:bxt */
442 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
443 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
446 static void kbl_ctx_workarounds_init(struct intel_engine_cs *engine,
447 struct i915_wa_list *wal)
449 struct drm_i915_private *i915 = engine->i915;
451 gen9_ctx_workarounds_init(engine, wal);
453 /* WaToEnableHwFixForPushConstHWBug:kbl */
454 if (IS_KBL_REVID(i915, KBL_REVID_C0, REVID_FOREVER))
455 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
456 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
458 /* WaDisableSbeCacheDispatchPortSharing:kbl */
459 WA_SET_BIT_MASKED(GEN7_HALF_SLICE_CHICKEN1,
460 GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE);
463 static void glk_ctx_workarounds_init(struct intel_engine_cs *engine,
464 struct i915_wa_list *wal)
466 gen9_ctx_workarounds_init(engine, wal);
468 /* WaToEnableHwFixForPushConstHWBug:glk */
469 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
470 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
473 static void cfl_ctx_workarounds_init(struct intel_engine_cs *engine,
474 struct i915_wa_list *wal)
476 gen9_ctx_workarounds_init(engine, wal);
478 /* WaToEnableHwFixForPushConstHWBug:cfl */
479 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
480 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
482 /* WaDisableSbeCacheDispatchPortSharing:cfl */
483 WA_SET_BIT_MASKED(GEN7_HALF_SLICE_CHICKEN1,
484 GEN7_SBE_SS_CACHE_DISPATCH_PORT_SHARING_DISABLE);
487 static void cnl_ctx_workarounds_init(struct intel_engine_cs *engine,
488 struct i915_wa_list *wal)
490 struct drm_i915_private *i915 = engine->i915;
492 /* WaForceContextSaveRestoreNonCoherent:cnl */
493 WA_SET_BIT_MASKED(CNL_HDC_CHICKEN0,
494 HDC_FORCE_CONTEXT_SAVE_RESTORE_NON_COHERENT);
496 /* WaThrottleEUPerfToAvoidTDBackPressure:cnl(pre-prod) */
497 if (IS_CNL_REVID(i915, CNL_REVID_B0, CNL_REVID_B0))
498 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, THROTTLE_12_5);
500 /* WaDisableReplayBufferBankArbitrationOptimization:cnl */
501 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
502 GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION);
504 /* WaDisableEnhancedSBEVertexCaching:cnl (pre-prod) */
505 if (IS_CNL_REVID(i915, 0, CNL_REVID_B0))
506 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
507 GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE);
509 /* WaPushConstantDereferenceHoldDisable:cnl */
510 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2, PUSH_CONSTANT_DEREF_DISABLE);
512 /* FtrEnableFastAnisoL1BankingFix:cnl */
513 WA_SET_BIT_MASKED(HALF_SLICE_CHICKEN3, CNL_FAST_ANISO_L1_BANKING_FIX);
515 /* WaDisable3DMidCmdPreemption:cnl */
516 WA_CLR_BIT_MASKED(GEN8_CS_CHICKEN1, GEN9_PREEMPT_3D_OBJECT_LEVEL);
518 /* WaDisableGPGPUMidCmdPreemption:cnl */
519 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
520 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
521 GEN9_PREEMPT_GPGPU_COMMAND_LEVEL);
523 /* WaDisableEarlyEOT:cnl */
524 WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, DISABLE_EARLY_EOT);
527 static void icl_ctx_workarounds_init(struct intel_engine_cs *engine,
528 struct i915_wa_list *wal)
530 struct drm_i915_private *i915 = engine->i915;
532 /* WaDisableBankHangMode:icl */
535 intel_uncore_read(engine->uncore, GEN8_L3CNTLREG) |
538 /* Wa_1604370585:icl (pre-prod)
539 * Formerly known as WaPushConstantDereferenceHoldDisable
541 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
542 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
543 PUSH_CONSTANT_DEREF_DISABLE);
545 /* WaForceEnableNonCoherent:icl
546 * This is not the same workaround as in early Gen9 platforms, where
547 * lacking this could cause system hangs, but coherency performance
548 * overhead is high and only a few compute workloads really need it
549 * (the register is whitelisted in hardware now, so UMDs can opt in
550 * for coherency if they have a good reason).
552 WA_SET_BIT_MASKED(ICL_HDC_MODE, HDC_FORCE_NON_COHERENT);
554 /* Wa_2006611047:icl (pre-prod)
555 * Formerly known as WaDisableImprovedTdlClkGating
557 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
558 WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
559 GEN11_TDL_CLOCK_GATING_FIX_DISABLE);
561 /* Wa_2006665173:icl (pre-prod) */
562 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
563 WA_SET_BIT_MASKED(GEN11_COMMON_SLICE_CHICKEN3,
564 GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC);
566 /* WaEnableFloatBlendOptimization:icl */
567 wa_write_masked_or(wal,
569 0, /* write-only, so skip validation */
570 _MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE));
572 /* WaDisableGPGPUMidThreadPreemption:icl */
573 WA_SET_FIELD_MASKED(GEN8_CS_CHICKEN1,
574 GEN9_PREEMPT_GPGPU_LEVEL_MASK,
575 GEN9_PREEMPT_GPGPU_THREAD_GROUP_LEVEL);
577 /* allow headerless messages for preemptible GPGPU context */
578 WA_SET_BIT_MASKED(GEN10_SAMPLER_MODE,
579 GEN11_SAMPLER_ENABLE_HEADLESS_MSG);
583 __intel_engine_init_ctx_wa(struct intel_engine_cs *engine,
584 struct i915_wa_list *wal,
587 struct drm_i915_private *i915 = engine->i915;
589 if (engine->class != RENDER_CLASS)
592 wa_init_start(wal, name);
594 if (IS_GEN(i915, 11))
595 icl_ctx_workarounds_init(engine, wal);
596 else if (IS_CANNONLAKE(i915))
597 cnl_ctx_workarounds_init(engine, wal);
598 else if (IS_COFFEELAKE(i915))
599 cfl_ctx_workarounds_init(engine, wal);
600 else if (IS_GEMINILAKE(i915))
601 glk_ctx_workarounds_init(engine, wal);
602 else if (IS_KABYLAKE(i915))
603 kbl_ctx_workarounds_init(engine, wal);
604 else if (IS_BROXTON(i915))
605 bxt_ctx_workarounds_init(engine, wal);
606 else if (IS_SKYLAKE(i915))
607 skl_ctx_workarounds_init(engine, wal);
608 else if (IS_CHERRYVIEW(i915))
609 chv_ctx_workarounds_init(engine, wal);
610 else if (IS_BROADWELL(i915))
611 bdw_ctx_workarounds_init(engine, wal);
612 else if (INTEL_GEN(i915) < 8)
615 MISSING_CASE(INTEL_GEN(i915));
620 void intel_engine_init_ctx_wa(struct intel_engine_cs *engine)
622 __intel_engine_init_ctx_wa(engine, &engine->ctx_wa_list, "context");
625 int intel_engine_emit_ctx_wa(struct i915_request *rq)
627 struct i915_wa_list *wal = &rq->engine->ctx_wa_list;
636 ret = rq->engine->emit_flush(rq, EMIT_BARRIER);
640 cs = intel_ring_begin(rq, (wal->count * 2 + 2));
644 *cs++ = MI_LOAD_REGISTER_IMM(wal->count);
645 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
646 *cs++ = i915_mmio_reg_offset(wa->reg);
651 intel_ring_advance(rq, cs);
653 ret = rq->engine->emit_flush(rq, EMIT_BARRIER);
661 gen9_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
663 /* WaDisableKillLogic:bxt,skl,kbl */
664 if (!IS_COFFEELAKE(i915))
670 /* WaCompressedResourceSamplerPbeMediaNewHashMode:skl,kbl
672 * Must match Display Engine. See
673 * WaCompressedResourceDisplayNewHashMode.
677 MMCD_PCLA | MMCD_HOTSPOT_EN);
680 /* WaDisableHDCInvalidation:skl,bxt,kbl,cfl */
683 BDW_DISABLE_HDC_INVALIDATION);
687 skl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
689 gen9_gt_workarounds_init(i915, wal);
691 /* WaDisableGafsUnitClkGating:skl */
694 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
696 /* WaInPlaceDecompressionHang:skl */
697 if (IS_SKL_REVID(i915, SKL_REVID_H0, REVID_FOREVER))
699 GEN9_GAMT_ECO_REG_RW_IA,
700 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
704 bxt_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
706 gen9_gt_workarounds_init(i915, wal);
708 /* WaInPlaceDecompressionHang:bxt */
710 GEN9_GAMT_ECO_REG_RW_IA,
711 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
715 kbl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
717 gen9_gt_workarounds_init(i915, wal);
719 /* WaDisableDynamicCreditSharing:kbl */
720 if (IS_KBL_REVID(i915, 0, KBL_REVID_B0))
723 GAMT_CHKN_DISABLE_DYNAMIC_CREDIT_SHARING);
725 /* WaDisableGafsUnitClkGating:kbl */
728 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
730 /* WaInPlaceDecompressionHang:kbl */
732 GEN9_GAMT_ECO_REG_RW_IA,
733 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
737 glk_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
739 gen9_gt_workarounds_init(i915, wal);
743 cfl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
745 gen9_gt_workarounds_init(i915, wal);
747 /* WaDisableGafsUnitClkGating:cfl */
750 GEN8_EU_GAUNIT_CLOCK_GATE_DISABLE);
752 /* WaInPlaceDecompressionHang:cfl */
754 GEN9_GAMT_ECO_REG_RW_IA,
755 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
759 wa_init_mcr(struct drm_i915_private *i915, struct i915_wa_list *wal)
761 const struct sseu_dev_info *sseu = &RUNTIME_INFO(i915)->sseu;
762 u32 mcr_slice_subslice_mask;
765 * WaProgramMgsrForL3BankSpecificMmioReads: cnl,icl
766 * L3Banks could be fused off in single slice scenario. If that is
767 * the case, we might need to program MCR select to a valid L3Bank
768 * by default, to make sure we correctly read certain registers
769 * later on (in the range 0xB100 - 0xB3FF).
770 * This might be incompatible with
771 * WaProgramMgsrForCorrectSliceSpecificMmioReads.
772 * Fortunately, this should not happen in production hardware, so
773 * we only assert that this is the case (instead of implementing
774 * something more complex that requires checking the range of every
777 if (INTEL_GEN(i915) >= 10 &&
778 is_power_of_2(sseu->slice_mask)) {
780 * read FUSE3 for enabled L3 Bank IDs, if L3 Bank matches
781 * enabled subslice, no need to redirect MCR packet
783 u32 slice = fls(sseu->slice_mask);
785 intel_uncore_read(&i915->uncore, GEN10_MIRROR_FUSE3);
786 u8 ss_mask = sseu->subslice_mask[slice];
788 u8 enabled_mask = (ss_mask | ss_mask >>
789 GEN10_L3BANK_PAIR_COUNT) & GEN10_L3BANK_MASK;
790 u8 disabled_mask = fuse3 & GEN10_L3BANK_MASK;
793 * Production silicon should have matched L3Bank and
796 WARN_ON((enabled_mask & disabled_mask) != enabled_mask);
799 if (INTEL_GEN(i915) >= 11)
800 mcr_slice_subslice_mask = GEN11_MCR_SLICE_MASK |
801 GEN11_MCR_SUBSLICE_MASK;
803 mcr_slice_subslice_mask = GEN8_MCR_SLICE_MASK |
804 GEN8_MCR_SUBSLICE_MASK;
806 * WaProgramMgsrForCorrectSliceSpecificMmioReads:cnl,icl
807 * Before any MMIO read into slice/subslice specific registers, MCR
808 * packet control register needs to be programmed to point to any
809 * enabled s/ss pair. Otherwise, incorrect values will be returned.
810 * This means each subsequent MMIO read will be forwarded to an
811 * specific s/ss combination, but this is OK since these registers
812 * are consistent across s/ss in almost all cases. In the rare
813 * occasions, such as INSTDONE, where this value is dependent
814 * on s/ss combo, the read should be done with read_subslice_reg.
816 wa_write_masked_or(wal,
818 mcr_slice_subslice_mask,
819 intel_calculate_mcr_s_ss_select(i915));
823 cnl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
825 wa_init_mcr(i915, wal);
827 /* WaDisableI2mCycleOnWRPort:cnl (pre-prod) */
828 if (IS_CNL_REVID(i915, CNL_REVID_B0, CNL_REVID_B0))
831 GAMT_CHKN_DISABLE_I2M_CYCLE_ON_WR_PORT);
833 /* WaInPlaceDecompressionHang:cnl */
835 GEN9_GAMT_ECO_REG_RW_IA,
836 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
840 icl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
842 wa_init_mcr(i915, wal);
844 /* WaInPlaceDecompressionHang:icl */
846 GEN9_GAMT_ECO_REG_RW_IA,
847 GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
849 /* WaModifyGamTlbPartitioning:icl */
850 wa_write_masked_or(wal,
851 GEN11_GACB_PERF_CTRL,
852 GEN11_HASH_CTRL_MASK,
853 GEN11_HASH_CTRL_BIT0 | GEN11_HASH_CTRL_BIT4);
856 * Formerly known as WaCL2SFHalfMaxAlloc
860 GEN11_LSN_UNSLCVC_GAFS_HALF_SF_MAXALLOC |
861 GEN11_LSN_UNSLCVC_GAFS_HALF_CL2_MAXALLOC);
864 * Formerly known as WaDisCtxReload
867 GEN8_GAMW_ECO_DEV_RW_IA,
868 GAMW_ECO_DEV_CTX_RELOAD_DISABLE);
870 /* Wa_1405779004:icl (pre-prod) */
871 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_A0))
873 SLICE_UNIT_LEVEL_CLKGATE,
874 MSCUNIT_CLKGATE_DIS);
876 /* Wa_1406680159:icl */
878 SUBSLICE_UNIT_LEVEL_CLKGATE,
881 /* Wa_1406838659:icl (pre-prod) */
882 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
884 INF_UNIT_LEVEL_CLKGATE,
888 * Formerly known as WaGamTlbPendError
892 GAMT_CHKN_DISABLE_L3_COH_PIPE);
896 gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal)
898 if (IS_GEN(i915, 11))
899 icl_gt_workarounds_init(i915, wal);
900 else if (IS_CANNONLAKE(i915))
901 cnl_gt_workarounds_init(i915, wal);
902 else if (IS_COFFEELAKE(i915))
903 cfl_gt_workarounds_init(i915, wal);
904 else if (IS_GEMINILAKE(i915))
905 glk_gt_workarounds_init(i915, wal);
906 else if (IS_KABYLAKE(i915))
907 kbl_gt_workarounds_init(i915, wal);
908 else if (IS_BROXTON(i915))
909 bxt_gt_workarounds_init(i915, wal);
910 else if (IS_SKYLAKE(i915))
911 skl_gt_workarounds_init(i915, wal);
912 else if (INTEL_GEN(i915) <= 8)
915 MISSING_CASE(INTEL_GEN(i915));
918 void intel_gt_init_workarounds(struct drm_i915_private *i915)
920 struct i915_wa_list *wal = &i915->gt_wa_list;
922 wa_init_start(wal, "GT");
923 gt_init_workarounds(i915, wal);
927 static enum forcewake_domains
928 wal_get_fw_for_rmw(struct intel_uncore *uncore, const struct i915_wa_list *wal)
930 enum forcewake_domains fw = 0;
934 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
935 fw |= intel_uncore_forcewake_for_reg(uncore,
944 wa_verify(const struct i915_wa *wa, u32 cur, const char *name, const char *from)
946 if ((cur ^ wa->val) & wa->read) {
947 DRM_ERROR("%s workaround lost on %s! (%x=%x/%x, expected %x, mask=%x)\n",
948 name, from, i915_mmio_reg_offset(wa->reg),
959 wa_list_apply(struct intel_uncore *uncore, const struct i915_wa_list *wal)
961 enum forcewake_domains fw;
969 fw = wal_get_fw_for_rmw(uncore, wal);
971 spin_lock_irqsave(&uncore->lock, flags);
972 intel_uncore_forcewake_get__locked(uncore, fw);
974 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
975 intel_uncore_rmw_fw(uncore, wa->reg, wa->mask, wa->val);
976 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
978 intel_uncore_read_fw(uncore, wa->reg),
979 wal->name, "application");
982 intel_uncore_forcewake_put__locked(uncore, fw);
983 spin_unlock_irqrestore(&uncore->lock, flags);
986 void intel_gt_apply_workarounds(struct drm_i915_private *i915)
988 wa_list_apply(&i915->uncore, &i915->gt_wa_list);
991 static bool wa_list_verify(struct intel_uncore *uncore,
992 const struct i915_wa_list *wal,
999 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1001 intel_uncore_read(uncore, wa->reg),
1007 bool intel_gt_verify_workarounds(struct drm_i915_private *i915,
1010 return wa_list_verify(&i915->uncore, &i915->gt_wa_list, from);
1014 whitelist_reg(struct i915_wa_list *wal, i915_reg_t reg)
1016 struct i915_wa wa = {
1020 if (GEM_DEBUG_WARN_ON(wal->count >= RING_MAX_NONPRIV_SLOTS))
1026 static void gen9_whitelist_build(struct i915_wa_list *w)
1028 /* WaVFEStateAfterPipeControlwithMediaStateClear:skl,bxt,glk,cfl */
1029 whitelist_reg(w, GEN9_CTX_PREEMPT_REG);
1031 /* WaEnablePreemptionGranularityControlByUMD:skl,bxt,kbl,cfl,[cnl] */
1032 whitelist_reg(w, GEN8_CS_CHICKEN1);
1034 /* WaAllowUMDToModifyHDCChicken1:skl,bxt,kbl,glk,cfl */
1035 whitelist_reg(w, GEN8_HDC_CHICKEN1);
1038 static void skl_whitelist_build(struct i915_wa_list *w)
1040 gen9_whitelist_build(w);
1042 /* WaDisableLSQCROPERFforOCL:skl */
1043 whitelist_reg(w, GEN8_L3SQCREG4);
1046 static void bxt_whitelist_build(struct i915_wa_list *w)
1048 gen9_whitelist_build(w);
1051 static void kbl_whitelist_build(struct i915_wa_list *w)
1053 gen9_whitelist_build(w);
1055 /* WaDisableLSQCROPERFforOCL:kbl */
1056 whitelist_reg(w, GEN8_L3SQCREG4);
1059 static void glk_whitelist_build(struct i915_wa_list *w)
1061 gen9_whitelist_build(w);
1063 /* WA #0862: Userspace has to set "Barrier Mode" to avoid hangs. */
1064 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);
1067 static void cfl_whitelist_build(struct i915_wa_list *w)
1069 gen9_whitelist_build(w);
1072 static void cnl_whitelist_build(struct i915_wa_list *w)
1074 /* WaEnablePreemptionGranularityControlByUMD:cnl */
1075 whitelist_reg(w, GEN8_CS_CHICKEN1);
1078 static void icl_whitelist_build(struct i915_wa_list *w)
1080 /* WaAllowUMDToModifyHalfSliceChicken7:icl */
1081 whitelist_reg(w, GEN9_HALF_SLICE_CHICKEN7);
1083 /* WaAllowUMDToModifySamplerMode:icl */
1084 whitelist_reg(w, GEN10_SAMPLER_MODE);
1086 /* WaEnableStateCacheRedirectToCS:icl */
1087 whitelist_reg(w, GEN9_SLICE_COMMON_ECO_CHICKEN1);
1090 void intel_engine_init_whitelist(struct intel_engine_cs *engine)
1092 struct drm_i915_private *i915 = engine->i915;
1093 struct i915_wa_list *w = &engine->whitelist;
1095 if (engine->class != RENDER_CLASS)
1098 wa_init_start(w, "whitelist");
1100 if (IS_GEN(i915, 11))
1101 icl_whitelist_build(w);
1102 else if (IS_CANNONLAKE(i915))
1103 cnl_whitelist_build(w);
1104 else if (IS_COFFEELAKE(i915))
1105 cfl_whitelist_build(w);
1106 else if (IS_GEMINILAKE(i915))
1107 glk_whitelist_build(w);
1108 else if (IS_KABYLAKE(i915))
1109 kbl_whitelist_build(w);
1110 else if (IS_BROXTON(i915))
1111 bxt_whitelist_build(w);
1112 else if (IS_SKYLAKE(i915))
1113 skl_whitelist_build(w);
1114 else if (INTEL_GEN(i915) <= 8)
1117 MISSING_CASE(INTEL_GEN(i915));
1122 void intel_engine_apply_whitelist(struct intel_engine_cs *engine)
1124 const struct i915_wa_list *wal = &engine->whitelist;
1125 struct intel_uncore *uncore = engine->uncore;
1126 const u32 base = engine->mmio_base;
1133 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1134 intel_uncore_write(uncore,
1135 RING_FORCE_TO_NONPRIV(base, i),
1136 i915_mmio_reg_offset(wa->reg));
1138 /* And clear the rest just in case of garbage */
1139 for (; i < RING_MAX_NONPRIV_SLOTS; i++)
1140 intel_uncore_write(uncore,
1141 RING_FORCE_TO_NONPRIV(base, i),
1142 i915_mmio_reg_offset(RING_NOPID(base)));
1146 rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1148 struct drm_i915_private *i915 = engine->i915;
1150 if (IS_GEN(i915, 11)) {
1151 /* This is not an Wa. Enable for better image quality */
1154 _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE);
1156 /* WaPipelineFlushCoherentLines:icl */
1157 ignore_wa_write_or(wal,
1159 GEN8_LQSC_FLUSH_COHERENT_LINES,
1160 GEN8_LQSC_FLUSH_COHERENT_LINES);
1164 * Formerly known as WaGAPZPriorityScheme
1168 GEN11_ARBITRATION_PRIO_ORDER_MASK);
1172 * Formerly known as WaL3BankAddressHashing
1174 wa_write_masked_or(wal,
1176 GEN11_HASH_CTRL_EXCL_MASK,
1177 GEN11_HASH_CTRL_EXCL_BIT0);
1178 wa_write_masked_or(wal,
1180 GEN11_BANK_HASH_ADDR_EXCL_MASK,
1181 GEN11_BANK_HASH_ADDR_EXCL_BIT0);
1185 * Formerly known as WaDisableCleanEvicts
1187 ignore_wa_write_or(wal,
1189 GEN11_LQSC_CLEAN_EVICT_DISABLE,
1190 GEN11_LQSC_CLEAN_EVICT_DISABLE);
1192 /* WaForwardProgressSoftReset:icl */
1194 GEN10_SCRATCH_LNCF2,
1195 PMFLUSHDONE_LNICRSDROP |
1196 PMFLUSH_GAPL3UNBLOCK |
1197 PMFLUSHDONE_LNEBLK);
1199 /* Wa_1406609255:icl (pre-prod) */
1200 if (IS_ICL_REVID(i915, ICL_REVID_A0, ICL_REVID_B0))
1203 GEN7_DISABLE_DEMAND_PREFETCH |
1204 GEN7_DISABLE_SAMPLER_PREFETCH);
1207 if (IS_GEN_RANGE(i915, 9, 11)) {
1208 /* FtrPerCtxtPreemptionGranularityControl:skl,bxt,kbl,cfl,cnl,icl */
1210 GEN7_FF_SLICE_CS_CHICKEN1,
1211 GEN9_FFSC_PERCTX_PREEMPT_CTRL);
1214 if (IS_SKYLAKE(i915) || IS_KABYLAKE(i915) || IS_COFFEELAKE(i915)) {
1215 /* WaEnableGapsTsvCreditFix:skl,kbl,cfl */
1218 GEN9_GAPS_TSV_CREDIT_DISABLE);
1221 if (IS_BROXTON(i915)) {
1222 /* WaDisablePooledEuLoadBalancingFix:bxt */
1224 FF_SLICE_CS_CHICKEN2,
1225 GEN9_POOLED_EU_LOAD_BALANCING_FIX_DISABLE);
1228 if (IS_GEN(i915, 9)) {
1229 /* WaContextSwitchWithConcurrentTLBInvalidate:skl,bxt,kbl,glk,cfl */
1231 GEN9_CSFE_CHICKEN1_RCS,
1232 GEN9_PREEMPT_GPGPU_SYNC_SWITCH_DISABLE);
1234 /* WaEnableLbsSlaRetryTimerDecrement:skl,bxt,kbl,glk,cfl */
1237 GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE);
1239 /* WaProgramL3SqcReg1DefaultForPerf:bxt,glk */
1240 if (IS_GEN9_LP(i915))
1241 wa_write_masked_or(wal,
1243 L3_PRIO_CREDITS_MASK,
1244 L3_GENERAL_PRIO_CREDITS(62) |
1245 L3_HIGH_PRIO_CREDITS(2));
1247 /* WaOCLCoherentLineFlush:skl,bxt,kbl,cfl */
1250 GEN8_LQSC_FLUSH_COHERENT_LINES);
1255 xcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1257 struct drm_i915_private *i915 = engine->i915;
1259 /* WaKBLVECSSemaphoreWaitPoll:kbl */
1260 if (IS_KBL_REVID(i915, KBL_REVID_A0, KBL_REVID_E0)) {
1262 RING_SEMA_WAIT_POLL(engine->mmio_base),
1268 engine_init_workarounds(struct intel_engine_cs *engine, struct i915_wa_list *wal)
1270 if (I915_SELFTEST_ONLY(INTEL_GEN(engine->i915) < 8))
1273 if (engine->id == RCS0)
1274 rcs_engine_wa_init(engine, wal);
1276 xcs_engine_wa_init(engine, wal);
1279 void intel_engine_init_workarounds(struct intel_engine_cs *engine)
1281 struct i915_wa_list *wal = &engine->wa_list;
1283 if (GEM_WARN_ON(INTEL_GEN(engine->i915) < 8))
1286 wa_init_start(wal, engine->name);
1287 engine_init_workarounds(engine, wal);
1288 wa_init_finish(wal);
1291 void intel_engine_apply_workarounds(struct intel_engine_cs *engine)
1293 wa_list_apply(engine->uncore, &engine->wa_list);
1296 static struct i915_vma *
1297 create_scratch(struct i915_address_space *vm, int count)
1299 struct drm_i915_gem_object *obj;
1300 struct i915_vma *vma;
1304 size = round_up(count * sizeof(u32), PAGE_SIZE);
1305 obj = i915_gem_object_create_internal(vm->i915, size);
1307 return ERR_CAST(obj);
1309 i915_gem_object_set_cache_coherency(obj, I915_CACHE_LLC);
1311 vma = i915_vma_instance(obj, vm, NULL);
1317 err = i915_vma_pin(vma, 0, 0,
1318 i915_vma_is_ggtt(vma) ? PIN_GLOBAL : PIN_USER);
1325 i915_gem_object_put(obj);
1326 return ERR_PTR(err);
1330 wa_list_srm(struct i915_request *rq,
1331 const struct i915_wa_list *wal,
1332 struct i915_vma *vma)
1334 const struct i915_wa *wa;
1338 srm = MI_STORE_REGISTER_MEM | MI_SRM_LRM_GLOBAL_GTT;
1339 if (INTEL_GEN(rq->i915) >= 8)
1342 cs = intel_ring_begin(rq, 4 * wal->count);
1346 for (i = 0, wa = wal->list; i < wal->count; i++, wa++) {
1348 *cs++ = i915_mmio_reg_offset(wa->reg);
1349 *cs++ = i915_ggtt_offset(vma) + sizeof(u32) * i;
1352 intel_ring_advance(rq, cs);
1357 static int engine_wa_list_verify(struct intel_context *ce,
1358 const struct i915_wa_list * const wal,
1361 const struct i915_wa *wa;
1362 struct i915_request *rq;
1363 struct i915_vma *vma;
1371 vma = create_scratch(&ce->engine->i915->ggtt.vm, wal->count);
1373 return PTR_ERR(vma);
1375 rq = intel_context_create_request(ce);
1381 err = wa_list_srm(rq, wal, vma);
1385 i915_request_add(rq);
1386 if (i915_request_wait(rq, I915_WAIT_LOCKED, HZ / 5) < 0) {
1391 results = i915_gem_object_pin_map(vma->obj, I915_MAP_WB);
1392 if (IS_ERR(results)) {
1393 err = PTR_ERR(results);
1398 for (i = 0, wa = wal->list; i < wal->count; i++, wa++)
1399 if (!wa_verify(wa, results[i], wal->name, from))
1402 i915_gem_object_unpin_map(vma->obj);
1405 i915_vma_unpin(vma);
1410 int intel_engine_verify_workarounds(struct intel_engine_cs *engine,
1413 return engine_wa_list_verify(engine->kernel_context,
1418 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
1419 #include "selftest_workarounds.c"