All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v6 1/6] drm/i915/guc: Avoid wasting memory on incorrect GuC pin bias
@ 2018-07-27  8:53 Jakub Bartmiński
  2018-07-27  8:53 ` [PATCH v6 2/6] drm/i915/guc: Do not partition WOPCM if GuC is not used Jakub Bartmiński
                   ` (6 more replies)
  0 siblings, 7 replies; 17+ messages in thread
From: Jakub Bartmiński @ 2018-07-27  8:53 UTC (permalink / raw)
  To: intel-gfx

It would appear that the calculated GuC pin bias was larger than it should
be, as the GuC address space does NOT contain the "HW contexts RSVD" part
of the WOPCM. Thus, the GuC pin bias is simply the GuC WOPCM size.

v5:
Clarify the diagram to better represent the GuC address space.
Since we now don't use guc.base for the pin bias there's no need to
validate it. It also has already been verified in WOPCM init.

Bspec: 1180

Signed-off-by: Jakub Bartmiński <jakub.bartminski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/intel_guc.c | 49 +++++++++++++-------------------
 1 file changed, 20 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index e12bd259df17..aa28368f8ba7 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -582,50 +582,41 @@ int intel_guc_resume(struct intel_guc *guc)
  *
  * ::
  *
- *     +==============> +====================+ <== GUC_GGTT_TOP
- *     ^                |                    |
- *     |                |                    |
- *     |                |        DRAM        |
- *     |                |       Memory       |
- *     |                |                    |
- *    GuC               |                    |
- *  Address  +========> +====================+ <== WOPCM Top
- *   Space   ^          |   HW contexts RSVD |
- *     |     |          |        WOPCM       |
- *     |     |     +==> +--------------------+ <== GuC WOPCM Top
- *     |    GuC    ^    |                    |
- *     |    GGTT   |    |                    |
- *     |    Pin   GuC   |        GuC         |
- *     |    Bias WOPCM  |       WOPCM        |
- *     |     |    Size  |                    |
- *     |     |     |    |                    |
- *     v     v     v    |                    |
- *     +=====+=====+==> +====================+ <== GuC WOPCM Base
- *                      |   Non-GuC WOPCM    |
- *                      |   (HuC/Reserved)   |
- *                      +====================+ <== WOPCM Base
+ *     +===========> +====================+ <== FFFF_FFFF
+ *     ^             |      Reserved      |
+ *     |             +====================+ <== GUC_GGTT_TOP
+ *     |             |                    |
+ *     |             |        DRAM        |
+ *    GuC            |                    |
+ *  Address    +===> +====================+ <== GuC ggtt_pin_bias
+ *   Space     ^     |                    |
+ *     |       |     |                    |
+ *     |      GuC    |        GuC         |
+ *     |     WOPCM   |       WOPCM        |
+ *     |      Size   |                    |
+ *     |       |     |                    |
+ *     v       v     |                    |
+ *     +=======+===> +====================+ <== 0000_0000
  *
- * The lower part of GuC Address Space [0, ggtt_pin_bias) is mapped to WOPCM
+ * The lower part of GuC Address Space [0, ggtt_pin_bias) is mapped to GuC WOPCM
  * while upper part of GuC Address Space [ggtt_pin_bias, GUC_GGTT_TOP) is mapped
- * to DRAM. The value of the GuC ggtt_pin_bias is determined by WOPCM size and
- * actual GuC WOPCM size.
+ * to DRAM. The value of the GuC ggtt_pin_bias is the GuC WOPCM size.
  */
 
 /**
  * guc_init_ggtt_pin_bias() - Initialize the GuC ggtt_pin_bias value.
  * @guc: intel_guc structure.
  *
- * This function will calculate and initialize the ggtt_pin_bias value based on
- * overall WOPCM size and GuC WOPCM size.
+ * This function will calculate and initialize the ggtt_pin_bias value
+ * based on the GuC WOPCM size.
  */
 static void guc_init_ggtt_pin_bias(struct intel_guc *guc)
 {
 	struct drm_i915_private *i915 = guc_to_i915(guc);
 
 	GEM_BUG_ON(!i915->wopcm.size);
-	GEM_BUG_ON(i915->wopcm.size < i915->wopcm.guc.base);
 
-	guc->ggtt_pin_bias = i915->wopcm.size - i915->wopcm.guc.base;
+	guc->ggtt_pin_bias = i915->wopcm.guc.size;
 }
 
 /**
-- 
2.17.1

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

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

end of thread, other threads:[~2018-07-27 12:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-27  8:53 [PATCH v6 1/6] drm/i915/guc: Avoid wasting memory on incorrect GuC pin bias Jakub Bartmiński
2018-07-27  8:53 ` [PATCH v6 2/6] drm/i915/guc: Do not partition WOPCM if GuC is not used Jakub Bartmiński
2018-07-27 10:20   ` Chris Wilson
2018-07-27 12:04   ` Michal Wajdeczko
2018-07-27  8:53 ` [PATCH v6 3/6] drm/i915/guc: Move the pin bias value from GuC to GGTT Jakub Bartmiński
2018-07-27 10:29   ` Chris Wilson
2018-07-27 12:03     ` Michal Wajdeczko
2018-07-27 12:07       ` Chris Wilson
2018-07-27  8:53 ` [PATCH v6 4/6] drm/i915: Remove unnecessary ggtt_offset_bias from i915_gem_context Jakub Bartmiński
2018-07-27 10:30   ` Chris Wilson
2018-07-27  8:53 ` [PATCH v6 5/6] drm/i915: Add a fault injection point to WOPCM init Jakub Bartmiński
2018-07-27 12:06   ` Michal Wajdeczko
2018-07-27  8:53 ` [PATCH v6 6/6] HAX enable GuC for CI Jakub Bartmiński
2018-07-27  9:16 ` ✗ Fi.CI.SPARSE: warning for series starting with [v6,1/6] drm/i915/guc: Avoid wasting memory on incorrect GuC pin bias Patchwork
2018-07-27  9:35 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-07-27  9:51   ` Chris Wilson
2018-07-27 10:32     ` Bartminski, Jakub

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.