Skip to content

Commit cc38cae

Browse files
Oscar Mateomikuint
authored andcommitted
drm/i915/icl: Introduce initial Icelake Workarounds
Inherit workarounds from previous platforms that are still valid for Icelake. v2: GEN7_ROW_CHICKEN2 is masked v3: - Since it has been fixed already in upstream, removed the TODO comment about WA_SET_BIT for WaInPlaceDecompressionHang. - Squashed with this patch: drm/i915/icl: add icelake_init_clock_gating() from Paulo Zanoni <paulo.r.zanoni@intel.com> - Squashed with this patch: drm/i915/icl: WaForceEnableNonCoherent from Oscar Mateo <oscar.mateo@intel.com> - WaPushConstantDereferenceHoldDisable is now Wa_1604370585 and applies to B0 as well. - WaPipeControlBefore3DStateSamplePattern WABB was being applied to ICL incorrectly. v4: - Wrap the commit message - s/dev_priv/p to please checkpatch v5: Rebased on top of the WA refactoring v6: Rebased on top of further whitelist registers refactoring (Michel) v7: Added WaRsForcewakeAddDelayForAck v8: s/ICL_HDC_CHICKEN0/ICL_HDC_MODE (Mika) v9: - C, not lisp (Chris) - WaIncreaseDefaultTLBEntries is the same for GEN > 9_LP (Tvrtko) Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Tomasz Lis <tomasz.lis@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/1525814984-20039-2-git-send-email-oscar.mateo@intel.com
1 parent ca6acc2 commit cc38cae

7 files changed

Lines changed: 69 additions & 6 deletions

File tree

‎drivers/gpu/drm/i915/i915_drv.h‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,6 +2470,15 @@ intel_info(const struct drm_i915_private *dev_priv)
24702470
#define IS_CNL_REVID(p, since, until) \
24712471
(IS_CANNONLAKE(p) && IS_REVID(p, since, until))
24722472

2473+
#define ICL_REVID_A0 0x0
2474+
#define ICL_REVID_A2 0x1
2475+
#define ICL_REVID_B0 0x3
2476+
#define ICL_REVID_B2 0x4
2477+
#define ICL_REVID_C0 0x5
2478+
2479+
#define IS_ICL_REVID(p, since, until) \
2480+
(IS_ICELAKE(p) && IS_REVID(p, since, until))
2481+
24732482
/*
24742483
* The genX designation typically refers to the render engine, so render
24752484
* capability related checks should use IS_GEN, while display and other checks

‎drivers/gpu/drm/i915/i915_gem_gtt.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2138,15 +2138,15 @@ static void gtt_write_workarounds(struct drm_i915_private *dev_priv)
21382138
* called on driver load and after a GPU reset, so you can place
21392139
* workarounds here even if they get overwritten by GPU reset.
21402140
*/
2141-
/* WaIncreaseDefaultTLBEntries:chv,bdw,skl,bxt,kbl,glk,cfl,cnl */
2141+
/* WaIncreaseDefaultTLBEntries:chv,bdw,skl,bxt,kbl,glk,cfl,cnl,icl */
21422142
if (IS_BROADWELL(dev_priv))
21432143
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_BDW);
21442144
else if (IS_CHERRYVIEW(dev_priv))
21452145
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN8_L3_LRA_1_GPGPU_DEFAULT_VALUE_CHV);
2146-
else if (IS_GEN9_BC(dev_priv) || IS_GEN10(dev_priv))
2147-
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
21482146
else if (IS_GEN9_LP(dev_priv))
21492147
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT);
2148+
else if (INTEL_GEN(dev_priv) >= 9)
2149+
I915_WRITE(GEN8_L3_LRA_1_GPGPU, GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL);
21502150

21512151
/*
21522152
* To support 64K PTEs we need to first enable the use of the

‎drivers/gpu/drm/i915/i915_reg.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7238,6 +7238,7 @@ enum {
72387238
/* GEN8 chicken */
72397239
#define HDC_CHICKEN0 _MMIO(0x7300)
72407240
#define CNL_HDC_CHICKEN0 _MMIO(0xE5F0)
7241+
#define ICL_HDC_MODE _MMIO(0xE5F4)
72417242
#define HDC_FORCE_CSR_NON_COHERENT_OVR_DISABLE (1<<15)
72427243
#define HDC_FENCE_DEST_SLM_DISABLE (1<<14)
72437244
#define HDC_DONOT_FETCH_MEM_WHEN_MASKED (1<<11)

‎drivers/gpu/drm/i915/intel_lrc.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,6 +1682,8 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
16821682
return -EINVAL;
16831683

16841684
switch (INTEL_GEN(engine->i915)) {
1685+
case 11:
1686+
return 0;
16851687
case 10:
16861688
wa_bb_fn[0] = gen10_init_indirectctx_bb;
16871689
wa_bb_fn[1] = NULL;

‎drivers/gpu/drm/i915/intel_pm.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9190,7 +9190,9 @@ static void nop_init_clock_gating(struct drm_i915_private *dev_priv)
91909190
*/
91919191
void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
91929192
{
9193-
if (IS_CANNONLAKE(dev_priv))
9193+
if (IS_ICELAKE(dev_priv))
9194+
dev_priv->display.init_clock_gating = nop_init_clock_gating;
9195+
else if (IS_CANNONLAKE(dev_priv))
91949196
dev_priv->display.init_clock_gating = cnl_init_clock_gating;
91959197
else if (IS_COFFEELAKE(dev_priv))
91969198
dev_priv->display.init_clock_gating = cfl_init_clock_gating;

‎drivers/gpu/drm/i915/intel_uncore.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ fw_domain_wait_ack_with_fallback(const struct drm_i915_private *i915,
139139
* in the hope that the original ack will be delivered along with
140140
* the fallback ack.
141141
*
142-
* This workaround is described in HSDES #1604254524
142+
* This workaround is described in HSDES #1604254524 and it's known as:
143+
* WaRsForcewakeAddDelayForAck:skl,bxt,kbl,glk,cfl,cnl,icl
144+
* although the name is a bit misleading.
143145
*/
144146

145147
pass = 1;
@@ -1394,7 +1396,8 @@ static void intel_uncore_fw_domains_init(struct drm_i915_private *dev_priv)
13941396
if (INTEL_GEN(dev_priv) >= 11) {
13951397
int i;
13961398

1397-
dev_priv->uncore.funcs.force_wake_get = fw_domains_get;
1399+
dev_priv->uncore.funcs.force_wake_get =
1400+
fw_domains_get_with_fallback;
13981401
dev_priv->uncore.funcs.force_wake_put = fw_domains_put;
13991402
fw_domain_init(dev_priv, FW_DOMAIN_ID_RENDER,
14001403
FORCEWAKE_RENDER_GEN9,

‎drivers/gpu/drm/i915/intel_workarounds.c‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,27 @@ static int cnl_ctx_workarounds_init(struct drm_i915_private *dev_priv)
441441
return 0;
442442
}
443443

444+
static int icl_ctx_workarounds_init(struct drm_i915_private *dev_priv)
445+
{
446+
/* Wa_1604370585:icl (pre-prod)
447+
* Formerly known as WaPushConstantDereferenceHoldDisable
448+
*/
449+
if (IS_ICL_REVID(dev_priv, ICL_REVID_A0, ICL_REVID_B0))
450+
WA_SET_BIT_MASKED(GEN7_ROW_CHICKEN2,
451+
PUSH_CONSTANT_DEREF_DISABLE);
452+
453+
/* WaForceEnableNonCoherent:icl
454+
* This is not the same workaround as in early Gen9 platforms, where
455+
* lacking this could cause system hangs, but coherency performance
456+
* overhead is high and only a few compute workloads really need it
457+
* (the register is whitelisted in hardware now, so UMDs can opt in
458+
* for coherency if they have a good reason).
459+
*/
460+
WA_SET_BIT_MASKED(ICL_HDC_MODE, HDC_FORCE_NON_COHERENT);
461+
462+
return 0;
463+
}
464+
444465
int intel_ctx_workarounds_init(struct drm_i915_private *dev_priv)
445466
{
446467
int err = 0;
@@ -465,6 +486,8 @@ int intel_ctx_workarounds_init(struct drm_i915_private *dev_priv)
465486
err = cfl_ctx_workarounds_init(dev_priv);
466487
else if (IS_CANNONLAKE(dev_priv))
467488
err = cnl_ctx_workarounds_init(dev_priv);
489+
else if (IS_ICELAKE(dev_priv))
490+
err = icl_ctx_workarounds_init(dev_priv);
468491
else
469492
MISSING_CASE(INTEL_GEN(dev_priv));
470493
if (err)
@@ -663,6 +686,21 @@ static void cnl_gt_workarounds_apply(struct drm_i915_private *dev_priv)
663686
_MASKED_BIT_ENABLE(GEN9_FFSC_PERCTX_PREEMPT_CTRL));
664687
}
665688

689+
static void icl_gt_workarounds_apply(struct drm_i915_private *dev_priv)
690+
{
691+
/* This is not an Wa. Enable for better image quality */
692+
I915_WRITE(_3D_CHICKEN3,
693+
_MASKED_BIT_ENABLE(_3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE));
694+
695+
/* WaInPlaceDecompressionHang:icl */
696+
I915_WRITE(GEN9_GAMT_ECO_REG_RW_IA, I915_READ(GEN9_GAMT_ECO_REG_RW_IA) |
697+
GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
698+
699+
/* WaPipelineFlushCoherentLines:icl */
700+
I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) |
701+
GEN8_LQSC_FLUSH_COHERENT_LINES);
702+
}
703+
666704
void intel_gt_workarounds_apply(struct drm_i915_private *dev_priv)
667705
{
668706
if (INTEL_GEN(dev_priv) < 8)
@@ -683,6 +721,8 @@ void intel_gt_workarounds_apply(struct drm_i915_private *dev_priv)
683721
cfl_gt_workarounds_apply(dev_priv);
684722
else if (IS_CANNONLAKE(dev_priv))
685723
cnl_gt_workarounds_apply(dev_priv);
724+
else if (IS_ICELAKE(dev_priv))
725+
icl_gt_workarounds_apply(dev_priv);
686726
else
687727
MISSING_CASE(INTEL_GEN(dev_priv));
688728
}
@@ -761,6 +801,10 @@ static void cnl_whitelist_build(struct whitelist *w)
761801
whitelist_reg(w, GEN8_CS_CHICKEN1);
762802
}
763803

804+
static void icl_whitelist_build(struct whitelist *w)
805+
{
806+
}
807+
764808
static struct whitelist *whitelist_build(struct intel_engine_cs *engine,
765809
struct whitelist *w)
766810
{
@@ -789,6 +833,8 @@ static struct whitelist *whitelist_build(struct intel_engine_cs *engine,
789833
cfl_whitelist_build(w);
790834
else if (IS_CANNONLAKE(i915))
791835
cnl_whitelist_build(w);
836+
else if (IS_ICELAKE(i915))
837+
icl_whitelist_build(w);
792838
else
793839
MISSING_CASE(INTEL_GEN(i915));
794840

0 commit comments

Comments
 (0)