Skip to contentSkip to conversation

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

PATCH In review Kenneth Graunke 4 participants 14 messages Jun 14, 2018 – Jun 18, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

This patch sets both bits, and bumps the number of allowed workaround registers to avoid running out of space (thanks to Chris Wilson for helping debug that issue).

I am not aware of any workaround names or numbers assigned for these issues, they're simply recommended in the documentation for each of the registers.

Bugzilla: https://bugs.freedesktop.org/103047

---
 drivers/gpu/drm/i915/i915_drv.h          | 2 +-
 drivers/gpu/drm/i915/i915_reg.h          | 5 +++++
 drivers/gpu/drm/i915/intel_workarounds.c | 6 ++++++
 3 files changed, 12 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -1
index 19defe73b156..8828780a1773 100644
@@ -1309,7 +1309,7 @@ struct i915_wa_reg {
 	u32 mask;
 };
 
-#define I915_MAX_WA_REGS 16
+#define I915_MAX_WA_REGS 17
 
 struct i915_workarounds {
 	struct i915_wa_reg reg[I915_MAX_WA_REGS];
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 140f6a27d696..35d8c2be85be 100644
@@ -2432,12 +2432,17 @@ enum i915_power_well_id {
 #define _3D_CHICKEN	_MMIO(0x2084)
 #define  _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB	(1 << 10)
 #define _3D_CHICKEN2	_MMIO(0x208c)
+
+#define FF_SLICE_CHICKEN	_MMIO(0x2088)
+#define  FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX	(1 << 1)
+
 /* Disables pipelining of read flushes past the SF-WIZ interface.
  * Required on all Ironlake steppings according to the B-Spec, but the
  * particular danger of not doing so is not specified.
  */
 # define _3D_CHICKEN2_WM_READ_PIPELINED			(1 << 14)
 #define _3D_CHICKEN3	_MMIO(0x2090)
+#define  _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX		(1 << 12)
 #define  _3D_CHICKEN_SF_DISABLE_OBJEND_CULL		(1 << 10)
 #define  _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE	(1 << 5)
 #define  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL		(1 << 5)
drivers/gpu/drm/i915/intel_workarounds.c +6 -0
index 24b929ce3341..2dea23bfd5ea 100644
@@ -274,6 +274,12 @@ static int gen9_ctx_workarounds_init(struct drm_i915_private *dev_priv)
 	if (IS_GEN9_LP(dev_priv))
 		WA_SET_BIT_MASKED(GEN9_WM_CHICKEN3, GEN9_FACTOR_IN_CLR_VAL_HIZ);
 
+	/* BSpec: 11391 */
+	WA_SET_BIT_MASKED(FF_SLICE_CHICKEN,
+			  FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+	/* BSpec: 11299 */
+	WA_SET_BIT_MASKED(_3D_CHICKEN3, _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);
+
 	return 0;
 }
 
Signature · 6 lines
2.17.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: Enable provoking vertex fix on Gen9+ systems.

== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems.
URL : https://patchwork.freedesktop.org/series/44781/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
1fee0a9a8734 drm/i915: Enable provoking vertex fix on Gen9+ systems.
-:74: ERROR:MISSING_SIGN_OFF: Missing Signed-off-by: line(s)

total: 1 errors, 0 warnings, 0 checks, 37 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems.

In reply to Kenneth Graunke
== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems.
URL : https://patchwork.freedesktop.org/series/44781/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4322 -> Patchwork_9312 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_9312 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9312, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44781/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9312:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_workarounds@basic-read:
      fi-skl-6260u:       PASS -> FAIL
      fi-cfl-s3:          PASS -> FAIL
      fi-skl-6700k2:      PASS -> FAIL
      fi-skl-6770hq:      PASS -> FAIL
      fi-kbl-7560u:       PASS -> FAIL
      fi-skl-6600u:       PASS -> FAIL
      fi-bxt-dsi:         PASS -> FAIL
      fi-kbl-guc:         PASS -> FAIL
      fi-kbl-7500u:       PASS -> FAIL
      fi-skl-6700hq:      PASS -> FAIL
      fi-bxt-j4205:       PASS -> FAIL
      fi-skl-gvtdvm:      PASS -> FAIL
      fi-cfl-guc:         PASS -> FAIL
      {fi-whl-u}:         PASS -> FAIL
      fi-cfl-8700k:       PASS -> FAIL
      fi-glk-j4005:       PASS -> FAIL
      fi-skl-guc:         PASS -> FAIL
      fi-kbl-7567u:       PASS -> FAIL
      fi-kbl-r:           PASS -> FAIL

== Known issues ==

Here are the changes found in Patchwork_9312 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106238)

    
    ==== Possible fixes ====

    igt@drv_module_reload@basic-no-display:
      fi-glk-j4005:       DMESG-WARN (fdo#106725) -> PASS

    igt@kms_flip@basic-plain-flip:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106238 https://bugs.freedesktop.org/show_bug.cgi?id=106238
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725

== Participating hosts (43 -> 38) ==

Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u

== Build changes ==

* Linux: CI_DRM_4322 -> Patchwork_9312

CI_DRM_4322: 485f975b0c64f2a3c9b0bf116a63adc3c6389b1f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4519: 3381a56be31defb3b5c23a4fbc19ac26a000c35b @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9312: 1fee0a9a87341a7346106e5a2463571a68496f4a @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

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

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9312/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: ✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems.

Quoting Patchwork (2018-06-14 23:53:30)

Quoted 41 lines

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems.
URL : https://patchwork.freedesktop.org/series/44781/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4322 -> Patchwork_9312 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_9312 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9312, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44781/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9312:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_workarounds@basic-read:
      fi-skl-6260u:       PASS -> FAIL
      fi-cfl-s3:          PASS -> FAIL
      fi-skl-6700k2:      PASS -> FAIL
      fi-skl-6770hq:      PASS -> FAIL
      fi-kbl-7560u:       PASS -> FAIL
      fi-skl-6600u:       PASS -> FAIL
      fi-bxt-dsi:         PASS -> FAIL
      fi-kbl-guc:         PASS -> FAIL
      fi-kbl-7500u:       PASS -> FAIL
      fi-skl-6700hq:      PASS -> FAIL
      fi-bxt-j4205:       PASS -> FAIL
Quoted 8 lines
      fi-skl-gvtdvm:      PASS -> FAIL
      fi-cfl-guc:         PASS -> FAIL
      {fi-whl-u}:         PASS -> FAIL
      fi-cfl-8700k:       PASS -> FAIL
      fi-glk-j4005:       PASS -> FAIL
      fi-skl-guc:         PASS -> FAIL
      fi-kbl-7567u:       PASS -> FAIL
      fi-kbl-r:           PASS -> FAIL

(gem_workarounds:3828) DEBUG: Address val mask read result
(gem_workarounds:3828) DEBUG: 0x07014 0x20002000 0x00002000 0x00002000 OK
(gem_workarounds:3828) DEBUG: 0x0E194 0x01000100 0x00000100 0x00000114 OK
(gem_workarounds:3828) DEBUG: 0x0E4F0 0x81008100 0x00008100 0xFFFF8120 OK
(gem_workarounds:3828) DEBUG: 0x0E184 0x00200020 0x00000020 0x00000022 OK
(gem_workarounds:3828) DEBUG: 0x0E194 0x00140014 0x00000014 0x00000114 OK
(gem_workarounds:3828) DEBUG: 0x07004 0x00420042 0x00000042 0x000029C2 OK
(gem_workarounds:3828) DEBUG: 0x0E188 0x00080000 0x00000008 0x00008030 OK
(gem_workarounds:3828) DEBUG: 0x07300 0x80208020 0x00008020 0x00008830 OK
(gem_workarounds:3828) DEBUG: 0x07300 0x00100010 0x00000010 0x00008830 OK
(gem_workarounds:3828) DEBUG: 0x0E184 0x00020002 0x00000002 0x00000022 OK
(gem_workarounds:3828) DEBUG: 0x0E180 0x20002000 0x00002000 0x00002000 OK
(gem_workarounds:3828) DEBUG: 0x02580 0x00010000 0x00000001 0x00000004 OK
(gem_workarounds:3828) DEBUG: 0x02580 0x00060004 0x00000006 0x00000004 OK
(gem_workarounds:3828) WARNING: 0x02088 0x00020002 0x00000002 0x00000000 FAIL
(gem_workarounds:3828) WARNING: 0x02090 0x10001000 0x00001000 0x00000000 FAIL

The 2 writes didn't stick. Not context saved? Or something even more peculiar?

(Look at all those repeated register writes, no wonder we ran out of space.)
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Re: ✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems.

Quoting Chris Wilson (2018-06-15 08:16:01)

Quoted 68 lines

Quoting Patchwork (2018-06-14 23:53:30)

Quoted 41 lines

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems.
URL : https://patchwork.freedesktop.org/series/44781/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4322 -> Patchwork_9312 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_9312 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9312, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44781/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9312:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_workarounds@basic-read:
      fi-skl-6260u:       PASS -> FAIL
      fi-cfl-s3:          PASS -> FAIL
      fi-skl-6700k2:      PASS -> FAIL
      fi-skl-6770hq:      PASS -> FAIL
      fi-kbl-7560u:       PASS -> FAIL
      fi-skl-6600u:       PASS -> FAIL
      fi-bxt-dsi:         PASS -> FAIL
      fi-kbl-guc:         PASS -> FAIL
      fi-kbl-7500u:       PASS -> FAIL
      fi-skl-6700hq:      PASS -> FAIL
      fi-bxt-j4205:       PASS -> FAIL
Quoted 8 lines
      fi-skl-gvtdvm:      PASS -> FAIL
      fi-cfl-guc:         PASS -> FAIL
      {fi-whl-u}:         PASS -> FAIL
      fi-cfl-8700k:       PASS -> FAIL
      fi-glk-j4005:       PASS -> FAIL
      fi-skl-guc:         PASS -> FAIL
      fi-kbl-7567u:       PASS -> FAIL
      fi-kbl-r:           PASS -> FAIL
(gem_workarounds:3828) DEBUG: Address   val             mask            read            result
(gem_workarounds:3828) DEBUG: 0x07014   0x20002000      0x00002000      0x00002000      OK
(gem_workarounds:3828) DEBUG: 0x0E194   0x01000100      0x00000100      0x00000114      OK
(gem_workarounds:3828) DEBUG: 0x0E4F0   0x81008100      0x00008100      0xFFFF8120      OK
(gem_workarounds:3828) DEBUG: 0x0E184   0x00200020      0x00000020      0x00000022      OK
(gem_workarounds:3828) DEBUG: 0x0E194   0x00140014      0x00000014      0x00000114      OK
(gem_workarounds:3828) DEBUG: 0x07004   0x00420042      0x00000042      0x000029C2      OK
(gem_workarounds:3828) DEBUG: 0x0E188   0x00080000      0x00000008      0x00008030      OK
(gem_workarounds:3828) DEBUG: 0x07300   0x80208020      0x00008020      0x00008830      OK
(gem_workarounds:3828) DEBUG: 0x07300   0x00100010      0x00000010      0x00008830      OK
(gem_workarounds:3828) DEBUG: 0x0E184   0x00020002      0x00000002      0x00000022      OK
(gem_workarounds:3828) DEBUG: 0x0E180   0x20002000      0x00002000      0x00002000      OK
(gem_workarounds:3828) DEBUG: 0x02580   0x00010000      0x00000001      0x00000004      OK
(gem_workarounds:3828) DEBUG: 0x02580   0x00060004      0x00000006      0x00000004      OK
(gem_workarounds:3828) WARNING: 0x02088 0x00020002      0x00000002      0x00000000      FAIL
(gem_workarounds:3828) WARNING: 0x02090 0x10001000      0x00001000      0x00000000      FAIL
Quoted 2 lines

The 2 writes didn't stick. Not context saved? Or something even more peculiar?

More sinister. The LRI never expected so many registers! -Chris
_______________________________________________
Intel-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#5 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems.

In reply to Kenneth Graunke
== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems.
URL : https://patchwork.freedesktop.org/series/44781/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4325 -> Patchwork_9328 =

== Summary - FAILURE ==

Serious unknown changes coming with Patchwork_9328 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9328, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44781/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9328:

=== IGT changes ===

    ==== Possible regressions ====

    igt@gem_workarounds@basic-read:
      fi-skl-6260u:       PASS -> FAIL
      fi-cfl-s3:          PASS -> FAIL
      fi-skl-6700k2:      PASS -> FAIL
      fi-skl-6770hq:      PASS -> FAIL
      fi-kbl-7560u:       PASS -> FAIL
      fi-skl-6600u:       PASS -> FAIL
      fi-bxt-dsi:         PASS -> FAIL
      fi-kbl-guc:         PASS -> FAIL
      fi-kbl-7500u:       PASS -> FAIL
      fi-skl-6700hq:      PASS -> FAIL
      fi-bxt-j4205:       PASS -> FAIL
      fi-skl-gvtdvm:      PASS -> FAIL
      fi-cfl-guc:         PASS -> FAIL
      {fi-whl-u}:         PASS -> FAIL
      fi-cfl-8700k:       PASS -> FAIL
      fi-glk-j4005:       PASS -> FAIL
      fi-skl-guc:         PASS -> FAIL
      fi-kbl-7567u:       PASS -> FAIL
      fi-kbl-r:           PASS -> FAIL

== Known issues ==

Here are the changes found in Patchwork_9328 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@kms_pipe_crc_basic@bad-source:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106238)

    igt@pm_rpm@basic-rte:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106097)

    
    ==== Possible fixes ====

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       DMESG-WARN (fdo#106097) -> PASS +1

    igt@kms_pipe_crc_basic@read-crc-pipe-c-frame-sequence:
      fi-glk-j4005:       DMESG-WARN (fdo#106000, fdo#106097) -> PASS

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
fdo#106238 https://bugs.freedesktop.org/show_bug.cgi?id=106238

== Participating hosts (43 -> 38) ==

Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u

== Build changes ==

* Linux: CI_DRM_4325 -> Patchwork_9328

CI_DRM_4325: 4275ebe85ad179007c49b7bcf78d340b7681871e @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4520: 91f5d4665b07f073c78abd3cd4b8e0e347dbf638 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9328: da50a83a608b97e04d4953e56ddc22100dd8d2e1 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

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

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9328/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw
In reply to Kenneth Graunke

Quoting Kenneth Graunke (2018-06-14 22:53:28)

Quoted 6 lines

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).

Indeed they are not. And that explains why we lose them in CI, my kbl never seems to powerdown and so never loses them. But an LRI from userspace to them is enough for their contents to be lost, and we never recover.

So that rules out using the context image to store these registers, and we need to add a payload to every batch. We may get away with just using the per-context wa, to load the registers every time we switch into a context (and so also on load from idle).

Instead we need:

drivers/gpu/drm/i915/intel_lrc.c +11 -1
index e935f8c45db8..46c93ccd36f3 100644
@@ -1565,11 +1565,21 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
        /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
        batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+       *batch++ = MI_LOAD_REGISTER_IMM(3);
+
        /* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */
-       *batch++ = MI_LOAD_REGISTER_IMM(1);
        *batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2);
        *batch++ = _MASKED_BIT_DISABLE(
                        GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE);
+
+       /* BSpec: 11391 */
+       *batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN);
+       *batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+
+       /* BSpec: 11299 */
+       *batch++ = i915_mmio_reg_offset(_3D_CHICKEN3);
+       *batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);
+
        *batch++ = MI_NOOP;
 
        /* WaClearSlmSpaceAtContextSwitch:kbl */

How crummy.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev2)

In reply to Kenneth Graunke
== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev2)
URL : https://patchwork.freedesktop.org/series/44781/
State : failure

== Summary ==

Applying: drm/i915: Enable provoking vertex fix on Gen9+ systems.
error: patch failed: drivers/gpu/drm/i915/intel_lrc.c:1565
error: drivers/gpu/drm/i915/intel_lrc.c: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/intel_lrc.c
Patch failed at 0001 drm/i915: Enable provoking vertex fix on Gen9+ systems. Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

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

In reply to Kenneth Graunke

From: Kenneth Graunke <[email protected]>

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

---

This is only being set for gen9 right now, do we need it for gen10+? Ken, I also need your s-o-b.

An open question is how to record such w/a for easy checking from userspace. Though something like this might be better as part of an independent verification tool.
-Chris

---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
 drivers/gpu/drm/i915/intel_lrc.c | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index b8c0ebd50889..54ec7ab57ce8 100644
@@ -2432,12 +2432,17 @@ enum i915_power_well_id {
 #define _3D_CHICKEN	_MMIO(0x2084)
 #define  _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB	(1 << 10)
 #define _3D_CHICKEN2	_MMIO(0x208c)
+
+#define FF_SLICE_CHICKEN	_MMIO(0x2088)
+#define  FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX	(1 << 1)
+
 /* Disables pipelining of read flushes past the SF-WIZ interface.
  * Required on all Ironlake steppings according to the B-Spec, but the
  * particular danger of not doing so is not specified.
  */
 # define _3D_CHICKEN2_WM_READ_PIPELINED			(1 << 14)
 #define _3D_CHICKEN3	_MMIO(0x2090)
+#define  _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX		(1 << 12)
 #define  _3D_CHICKEN_SF_DISABLE_OBJEND_CULL		(1 << 10)
 #define  _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE	(1 << 5)
 #define  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL		(1 << 5)
drivers/gpu/drm/i915/intel_lrc.c +11 -1
index 839cb1fc6a01..2b0ae552cc4e 100644
@@ -1575,11 +1575,21 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
 	/* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
 	batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+	*batch++ = MI_LOAD_REGISTER_IMM(3);
+
 	/* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */
-	*batch++ = MI_LOAD_REGISTER_IMM(1);
 	*batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2);
 	*batch++ = _MASKED_BIT_DISABLE(
 			GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE);
+
+	/* BSpec: 11391 */
+	*batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN);
+	*batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+
+	/* BSpec: 11299 */
+	*batch++ = i915_mmio_reg_offset(_3D_CHICKEN3);
+	*batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);
+
 	*batch++ = MI_NOOP;
 
 	/* WaClearSlmSpaceAtContextSwitch:kbl */
Signature · 6 lines
2.17.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH] drm/i915: Enable provoking vertex fix on Gen9 systems.

Quoted 10 lines · PDT Chris Wilson

From: Kenneth Graunke <[email protected]>

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.

Quoted 5 lines

Bugzilla: https://bugs.freedesktop.org/103047

---

This is only being set for gen9 right now, do we need it for gen10+?

The 3D_CHICKEN3 bit is labeled as SKL and KBL. The FF_SLICE_CHICKEN bit is labeled as SKL, with no mention of KBL...but the Windows driver appears to set both on all Gen 9. It doesn't look like it sets them on Gen 10, nor is documented to be necessary. (I haven't brought up a Cannonlake to test it, though...)

It looks like some of these registers are gone or reworked on Icelake, so Gen9-only sounds good to me.

Quoted 1 line

Ken, I also need your s-o-b.

Oops, sorry...got out of the habit of adding that...

Feel free to take authorship if you prefer - you've done much more work on it than I have at this point. :) Your call. Thanks for fixing it up and getting it landed, by the way!

It's a bummer that we have to do it here...but it seems like the only place that it can realistically happen, with the power context issue.

It would be nice to Cc this to stable, but it seems like a lot of the workaround code has changed a lot in the meantime, so not sure how well it'd apply...

Quoted 49 lines

An open question is how to record such w/a for easy checking from userspace. Though something like this might be better as part of an independent verification tool.

(quoted diff) +0 -2
-Chris
---
 drivers/gpu/drm/i915/i915_reg.h  |  5 +++++
 drivers/gpu/drm/i915/intel_lrc.c | 12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +5 -0
index b8c0ebd50889..54ec7ab57ce8 100644
@@ -2432,12 +2432,17 @@ enum i915_power_well_id {
 #define _3D_CHICKEN	_MMIO(0x2084)
 #define  _3D_CHICKEN_HIZ_PLANE_DISABLE_MSAA_4X_SNB	(1 << 10)
 #define _3D_CHICKEN2	_MMIO(0x208c)
+
+#define FF_SLICE_CHICKEN	_MMIO(0x2088)
+#define  FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX	(1 << 1)
+
 /* Disables pipelining of read flushes past the SF-WIZ interface.
  * Required on all Ironlake steppings according to the B-Spec, but the
  * particular danger of not doing so is not specified.
  */
 # define _3D_CHICKEN2_WM_READ_PIPELINED			(1 << 14)
 #define _3D_CHICKEN3	_MMIO(0x2090)
+#define  _3D_CHICKEN_SF_PROVOKING_VERTEX_FIX		(1 << 12)
 #define  _3D_CHICKEN_SF_DISABLE_OBJEND_CULL		(1 << 10)
 #define  _3D_CHICKEN3_AA_LINE_QUALITY_FIX_ENABLE	(1 << 5)
 #define  _3D_CHICKEN3_SF_DISABLE_FASTCLIP_CULL		(1 << 5)
drivers/gpu/drm/i915/intel_lrc.c +4 -1
index 839cb1fc6a01..2b0ae552cc4e 100644
@@ -1575,11 +1575,21 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
 	/* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
 	batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+	*batch++ = MI_LOAD_REGISTER_IMM(3);
+
 	/* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */
-	*batch++ = MI_LOAD_REGISTER_IMM(1);
 	*batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2);
 	*batch++ = _MASKED_BIT_DISABLE(
 			GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE);
+
+	/* BSpec: 11391 */

drivers/gpu/drm/i915/intel_lrc.c static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · line 1595

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +7 -0
+	*batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN);
+	*batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+
+	/* BSpec: 11299 */
+	*batch++ = i915_mmio_reg_offset(_3D_CHICKEN3);
+	*batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);
+
 	*batch++ = MI_NOOP;
 
 	/* WaClearSlmSpaceAtContextSwitch:kbl */

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer Reviewed-by on v1 1/1
#10 lore raw

Re: [PATCH] drm/i915: Enable provoking vertex fix on Gen9 systems.

In reply to Chris Wilson

Quoting Chris Wilson (2018-06-15 22:06:05)

Quoted 5 lines

From: Kenneth Graunke <[email protected]>

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

Quoted 7 lines

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

One note below.

Quoted 10 lines

+++ b/drivers/gpu/drm/i915/intel_lrc.c

drivers/gpu/drm/i915/intel_lrc.c +2 -1
@@ -1575,11 +1575,21 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
        /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
        batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+       *batch++ = MI_LOAD_REGISTER_IMM(3);
+
        /* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */
-       *batch++ = MI_LOAD_REGISTER_IMM(1);
        *batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2);

drivers/gpu/drm/i915/intel_lrc.c static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · line 1591

Quoted 10 lines
drivers/gpu/drm/i915/intel_lrc.c +8 -0
        *batch++ = _MASKED_BIT_DISABLE(
                        GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE);
+
+       /* BSpec: 11391 */
+       *batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN);
+       *batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+
+       /* BSpec: 11299 */
+       *batch++ = i915_mmio_reg_offset(_3D_CHICKEN3);
+       *batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);

I'm almost betting that somebody will take one of these 3 off without noticing the distant LOAD_REGISTER_IMM(). To perfect this, const table of pairs and use ARRAY_SIZE()? Then we're also one step closer to the const W/A tables...

Regards, Joonas
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#11 lore raw

Re: [PATCH] drm/i915: Enable provoking vertex fix on Gen9 systems.

Quoting Joonas Lahtinen (2018-06-18 10:03:24)

Quoted 11 lines

Quoting Chris Wilson (2018-06-15 22:06:05)

Quoted 10 lines

From: Kenneth Graunke <[email protected]>

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.

Quoted 4 lines
Quoted 2 lines

Bugzilla: https://bugs.freedesktop.org/103047

Thanks, fingers crossed we don't discover a reason why we shouldn't do this for all contexts... Pushed.

Quoted 19 lines

One note below.

Quoted 17 lines

+++ b/drivers/gpu/drm/i915/intel_lrc.c

drivers/gpu/drm/i915/intel_lrc.c +7 -1
@@ -1575,11 +1575,21 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
        /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
        batch = gen8_emit_flush_coherentl3_wa(engine, batch);
 
+       *batch++ = MI_LOAD_REGISTER_IMM(3);
+
        /* WaDisableGatherAtSetShaderCommonSlice:skl,bxt,kbl,glk */
-       *batch++ = MI_LOAD_REGISTER_IMM(1);
        *batch++ = i915_mmio_reg_offset(COMMON_SLICE_CHICKEN2);
        *batch++ = _MASKED_BIT_DISABLE(
                        GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE);
+
+       /* BSpec: 11391 */
+       *batch++ = i915_mmio_reg_offset(FF_SLICE_CHICKEN);
+       *batch++ = _MASKED_BIT_ENABLE(FF_SLICE_CHICKEN_CL_PROVOKING_VERTEX_FIX);
+
Quoted 8 lines

drivers/gpu/drm/i915/intel_lrc.c static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · line 1591

Quoted 3 lines
drivers/gpu/drm/i915/intel_lrc.c +3 -0
+       /* BSpec: 11299 */
+       *batch++ = i915_mmio_reg_offset(_3D_CHICKEN3);
+       *batch++ = _MASKED_BIT_ENABLE(_3D_CHICKEN_SF_PROVOKING_VERTEX_FIX);

I'm almost betting that somebody will take one of these 3 off without noticing the distant LOAD_REGISTER_IMM(). To perfect this, const table of pairs and use ARRAY_SIZE()? Then we're also one step closer to the const W/A tables...

I'll be back later to tidy this up.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

✓ Fi.CI.BAT: success for drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev3)

In reply to Kenneth Graunke
== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev3)
URL : https://patchwork.freedesktop.org/series/44781/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4326 -> Patchwork_9336 =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9336 need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9336, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44781/revisions/3/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9336:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_gttfill@basic:
      fi-pnv-d510:        PASS -> SKIP

== Known issues ==

Here are the changes found in Patchwork_9336 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-cnl-psr:         PASS -> DMESG-WARN (fdo#104951)

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         PASS -> FAIL (fdo#104008)

    
    ==== Possible fixes ====

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#105128) -> PASS

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       DMESG-FAIL (fdo#102614, fdo#106103) -> PASS

fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103

== Participating hosts (43 -> 37) ==

Missing (6): fi-ilk-m540 fi-hsw-4200u fi-byt-j1900 fi-byt-squawks fi-bsw-cyan fi-ctg-p8600

== Build changes ==

* Linux: CI_DRM_4326 -> Patchwork_9336

CI_DRM_4326: a50d441f53c192945f40ad053abe420e77e5ace6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4521: 4aa49a88acdaafed8235837d85a099ad941fc281 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9336: f23e3821ac5e4eb288a18f87b76611e514a1ef65 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

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

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9336/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#13 lore raw

✓ Fi.CI.IGT: success for drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev3)

In reply to Kenneth Graunke
== Series Details ==

== Series Details ==

Series: drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev3)
URL : https://patchwork.freedesktop.org/series/44781/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4326_full -> Patchwork_9336_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9336_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9336_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9336_full:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_mocs_settings@mocs-rc6-ctx-render:
      shard-kbl:          SKIP -> PASS

    igt@gem_mocs_settings@mocs-rc6-vebox:
      shard-kbl:          PASS -> SKIP +3

== Known issues ==

Here are the changes found in Patchwork_9336_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@flip-vs-expired-vblank:
      shard-glk:          PASS -> FAIL (fdo#105189)

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          DMESG-FAIL -> PASS
      shard-apl:          DMESG-FAIL -> PASS

    igt@drv_suspend@fence-restore-untiled:
      shard-glk:          FAIL (fdo#103375) -> PASS

    igt@kms_cursor_legacy@2x-nonblocking-modeset-vs-cursor-atomic:
      shard-glk:          FAIL (fdo#106509, fdo#105454) -> PASS

    
    ==== Warnings ====

    igt@drv_selftest@live_gtt:
      shard-glk:          INCOMPLETE (fdo#103359, k.org#198133) -> FAIL (fdo#105347)

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#105189 https://bugs.freedesktop.org/show_bug.cgi?id=105189
fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
fdo#105454 https://bugs.freedesktop.org/show_bug.cgi?id=105454
fdo#106509 https://bugs.freedesktop.org/show_bug.cgi?id=106509
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4326 -> Patchwork_9336

CI_DRM_4326: a50d441f53c192945f40ad053abe420e77e5ace6 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4521: 4aa49a88acdaafed8235837d85a099ad941fc281 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9336: f23e3821ac5e4eb288a18f87b76611e514a1ef65 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9336/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx