Skip to content

Commit fd2599b

Browse files
icklejlahtine-intel
authored andcommitted
drm/i915/gt: Move snb GT workarounds from init_clock_gating to workarounds
Rescue the GT workarounds from being buried inside init_clock_gating so that we remember to apply them after a GT reset, and that they are included in our verification that the workarounds are applied. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit c3b93a9) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 695a2b1 commit fd2599b

File tree

2 files changed

+41
-33
lines changed

2 files changed

+41
-33
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,45 @@ int intel_engine_emit_ctx_wa(struct i915_request *rq)
692692
return 0;
693693
}
694694

695+
static void
696+
snb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
697+
{
698+
/* WaDisableHiZPlanesWhenMSAAEnabled:snb */
699+
wa_masked_en(wal,
700+
_3D_CHICKEN,
701+
_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB);
702+
703+
/* WaDisable_RenderCache_OperationalFlush:snb */
704+
wa_masked_dis(wal, CACHE_MODE_0, RC_OP_FLUSH_ENABLE);
705+
706+
/*
707+
* BSpec recommends 8x4 when MSAA is used,
708+
* however in practice 16x4 seems fastest.
709+
*
710+
* Note that PS/WM thread counts depend on the WIZ hashing
711+
* disable bit, which we don't touch here, but it's good
712+
* to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
713+
*/
714+
wa_add(wal,
715+
GEN6_GT_MODE, 0,
716+
_MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4),
717+
GEN6_WIZ_HASHING_16x4);
718+
719+
wa_masked_dis(wal, CACHE_MODE_0, CM0_STC_EVICT_DISABLE_LRA_SNB);
720+
721+
wa_masked_en(wal,
722+
_3D_CHICKEN3,
723+
/* WaStripsFansDisableFastClipPerformanceFix:snb */
724+
_3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL |
725+
/*
726+
* Bspec says:
727+
* "This bit must be set if 3DSTATE_CLIP clip mode is set
728+
* to normal and 3DSTATE_SF number of SF output attributes
729+
* is more than 16."
730+
*/
731+
_3D_CHICKEN3_SF_DISABLE_PIPELINED_ATTR_FETCH);
732+
}
733+
695734
static void
696735
ivb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
697736
{
@@ -1132,6 +1171,8 @@ gt_init_workarounds(struct drm_i915_private *i915, struct i915_wa_list *wal)
11321171
vlv_gt_workarounds_init(i915, wal);
11331172
else if (IS_IVYBRIDGE(i915))
11341173
ivb_gt_workarounds_init(i915, wal);
1174+
else if (IS_GEN(i915, 6))
1175+
snb_gt_workarounds_init(i915, wal);
11351176
else if (INTEL_GEN(i915) <= 8)
11361177
return;
11371178
else

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6902,27 +6902,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *dev_priv)
69026902
I915_READ(ILK_DISPLAY_CHICKEN2) |
69036903
ILK_ELPIN_409_SELECT);
69046904

6905-
/* WaDisableHiZPlanesWhenMSAAEnabled:snb */
6906-
I915_WRITE(_3D_CHICKEN,
6907-
_MASKED_BIT_ENABLE(_3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB));
6908-
6909-
/* WaDisable_RenderCache_OperationalFlush:snb */
6910-
I915_WRITE(CACHE_MODE_0, _MASKED_BIT_DISABLE(RC_OP_FLUSH_ENABLE));
6911-
6912-
/*
6913-
* BSpec recoomends 8x4 when MSAA is used,
6914-
* however in practice 16x4 seems fastest.
6915-
*
6916-
* Note that PS/WM thread counts depend on the WIZ hashing
6917-
* disable bit, which we don't touch here, but it's good
6918-
* to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
6919-
*/
6920-
I915_WRITE(GEN6_GT_MODE,
6921-
_MASKED_FIELD(GEN6_WIZ_HASHING_MASK, GEN6_WIZ_HASHING_16x4));
6922-
6923-
I915_WRITE(CACHE_MODE_0,
6924-
_MASKED_BIT_DISABLE(CM0_STC_EVICT_DISABLE_LRA_SNB));
6925-
69266905
I915_WRITE(GEN6_UCGCTL1,
69276906
I915_READ(GEN6_UCGCTL1) |
69286907
GEN6_BLBUNIT_CLOCK_GATE_DISABLE |
@@ -6945,18 +6924,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *dev_priv)
69456924
GEN6_RCPBUNIT_CLOCK_GATE_DISABLE |
69466925
GEN6_RCCUNIT_CLOCK_GATE_DISABLE);
69476926

6948-
/* WaStripsFansDisableFastClipPerformanceFix:snb */
6949-
I915_WRITE(_3D_CHICKEN3,
6950-
_MASKED_BIT_ENABLE(_3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL));
6951-
6952-
/*
6953-
* Bspec says:
6954-
* "This bit must be set if 3DSTATE_CLIP clip mode is set to normal and
6955-
* 3DSTATE_SF number of SF output attributes is more than 16."
6956-
*/
6957-
I915_WRITE(_3D_CHICKEN3,
6958-
_MASKED_BIT_ENABLE(_3D_CHICKEN3_SF_DISABLE_PIPELINED_ATTR_FETCH));
6959-
69606927
/*
69616928
* According to the spec the following bits should be
69626929
* set in order to enable memory self-refresh and fbc:

0 commit comments

Comments
 (0)