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

drm/i915: Enable provoking vertex fix on Gen9 systems.

The SF and clipper units mishandle the provoking vertex in some cases,
which can cause misrendering with shaders that use flat shaded inputs.

There are chicken bits in 3D_CHICKEN3 (for SF) and FF_SLICE_CHICKEN
(for the clipper) that work around the issue. These registers are
unfortunately not part of the logical context (even the power context),
and so we must reload them every time we start executing in a context.

Bugzilla: https://bugs.freedesktop.org/103047
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180615190605.16238-1-chris@chris-wilson.co.uk
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: stable@vger.kernel.org

authored by

Kenneth Graunke and committed by
Chris Wilson
b77422f8 f677bd55

+16 -1
+5
drivers/gpu/drm/i915/i915_reg.h
··· 2432 2432 #define _3D_CHICKEN _MMIO(0x2084) 2433 2433 #define _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB (1 << 10) 2434 2434 #define _3D_CHICKEN2 _MMIO(0x208c) 2435 + 2436 + #define FF_SLICE_CHICKEN _MMIO(0x2088) 2437 + #define FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX (1 << 1) 2438 + 2435 2439 /* Disables pipelining of read flushes past the SF-WIZ interface. 2436 2440 * Required on all Ironlake steppings according to the B-Spec, but the 2437 2441 * particular danger of not doing so is not specified. 2438 2442 */ 2439 2443 # define _3D_CHICKEN2_WM_READ_PIPELINED (1 << 14) 2440 2444 #define _3D_CHICKEN3 _MMIO(0x2090) 2445 + #define _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX (1 << 12) 2441 2446 #define _3D_CHICKEN_SF_DISABLE_OBJEND_CULL (1 << 10) 2442 2447 #define _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE (1 << 5) 2443 2448 #define _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL (1 << 5)
+11 -1
drivers/gpu/drm/i915/intel_lrc.c
··· 1573 1573 /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */ 1574 1574 batch = gen8_emit_flush_coherentl3_wa(engine, batch); 1575 1575 1576 + *batch++ = MI_LOAD_REGISTER_IMM(3); 1577 + 1576 1578 /* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */ 1577 - *batch++ = MI_LOAD_REGISTER_IMM(1); 1578 1579 *batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2); 1579 1580 *batch++ = _MASKED_BIT_DISABLE( 1580 1581 GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE); 1582 + 1583 + /* BSpec: 11391 */ 1584 + *batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN); 1585 + *batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX); 1586 + 1587 + /* BSpec: 11299 */ 1588 + *batch++ = i915_mmio_reg_offset(_3D_CHICKEN3); 1589 + *batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX); 1590 + 1581 1591 *batch++ = MI_NOOP; 1582 1592 1583 1593 /* WaClearSlmSpaceAtContextSwitch:kbl */