aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-01-05 10:30:23 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2017-01-05 10:34:46 -0500
commitdb9309a526e5bb1418626d9b0d74f561230e0d10 (patch)
tree9c7c782a15afff6a66711824513fcefb74b6f394
parent40b326eefe0ae89fa7e8b272f51382c55563e179 (diff)
drm/i915/guc: Exclude the upper end of the Global GTT for the GuC
The GuC uses a special mapping for the upper end of the Global GTT, similar to the way it uses a special mapping for the lower end, so exclude it from our drm_mm to prevent us using it. v2: Rename to reflect that it is unmappable similar to the region at the bottom of the GGTT, and couple it into the assertion that we don't feed unmappable addresses to the GuC. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170105153023.30575-5-chris@chris-wilson.co.uk
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c10
-rw-r--r--drivers/gpu/drm/i915/i915_guc_reg.h3
-rw-r--r--drivers/gpu/drm/i915/intel_uc.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 6af9311f72f5..bc2b4421cbd6 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3176,6 +3176,16 @@ int i915_ggtt_probe_hw(struct drm_i915_private *dev_priv)
3176 if (ret) 3176 if (ret)
3177 return ret; 3177 return ret;
3178 3178
3179 /* Trim the GGTT to fit the GuC mappable upper range (when enabled).
3180 * This is easier than doing range restriction on the fly, as we
3181 * currently don't have any bits spare to pass in this upper
3182 * restriction!
3183 */
3184 if (HAS_GUC(dev_priv) && i915.enable_guc_loading) {
3185 ggtt->base.total = min_t(u64, ggtt->base.total, GUC_GGTT_TOP);
3186 ggtt->mappable_end = min(ggtt->mappable_end, ggtt->base.total);
3187 }
3188
3179 if ((ggtt->base.total - 1) >> 32) { 3189 if ((ggtt->base.total - 1) >> 32) {
3180 DRM_ERROR("We never expected a Global GTT with more than 32bits" 3190 DRM_ERROR("We never expected a Global GTT with more than 32bits"
3181 " of address space! Found %lldM!\n", 3191 " of address space! Found %lldM!\n",
diff --git a/drivers/gpu/drm/i915/i915_guc_reg.h b/drivers/gpu/drm/i915/i915_guc_reg.h
index 5e638fc37208..6a0adafe0523 100644
--- a/drivers/gpu/drm/i915/i915_guc_reg.h
+++ b/drivers/gpu/drm/i915/i915_guc_reg.h
@@ -73,6 +73,9 @@
73#define GUC_WOPCM_TOP (0x80 << 12) /* 512KB */ 73#define GUC_WOPCM_TOP (0x80 << 12) /* 512KB */
74#define BXT_GUC_WOPCM_RC6_RESERVED (0x10 << 12) /* 64KB */ 74#define BXT_GUC_WOPCM_RC6_RESERVED (0x10 << 12) /* 64KB */
75 75
76/* GuC addresses above GUC_GGTT_TOP also don't map through the GTT */
77#define GUC_GGTT_TOP 0xFEE00000
78
76#define GEN8_GT_PM_CONFIG _MMIO(0x138140) 79#define GEN8_GT_PM_CONFIG _MMIO(0x138140)
77#define GEN9LP_GT_PM_CONFIG _MMIO(0x138140) 80#define GEN9LP_GT_PM_CONFIG _MMIO(0x138140)
78#define GEN9_GT_PM_CONFIG _MMIO(0x13816c) 81#define GEN9_GT_PM_CONFIG _MMIO(0x13816c)
diff --git a/drivers/gpu/drm/i915/intel_uc.h b/drivers/gpu/drm/i915/intel_uc.h
index 3b1e39b0f3ab..9490a8e049c3 100644
--- a/drivers/gpu/drm/i915/intel_uc.h
+++ b/drivers/gpu/drm/i915/intel_uc.h
@@ -203,6 +203,7 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)
203{ 203{
204 u32 offset = i915_ggtt_offset(vma); 204 u32 offset = i915_ggtt_offset(vma);
205 GEM_BUG_ON(offset < GUC_WOPCM_TOP); 205 GEM_BUG_ON(offset < GUC_WOPCM_TOP);
206 GEM_BUG_ON(range_overflows_t(u64, offset, vma->size, GUC_GGTT_TOP));
206 return offset; 207 return offset;
207} 208}
208 209