drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
Subsystems (2)
PATCH 1/2 drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
WaProgramMgsrForCorrectSliceSpecificMmioReads dictate that before any MMIO read into Slice/Subslice specific registers, MCR packet control register(0xFDC) needs to be programmed to point to any enabled slice/subslice pair. Otherwise, incorrect value will be returned.
However, that means each subsequent MMIO read will be forwarded to a specific slice/subslice combination as read is unicast. This is OK since slice/subslice specific register values are consistent in almost all cases across slice/subslice. There are rare occasions such as INSTDONE that this value will be dependent on slice/subslice combo, in such cases, we need to program 0xFDC and recover this after. This is already covered by read_subslice_reg for INSTDONE.
Also, 0xFDC will lose its information after TDR/engine reset/power state change.
--- drivers/gpu/drm/i915/intel_engine_cs.c | 43 ++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +41 -2
@@ -781,6 +781,29 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type) } } +static u32 calculate_mcr (u32 mcr,struct drm_i915_private *dev_priv) +{ +const struct sseu_dev_info *sseu = &(INTEL_INFO (dev_priv)->sseu); +u32 slice =find_last_bit ((unsigned long *)&(sseu->slice_mask), +sizeof (sseu->slice_mask)); +u32 subslice =find_last_bit ((unsigned long *)&(sseu->subslice_mask[slice]), +sizeof (sseu->subslice_mask[0 ])); + + mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); + mcr |=GEN8_MCR_SLICE (slice) |GEN8_MCR_SUBSLICE (subslice); + +return mcr; +} + +static void wa_init_mcr (struct drm_i915_private *dev_priv) +{ +u32 mcr; + + mcr =I915_READ (GEN8_MCR_SELECTOR ); + mcr =calculate_mcr (mcr, dev_priv); +I915_WRITE (GEN8_MCR_SELECTOR , mcr); +} +static inline uint32_t read_subslice_reg (struct drm_i915_private *dev_priv,int slice,int subslice,i915_reg_t reg)
@@ -799,18 +822,31 @@ read_subslice_reg(struct drm_i915_private *dev_priv, int slice,intel_uncore_forcewake_get__locked (dev_priv, fw_domains); mcr =I915_READ_FW (GEN8_MCR_SELECTOR ); +/* * The HW expects the slice and sublice selectors to be reset to 0 * after reading out the registers. */ -WARN_ON_ONCE (mcr & (GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK )); +if (INTEL_GEN (dev_priv) <10 ) +WARN_ON_ONCE (mcr & (GEN8_MCR_SLICE_MASK | +GEN8_MCR_SUBSLICE_MASK )); + mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); mcr |=GEN8_MCR_SLICE (slice) |GEN8_MCR_SUBSLICE (subslice);I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr); ret =I915_READ_FW (reg); - mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); +/* +* WaProgramMgsrForCorrectSliceSpecificMmioReads:cnl +* expects mcr to be programed to a enabled slice/subslice pair +* before any MMIO read into slice/subslice register +*/ +if (INTEL_GEN (dev_priv) <10 ) + mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); +else + mcr =calculate_mcr (mcr, dev_priv); +I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr);intel_uncore_forcewake_put__locked (dev_priv, fw_domains);
@@ -1278,6 +1314,9 @@ static int cnl_init_workarounds(struct intel_engine_cs *engine)struct drm_i915_private *dev_priv = engine->i915;int ret; +/* WaProgramMgsrForCorrectSliceSpecificMmioReads: cnl */ +wa_init_mcr (dev_priv); +/* WaDisableI2mCycleOnWRPort:cnl (pre-prod) */ if (IS_CNL_REVID (dev_priv,CNL_REVID_B0 ,CNL_REVID_B0 )) I915_WRITE(GAMT_CHKN_BIT_REG,
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: Implement WaProgramMgsrForL3BankSpecificMmioReads
L3Bank could be fused off in hardware for debug purpose, and it is possible that subslice is enabled while its corresponding L3Bank pairs are disabled. In such case, if MCR packet control register(0xFDC) is programed to point to a disabled bank pair, a MMIO read into L3Bank range will return 0 instead of correct values.
However, this is not going to be the case in any production silicon. Therefore, we only check at initialization and issue a warning should this really happen.
--- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_engine_cs.c | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+)
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -2849,6 +2849,10 @@ enum i915_power_well_id {#define GEN10_F2_SS_DIS_SHIFT 18#define GEN10_F2_SS_DIS_MASK (0xf << GEN10_F2_SS_DIS_SHIFT) +#define GEN10_MIRROR_FUSE3 _MMIO(0x9118) +#define GEN10_L3BANK_PAIR_COUNT 4 +#define GEN10_L3BANK_MASK 0x0F +#define GEN8_EU_DISABLE0 _MMIO(0x9134)#define GEN8_EU_DIS0_S0_MASK 0xffffff#define GEN8_EU_DIS0_S1_SHIFT 24
drivers/gpu/drm/i915/intel_engine_cs.c +19 -0
@@ -798,7 +798,26 @@ static u32 calculate_mcr(u32 mcr, struct drm_i915_private *dev_priv)static void wa_init_mcr (struct drm_i915_private *dev_priv) {u32 mcr; +u32 fuse3; +const struct sseu_dev_info *sseu = &(INTEL_INFO (dev_priv)->sseu); +u32 slice; +/* If more than one slice are enabled, L3Banks should be all enabled */ +if (hweight8 (sseu->slice_mask) ==1 ) { +/* +* WaProgramMgsrForL3BankSpecificMmioReads: +* read FUSE3 for enabled L3 Bank IDs, if L3 Bank matches +* enabled subslice, no need to redirect MCR packet +*/ + slice =find_last_bit ((unsigned long *)&(sseu->slice_mask), +sizeof (sseu->slice_mask)); + fuse3 =I915_READ (GEN10_MIRROR_FUSE3 ); +if (WARN_ON (!((fuse3 &GEN10_L3BANK_MASK ) + & ((sseu->subslice_mask[slice] + | sseu->subslice_mask[slice]>>GEN10_L3BANK_PAIR_COUNT ) + &GEN10_L3BANK_MASK )))) +DRM_WARN ("Real silicon should have matched L3Bank and subslice enabled\n" ); + } mcr =I915_READ (GEN8_MCR_SELECTOR ); mcr =calculate_mcr (mcr, dev_priv);I915_WRITE (GEN8_MCR_SELECTOR , mcr);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
In reply to Yunwei Zhang== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
URL : https://patchwork.freedesktop.org/series/39992/
State : success
== Summary ==
Series 39992v1 series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
https://patchwork.freedesktop.org/api/1.0/series/39992/revisions/1/mbox/
---- Known issues:
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
pass -> INCOMPLETE (fi-bxt-dsi) fdo#103927fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:440s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:444s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:382s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:540s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:297s fi-bxt-dsi total:243 pass:216 dwarn:0 dfail:0 fail:0 skip:26 fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:519s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:503s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:411s fi-cfl-s2 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:587s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:511s fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:585s fi-elk-e7500 total:285 pass:226 dwarn:0 dfail:0 fail:0 skip:59 time:429s fi-gdg-551 total:285 pass:176 dwarn:0 dfail:0 fail:1 skip:108 time:320s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:402s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:425s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:475s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:427s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:477s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:469s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:515s fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:654s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:442s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:528s fi-skl-6700hq total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:542s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:506s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:496s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:429s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:588s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:403s
Blacklisted hosts:
fi-cnl-drrs total:285 pass:243 dwarn:14 dfail:0 fail:0 skip:28 time:519s
178cfb9373cc2bdfcb6ca73e03369d2c37cc4b58 drm-tip: 2018y-03m-14d-21h-38m-09s UTC integration manifest 8dab9a7c7110 drm/i915: Implement WaProgramMgsrForL3BankSpecificMmioReads 1a52c6e6d006 drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8356/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
In reply to Yunwei Zhang== Series Details ==
== Series Details ==
Series: series starting with [1/2] drm/i915/cnl: Implement WaProgramMgsrForCorrectSliceSpecificMmioReads
URL : https://patchwork.freedesktop.org/series/39992/
State : success
== Summary ==
---- Possible new issues:
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-pri-shrfb-draw-render:
fail -> PASS (shard-apl)---- Known issues:
Test kms_flip:
Subgroup 2x-plain-flip-ts-check:
pass -> FAIL (shard-hsw) fdo#100368
Subgroup flip-vs-expired-vblank-interruptible:
fail -> PASS (shard-hsw) fdo#102887fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
shard-apl total:3406 pass:1801 dwarn:1 dfail:0 fail:7 skip:1595 time:12677s shard-hsw total:3441 pass:1766 dwarn:1 dfail:0 fail:2 skip:1671 time:11795s shard-snb total:3441 pass:1357 dwarn:1 dfail:0 fail:2 skip:2081 time:7162s
Blacklisted hosts:
shard-kbl total:3366 pass:1899 dwarn:2 dfail:0 fail:9 skip:1454 time:9302s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8356/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx