Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Remove WaDisableLSQCROPERFforOCL KBL workaround.

The WaDisableLSQCROPERFforOCL workaround has the side effect of
disabling an L3SQ optimization that has huge performance implications
and is unlikely to be necessary for the correct functioning of usual
graphic workloads. Userspace is free to re-enable the workaround on
demand, and is generally in a better position to determine whether the
workaround is necessary than the DRM is (e.g. only during the
execution of compute kernels that rely on both L3 fences and HDC R/W
requests).

The same workaround seems to apply to BDW (at least to production
stepping G1) and SKL as well (the internal workaround database claims
that it does for all steppings, while the BSpec workaround table only
mentions pre-production steppings), but the DRM doesn't do anything
beyond whitelisting the L3SQCREG4 register so userspace can enable it
when it sees fit. Do the same on KBL platforms.

Improves performance of the GFXBench4 gl_manhattan31 benchmark by 60%,
and gl_4 (AKA car chase) by 14% on a KBL GT2 running Mesa master --
This is followed by a regression of 35% and 10% respectively for the
same benchmarks and platform caused by my recent patch series
switching userspace to use the dataport constant cache instead of the
sampler to implement uniform pull constant loads, which caused us to
hit more heavily the L3 cache (and on platforms other than KBL had the
opposite effect of improving performance of the same two benchmarks).
The overall effect on KBL of this change combined with the recent
userspace change is respectively 4.6% and 2.6%. SynMark2 OglShMapPcf
was affected by the constant cache changes (though it improved as it
did on other platforms rather than regressing), but is not
significantly affected by this patch (with statistical significance of
5% and sample size 20).

v2: Drop some more code to avoid unused variable warning.

Fixes: 738fa1b3123f ("drm/i915/kbl: Add WaDisableLSQCROPERFforOCL")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99256
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
Cc: Matthew Auld <matthew.william.auld@gmail.com>
Cc: Eero Tamminen <eero.t.tamminen@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: beignet@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v4.7+
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
[Removed double Fixes tag]
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1484217894-20505-1-git-send-email-mika.kuoppala@intel.com
(cherry picked from commit 8726f2faa371514fba2f594d799db95203dfeee0)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

authored by

Francisco Jerez and committed by
Jani Nikula
4fc020d8 f80c2fb6

-18
-10
drivers/gpu/drm/i915/intel_lrc.c
··· 979 979 uint32_t *batch, 980 980 uint32_t index) 981 981 { 982 - struct drm_i915_private *dev_priv = engine->i915; 983 982 uint32_t l3sqc4_flush = (0x40400000 | GEN8_LQSC_FLUSH_COHERENT_LINES); 984 - 985 - /* 986 - * WaDisableLSQCROPERFforOCL:kbl 987 - * This WA is implemented in skl_init_clock_gating() but since 988 - * this batch updates GEN8_L3SQCREG4 with default value we need to 989 - * set this bit here to retain the WA during flush. 990 - */ 991 - if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_E0)) 992 - l3sqc4_flush |= GEN8_LQSC_RO_PERF_DIS; 993 983 994 984 wa_ctx_emit(batch, index, (MI_STORE_REGISTER_MEM_GEN8 | 995 985 MI_SRM_LRM_GLOBAL_GTT));
-8
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 1095 1095 WA_SET_BIT_MASKED(HDC_CHICKEN0, 1096 1096 HDC_FENCE_DEST_SLM_DISABLE); 1097 1097 1098 - /* GEN8_L3SQCREG4 has a dependency with WA batch so any new changes 1099 - * involving this register should also be added to WA batch as required. 1100 - */ 1101 - if (IS_KBL_REVID(dev_priv, 0, KBL_REVID_E0)) 1102 - /* WaDisableLSQCROPERFforOCL:kbl */ 1103 - I915_WRITE(GEN8_L3SQCREG4, I915_READ(GEN8_L3SQCREG4) | 1104 - GEN8_LQSC_RO_PERF_DIS); 1105 - 1106 1098 /* WaToEnableHwFixForPushConstHWBug:kbl */ 1107 1099 if (IS_KBL_REVID(dev_priv, KBL_REVID_C0, REVID_FOREVER)) 1108 1100 WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,