All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Enable provoking vertex fix on Gen9+ systems.
@ 2018-06-14 21:53 Kenneth Graunke
  2018-06-14 22:37 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (7 more replies)
  0 siblings, 8 replies; 14+ messages in thread
From: Kenneth Graunke @ 2018-06-14 21:53 UTC (permalink / raw)
  To: intel-gfx; +Cc: Kenneth Graunke

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

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 19defe73b156..8828780a1773 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -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];
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 140f6a27d696..35d8c2be85be 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -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)
diff --git a/drivers/gpu/drm/i915/intel_workarounds.c b/drivers/gpu/drm/i915/intel_workarounds.c
index 24b929ce3341..2dea23bfd5ea 100644
--- a/drivers/gpu/drm/i915/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/intel_workarounds.c
@@ -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;
 }
 
-- 
2.17.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2018-06-18  9:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-14 21:53 [PATCH] drm/i915: Enable provoking vertex fix on Gen9+ systems Kenneth Graunke
2018-06-14 22:37 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-06-14 22:53 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-06-15  7:16   ` Chris Wilson
2018-06-15  7:51     ` Chris Wilson
2018-06-15 14:52 ` Patchwork
2018-06-15 18:31 ` [PATCH] " Chris Wilson
2018-06-15 18:34 ` ✗ Fi.CI.BAT: failure for drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev2) Patchwork
2018-06-15 19:06 ` [PATCH] drm/i915: Enable provoking vertex fix on Gen9 systems Chris Wilson
2018-06-16  5:07   ` Kenneth Graunke
2018-06-18  9:03   ` Joonas Lahtinen
2018-06-18  9:12     ` Chris Wilson
2018-06-15 20:09 ` ✓ Fi.CI.BAT: success for drm/i915: Enable provoking vertex fix on Gen9+ systems. (rev3) Patchwork
2018-06-16  9:35 ` ✓ Fi.CI.IGT: " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.