public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Oscar Mateo <oscar.mateo@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 22/22] drm/i915: Document the i915_workarounds file
Date: Fri, 13 Oct 2017 13:54:16 -0700	[thread overview]
Message-ID: <1507928056-6966-23-git-send-email-oscar.mateo@intel.com> (raw)
In-Reply-To: <1507928056-6966-1-git-send-email-oscar.mateo@intel.com>

Does what it says on the tin (plus a few fixes in some old comments).

v2: Include display WAs as a separate category.

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_pm.c          |  4 +--
 drivers/gpu/drm/i915/intel_workarounds.c | 47 +++++++++++++++++++++++++++-----
 2 files changed, 41 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 74cc2ffe..06b7bfa 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -8736,9 +8736,7 @@ static void nop_init_clock_gating(struct drm_i915_private *dev_priv)
  * @dev_priv: device private
  *
  * Setup the hooks that configure which clocks of a given platform can be
- * gated and also apply various GT and display specific workarounds for these
- * platforms. Note that some GT specific workarounds are applied separately
- * when GPU contexts or batchbuffers start their execution.
+ * gated.
  */
 void intel_init_clock_gating_hooks(struct drm_i915_private *dev_priv)
 {
diff --git a/drivers/gpu/drm/i915/intel_workarounds.c b/drivers/gpu/drm/i915/intel_workarounds.c
index 136f6fb..c7d165d 100644
--- a/drivers/gpu/drm/i915/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/intel_workarounds.c
@@ -25,6 +25,38 @@
 #include "i915_drv.h"
 #include "intel_workarounds.h"
 
+/**
+ * DOC: Hardware workarounds
+ *
+ * This file is a central place to implement most* of the required workarounds
+ * required for HW to work as originally intended. They fall in five basic
+ * categories depending on how/when they are applied:
+ *
+ * - Workarounds that touch registers that are saved/restored to/from the HW
+ *   context image. The list is generated once and then emitted (via Load
+ *   Register Immediate commands) everytime a new context is created.
+ * - GT workarounds. The list of these WAs is generated once and then applied
+ *   whenever these registers revert to default values (on GPU reset,
+ *   suspend/resume**, etc..).
+ * - Display workarounds. The list is generated once (at the same time as the GT
+ *   workarounds) but applied during display clock-gating initialization.
+ * - Workarounds that whitelist a privileged register, so that UMDs can manage
+ *   them directly. This is just a special case of a MMMIO workaround (as we
+ *   write the list of these to/be-whitelisted registers to some special HW
+ *   registers).
+ * - Workaround batchbuffers, that get executed automatically by the hardware
+ *   on every HW context restore.
+ *
+ * * Please notice that there are other WAs that, due to their nature, cannot be
+ *   applied from a central place. Those are peppered around the rest of the
+ *   code, as needed).
+ *
+ * ** Technically, some registers are powercontext saved & restored, so they
+ *    survive a suspend/resume. In practice, writing them again is not too
+ *    costly and simplifies things. We can revisit this in the future.
+ *
+ */
+
 static int ctx_wa_add(struct drm_i915_private *dev_priv,
 		      i915_reg_t addr,
 		      const u32 mask, const u32 val)
@@ -190,9 +222,9 @@ static int gen9_ctx_workarounds_init(struct drm_i915_private *dev_priv)
 		CTX_WA_SET_BIT_MASKED(GEN7_COMMON_SLICE_CHICKEN1,
 				      GEN9_RHWO_OPTIMIZATION_DISABLE);
 		/*
-		 * WA also requires GEN9_SLICE_COMMON_ECO_CHICKEN0[14:14] to be set
-		 * but we do that in per ctx batchbuffer as there is an issue
-		 * with this register not getting restored on ctx restore
+		 * WA also requires GEN9_SLICE_COMMON_ECO_CHICKEN0[14:14] to be
+		 * set but we do that in per ctx batchbuffer as there is an
+		 * issue with this register not getting restored on ctx restore.
 		 */
 	}
 
@@ -1321,10 +1353,11 @@ void intel_whitelist_workarounds_apply(struct intel_engine_cs *engine)
  * but there is a slight complication as this is applied in WA batch where the
  * values are only initialized once so we cannot take register value at the
  * beginning and reuse it further; hence we save its value to memory, upload a
- * constant value with bit21 set and then we restore it back with the saved value.
+ * constant value with bit21 set and then we restore it back with the saved
+ * value.
  * To simplify the WA, a constant value is formed by using the default value
  * of this register. This shouldn't be a problem because we are only modifying
- * it for a short period and this batch in non-premptible. We can ofcourse
+ * it for a short period and this batch in non-premptible. We can of course
  * use additional instructions that read the actual value of the register
  * at that time and set our bit of interest but it makes the WA complicated.
  *
@@ -1360,8 +1393,8 @@ void intel_whitelist_workarounds_apply(struct intel_engine_cs *engine)
  * Typically we only have one indirect_ctx and per_ctx batch buffer which are
  * initialized at the beginning and shared across all contexts but this field
  * helps us to have multiple batches at different offsets and select them based
- * on a criteria. At the moment this batch always start at the beginning of the page
- * and at this point we don't have multiple wa_ctx batch buffers.
+ * on a criteria. At the moment this batch always start at the beginning of the
+ * page and at this point we don't have multiple wa_ctx batch buffers.
  *
  * The number of WA applied are not known at the beginning; we use this field
  * to return the no of DWORDS written.
-- 
1.9.1

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

  parent reply	other threads:[~2017-10-13 20:54 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13 20:53 [PATCH v3 00/22] Refactor HW workaround code Oscar Mateo
2017-10-13 20:53 ` [PATCH v3 01/22] drm/i915: Use a mask when applying WaProgramL3SqcReg1Default Oscar Mateo
2017-10-13 21:28   ` Chris Wilson
2017-10-14  0:26     ` Michel Thierry
2017-10-13 20:53 ` [PATCH v3 02/22] drm/i915: No need for RING_MAX_NONPRIV_SLOTS space Oscar Mateo
2017-10-13 20:53 ` [PATCH v3 03/22] drm/i915: Move a bunch of workaround-related code to its own file Oscar Mateo
2017-10-13 20:53 ` [PATCH v3 04/22] drm/i915: Split out functions for different kinds of workarounds Oscar Mateo
2017-10-13 20:53 ` [PATCH v3 05/22] drm/i915: Rename saved workarounds to make it explicit that they are context WAs Oscar Mateo
2017-10-13 20:54 ` [PATCH v3 06/22] drm/i915: Save all GT WAs and apply them at a later time Oscar Mateo
2017-10-17 12:37   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 07/22] drm/i915: Save all Whitelist " Oscar Mateo
2017-10-17 12:38   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 08/22] drm/i915: Create a new category of display WAs Oscar Mateo
2017-10-17 12:42   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 09/22] drm/i915: Print all workaround types correctly in debugfs Oscar Mateo
2017-10-17 12:45   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 10/22] drm/i915: Move WA BB stuff to the workarounds file as well Oscar Mateo
2017-10-17 12:49   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 11/22] drm/i915/cnl: Move GT and Display workarounds from init_clock_gating Oscar Mateo
2017-10-17 12:52   ` Chris Wilson
2017-10-17 21:22     ` Oscar Mateo
2017-10-18 12:44   ` Ville Syrjälä
2017-10-30 20:05     ` Oscar Mateo
2017-10-13 20:54 ` [PATCH v3 12/22] drm/i915/gen9: " Oscar Mateo
2017-10-17 12:53   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 13/22] drm/i915/gen9: Remove Gen9 WAs with no effect Oscar Mateo
2017-10-13 20:54 ` [PATCH v3 14/22] drm/i915/cfl: Move GT and Display workarounds from init_clock_gating Oscar Mateo
2017-10-17 12:54   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 15/22] drm/i915/glk: " Oscar Mateo
2017-10-17 12:57   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 16/22] drm/i915/kbl: " Oscar Mateo
2017-10-17 12:58   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 17/22] drm/i915/bxt: " Oscar Mateo
2017-10-17 12:58   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 18/22] drm/i915/skl: " Oscar Mateo
2017-10-17 12:59   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 19/22] drm/i915/chv: " Oscar Mateo
2017-10-17 13:02   ` Chris Wilson
2017-10-13 20:54 ` [PATCH v3 20/22] drm/i915/bdw: " Oscar Mateo
2017-10-17 13:03   ` Chris Wilson
2017-10-30 20:08     ` Oscar Mateo
2017-10-13 20:54 ` [PATCH v3 21/22] drm/i915: Move WaProgramL3SqcReg1Default to the workarounds file Oscar Mateo
2017-10-17 13:05   ` Chris Wilson
2017-10-13 20:54 ` Oscar Mateo [this message]
2017-10-13 21:48 ` ✗ Fi.CI.BAT: failure for Refactor HW workaround code (rev3) Patchwork
2017-10-17 13:06 ` [PATCH v3 00/22] Refactor HW workaround code Chris Wilson
2017-10-30 20:07   ` Oscar Mateo

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=1507928056-6966-23-git-send-email-oscar.mateo@intel.com \
    --to=oscar.mateo@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox