diff options
author | Mika Kuoppala <mika.kuoppala@linux.intel.com> | 2015-10-12 06:20:59 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-10-13 11:41:57 -0400 |
commit | 9c4cbf8212e8d8be4bc6e16cc2c21af2bbaab2c1 (patch) | |
tree | c09bfad284010e32c9229841dcdbdb0e97711705 /drivers/gpu/drm/i915/intel_ringbuffer.c | |
parent | ef55f92a92eee54238e16269823a52cfcbb2330c (diff) |
drm/i915: Move skl/bxt gt specific workarounds to ring init
Some registers are, naturally, lost in gpu reset/suspend cycle.
And some registers, for example in display domain, are not subject
to gpu reset so they retain their contents.
As hang recovery triggers a reset, recoverable gpu hang can currently
flush out essential workarounds and cause havoc later on.
When register GEN8_GARBNTL is missing the WaEnableGapsTsvCreditFix:skl,
it can cause random system hangs [1]. This workaround was added in:
commit 245d96670d26 ("drm/i915:skl: Add WaEnableGapsTsvCreditFix")
But another set of system hangs were observed and the failure pattern
indicated that there was random gpu hang preceding the system hang [2].
This lead to the realization that we lose this workaround and BDW_SCRATCH1
on reset.
Add these workarounds setup in display init to skl/bxt ring init
where LRI workarounds are also setup. This way their setup is not
dependent on display side init.
References: [1] https://bugs.freedesktop.org/show_bug.cgi?id=90854
References: [2] https://bugs.freedesktop.org/show_bug.cgi?id=92315
Reported-by: Tomi Sarvela <tomix.p.sarvela@intel.com>
Cc: Tomi Sarvela <tomix.p.sarvela@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Tested-by: Tomi Sarvela <tomix.p.sarvela@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 654ae991ea13..0359736fe979 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -906,6 +906,14 @@ static int gen9_init_workarounds(struct intel_engine_cs *ring) | |||
906 | struct drm_i915_private *dev_priv = dev->dev_private; | 906 | struct drm_i915_private *dev_priv = dev->dev_private; |
907 | uint32_t tmp; | 907 | uint32_t tmp; |
908 | 908 | ||
909 | /* WaEnableLbsSlaRetryTimerDecrement:skl */ | ||
910 | I915_WRITE(BDW_SCRATCH1, I915_READ(BDW_SCRATCH1) | | ||
911 | GEN9_LBS_SLA_RETRY_TIMER_DECREMENT_ENABLE); | ||
912 | |||
913 | /* WaDisableKillLogic:bxt,skl */ | ||
914 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | | ||
915 | ECOCHK_DIS_TLB); | ||
916 | |||
909 | /* WaDisablePartialInstShootdown:skl,bxt */ | 917 | /* WaDisablePartialInstShootdown:skl,bxt */ |
910 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, | 918 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, |
911 | PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE); | 919 | PARTIAL_INSTRUCTION_SHOOTDOWN_DISABLE); |
@@ -1018,7 +1026,6 @@ static int skl_tune_iz_hashing(struct intel_engine_cs *ring) | |||
1018 | return 0; | 1026 | return 0; |
1019 | } | 1027 | } |
1020 | 1028 | ||
1021 | |||
1022 | static int skl_init_workarounds(struct intel_engine_cs *ring) | 1029 | static int skl_init_workarounds(struct intel_engine_cs *ring) |
1023 | { | 1030 | { |
1024 | int ret; | 1031 | int ret; |
@@ -1029,6 +1036,30 @@ static int skl_init_workarounds(struct intel_engine_cs *ring) | |||
1029 | if (ret) | 1036 | if (ret) |
1030 | return ret; | 1037 | return ret; |
1031 | 1038 | ||
1039 | if (INTEL_REVID(dev) <= SKL_REVID_D0) { | ||
1040 | /* WaDisableHDCInvalidation:skl */ | ||
1041 | I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) | | ||
1042 | BDW_DISABLE_HDC_INVALIDATION); | ||
1043 | |||
1044 | /* WaDisableChickenBitTSGBarrierAckForFFSliceCS:skl */ | ||
1045 | I915_WRITE(FF_SLICE_CS_CHICKEN2, | ||
1046 | _MASKED_BIT_ENABLE(GEN9_TSG_BARRIER_ACK_DISABLE)); | ||
1047 | } | ||
1048 | |||
1049 | /* GEN8_L3SQCREG4 has a dependency with WA batch so any new changes | ||
1050 | * involving this register should also be added to WA batch as required. | ||
1051 | */ | ||
1052 | if (INTEL_REVID(dev) <= SKL_REVID_E0) | ||
1053 | /* WaDisableLSQCROPERFforOCL:skl */ | ||
1054 | I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) | | ||
1055 | GEN8_LQSC_RO_PERF_DIS); | ||
1056 | |||
1057 | /* WaEnableGapsTsvCreditFix:skl */ | ||
1058 | if (IS_SKYLAKE(dev) && (INTEL_REVID(dev) >= SKL_REVID_C0)) { | ||
1059 | I915_WRITE(GEN8_GARBCNTL, (I915_READ(GEN8_GARBCNTL) | | ||
1060 | GEN9_GAPS_TSV_CREDIT_DISABLE)); | ||
1061 | } | ||
1062 | |||
1032 | /* WaDisablePowerCompilerClockGating:skl */ | 1063 | /* WaDisablePowerCompilerClockGating:skl */ |
1033 | if (INTEL_REVID(dev) == SKL_REVID_B0) | 1064 | if (INTEL_REVID(dev) == SKL_REVID_B0) |
1034 | WA_SET_BIT_MASKED(HIZ_CHICKEN, | 1065 | WA_SET_BIT_MASKED(HIZ_CHICKEN, |
@@ -1072,6 +1103,17 @@ static int bxt_init_workarounds(struct intel_engine_cs *ring) | |||
1072 | if (ret) | 1103 | if (ret) |
1073 | return ret; | 1104 | return ret; |
1074 | 1105 | ||
1106 | /* WaStoreMultiplePTEenable:bxt */ | ||
1107 | /* This is a requirement according to Hardware specification */ | ||
1108 | if (INTEL_REVID(dev) == BXT_REVID_A0) | ||
1109 | I915_WRITE(TILECTL, I915_READ(TILECTL) | TILECTL_TLBPF); | ||
1110 | |||
1111 | /* WaSetClckGatingDisableMedia:bxt */ | ||
1112 | if (INTEL_REVID(dev) == BXT_REVID_A0) { | ||
1113 | I915_WRITE(GEN7_MISCCPCTL, (I915_READ(GEN7_MISCCPCTL) & | ||
1114 | ~GEN8_DOP_CLOCK_GATE_MEDIA_ENABLE)); | ||
1115 | } | ||
1116 | |||
1075 | /* WaDisableThreadStallDopClockGating:bxt */ | 1117 | /* WaDisableThreadStallDopClockGating:bxt */ |
1076 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, | 1118 | WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN, |
1077 | STALL_DOP_GATING_DISABLE); | 1119 | STALL_DOP_GATING_DISABLE); |