Commit 9936ef55 authored by Jakub Bartmiński's avatar Jakub Bartmiński Committed by Chris Wilson

drm/i915/guc: Avoid wasting memory on incorrect GuC pin bias

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: default avatarJakub 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: default avatarMichał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20180727141148.30874-1-jakub.bartminski@intel.com
parent c00db496
...@@ -585,50 +585,41 @@ int intel_guc_resume(struct intel_guc *guc) ...@@ -585,50 +585,41 @@ int intel_guc_resume(struct intel_guc *guc)
* *
* :: * ::
* *
* +==============> +====================+ <== GUC_GGTT_TOP * +===========> +====================+ <== FFFF_FFFF
* ^ | | * ^ | Reserved |
* | | | * | +====================+ <== GUC_GGTT_TOP
* | | DRAM | * | | |
* | | Memory | * | | DRAM |
* | | | * GuC | |
* GuC | | * Address +===> +====================+ <== GuC ggtt_pin_bias
* Address +========> +====================+ <== WOPCM Top * Space ^ | |
* Space ^ | HW contexts RSVD | * | | | |
* | | | WOPCM | * | GuC | GuC |
* | | +==> +--------------------+ <== GuC WOPCM Top * | WOPCM | WOPCM |
* | GuC ^ | | * | Size | |
* | GGTT | | | * | | | |
* | Pin GuC | GuC | * v v | |
* | Bias WOPCM | WOPCM | * +=======+===> +====================+ <== 0000_0000
* | | Size | |
* | | | | |
* v v v | |
* +=====+=====+==> +====================+ <== GuC WOPCM Base
* | Non-GuC WOPCM |
* | (HuC/Reserved) |
* +====================+ <== WOPCM Base
* *
* 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 * 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 * to DRAM. The value of the GuC ggtt_pin_bias is the GuC WOPCM size.
* actual GuC WOPCM size.
*/ */
/** /**
* guc_init_ggtt_pin_bias() - Initialize the GuC ggtt_pin_bias value. * guc_init_ggtt_pin_bias() - Initialize the GuC ggtt_pin_bias value.
* @guc: intel_guc structure. * @guc: intel_guc structure.
* *
* This function will calculate and initialize the ggtt_pin_bias value based on * This function will calculate and initialize the ggtt_pin_bias value
* overall WOPCM size and GuC WOPCM size. * based on the GuC WOPCM size.
*/ */
static void guc_init_ggtt_pin_bias(struct intel_guc *guc) static void guc_init_ggtt_pin_bias(struct intel_guc *guc)
{ {
struct drm_i915_private *i915 = guc_to_i915(guc); struct drm_i915_private *i915 = guc_to_i915(guc);
GEM_BUG_ON(!i915->wopcm.size); 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;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment