All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Mika Kuoppala <mika.kuoppala@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: [PATCH] drm/i915/cnl: WaDisableGatherAtSetShaderCommonSlice
Date: Thu,  5 Oct 2017 13:22:32 -0700	[thread overview]
Message-ID: <20171005202232.8358-1-rodrigo.vivi@intel.com> (raw)

Purely empirical. I don't have a better description of the need
of this workaround. It is not on BSpec and it is not on wa_database.

However it brings a huge stability to CNL and fix many issues that
Mesa was facing.

Empirical history: when Rafael and I were trying to understand
the misterious WaSendPushConstantsFromMMIO we just had a description
of it that was "If not using RS, we must send two MMIO registers at
context create to trigger push constants at 3D primitive"

And in another place we just saw that WaSendPushConstantsFromMMIO
was only adding COMMON_SLICE_CHICKEN2 in a white list.

So we looked to the programmin notes of COMMON_SLICE_CHICKEN2
and we notice that this bit 12 is marked in association with
2 other MMIO registers for SKL+. Apparently for SKL+ we should
check few MMIOs to decide for set or reset of this bit 12.

Also "gather" is related to gather and packing of consntant elements
into "push constants".

So we give a shot with this workaround in place and achieved
a good stability.

Cc: Rafael Antognolli <rafael.antognolli@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_lrc.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index 7d6da130b184..aa1705319d71 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1231,6 +1231,23 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch)
 	return batch;
 }
 
+static u32 *gen10_init_indirectctx_bb(struct intel_engine_cs *engine,
+				      u32 *batch)
+{
+	/* WaDisableGatherAtSetShaderCommonSlice:cnl */
+	*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);
+	*batch++ = MI_NOOP;
+
+	/* Pad to end of cacheline */
+	while ((unsigned long)batch % CACHELINE_BYTES)
+		*batch++ = MI_NOOP;
+
+	return batch;
+}
+
 #define CTX_WA_BB_OBJ_SIZE (PAGE_SIZE)
 
 static int lrc_setup_wa_ctx(struct intel_engine_cs *engine)
@@ -1284,7 +1301,9 @@ static int intel_init_workaround_bb(struct intel_engine_cs *engine)
 
 	switch (INTEL_GEN(engine->i915)) {
 	case 10:
-		return 0;
+		wa_bb_fn[0] = gen10_init_indirectctx_bb;
+		wa_bb_fn[1] = NULL;
+		break;
 	case 9:
 		wa_bb_fn[0] = gen9_init_indirectctx_bb;
 		wa_bb_fn[1] = NULL;
-- 
2.13.5

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

             reply	other threads:[~2017-10-05 20:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-05 20:22 Rodrigo Vivi [this message]
2017-10-05 20:38 ` [PATCH] drm/i915/cnl: WaDisableGatherAtSetShaderCommonSlice Chris Wilson
2017-10-05 22:26   ` [PATCH] drm/i915/cnl: WaSendPushConstantsFromMMIO / WaDisableGatherAtSetShaderCommonSlice Rodrigo Vivi
2017-10-05 22:45     ` Rafael Antognolli
2017-10-06 11:06 ` ✗ Fi.CI.BAT: warning for drm/i915/cnl: WaDisableGatherAtSetShaderCommonSlice (rev2) Patchwork
2017-10-06 13:10   ` Rodrigo Vivi
2017-10-06 13:18     ` Chris Wilson
2017-10-06 14:45     ` Saarinen, Jani
2017-10-09  6:34     ` Lofstedt, Marta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171005202232.8358-1-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.