aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Antoine <peter.antoine@intel.com>2016-05-17 10:12:45 -0400
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-05-18 07:49:19 -0400
commit74aa156ba9e2ba79c24b100c0e2e97423acda817 (patch)
treea906a76aa50e8ea2d934baf7ad40371e757b7adb
parentaf4a879e0cb29b2cf35ff7559d32304783012534 (diff)
drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
This patch resizes the GuC WOPCM (specifically on BXT) so that the GuC and RC6 memory spaces do not overlap. v2: Made calculation of WOPCM size into a separate function, so that it's consistent between the firmware size-check and the register-programming operations [Dave Gordon]. Issue: https://jira01.devtools.intel.com/browse/VIZ-6638 Signed-off-by: Peter Antoine <peter.antoine@intel.com> Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Nick Hoath <nicholas.hoath@intel.com> Tested-by: Nick Hoath <nicholas.hoath@intel.com> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1463494365-26330-1-git-send-email-david.s.gordon@intel.com
-rw-r--r--drivers/gpu/drm/i915/i915_guc_reg.h6
-rw-r--r--drivers/gpu/drm/i915/intel_guc_loader.c17
2 files changed, 16 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/i915_guc_reg.h b/drivers/gpu/drm/i915/i915_guc_reg.h
index 80786d9f9ad3..cf5a65be4fe0 100644
--- a/drivers/gpu/drm/i915/i915_guc_reg.h
+++ b/drivers/gpu/drm/i915/i915_guc_reg.h
@@ -67,11 +67,11 @@
67#define GUC_WOPCM_OFFSET_VALUE 0x80000 /* 512KB */ 67#define GUC_WOPCM_OFFSET_VALUE 0x80000 /* 512KB */
68#define GUC_MAX_IDLE_COUNT _MMIO(0xC3E4) 68#define GUC_MAX_IDLE_COUNT _MMIO(0xC3E4)
69 69
70/* Defines WOPCM space available to GuC firmware */
70#define GUC_WOPCM_SIZE _MMIO(0xc050) 71#define GUC_WOPCM_SIZE _MMIO(0xc050)
71#define GUC_WOPCM_SIZE_VALUE (0x80 << 12) /* 512KB */
72
73/* GuC addresses below GUC_WOPCM_TOP don't map through the GTT */ 72/* GuC addresses below GUC_WOPCM_TOP don't map through the GTT */
74#define GUC_WOPCM_TOP (GUC_WOPCM_SIZE_VALUE) 73#define GUC_WOPCM_TOP (0x80 << 12) /* 512KB */
74#define BXT_GUC_WOPCM_RC6_RESERVED (0x10 << 12) /* 64KB */
75 75
76#define GEN8_GT_PM_CONFIG _MMIO(0x138140) 76#define GEN8_GT_PM_CONFIG _MMIO(0x138140)
77#define GEN9LP_GT_PM_CONFIG _MMIO(0x138140) 77#define GEN9LP_GT_PM_CONFIG _MMIO(0x138140)
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index 23345e15bffc..34405de72dfa 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -284,6 +284,17 @@ static int guc_ucode_xfer_dma(struct drm_i915_private *dev_priv)
284 return ret; 284 return ret;
285} 285}
286 286
287static u32 guc_wopcm_size(struct drm_i915_private *dev_priv)
288{
289 u32 wopcm_size = GUC_WOPCM_TOP;
290
291 /* On BXT, the top of WOPCM is reserved for RC6 context */
292 if (IS_BROXTON(dev_priv))
293 wopcm_size -= BXT_GUC_WOPCM_RC6_RESERVED;
294
295 return wopcm_size;
296}
297
287/* 298/*
288 * Load the GuC firmware blob into the MinuteIA. 299 * Load the GuC firmware blob into the MinuteIA.
289 */ 300 */
@@ -311,7 +322,7 @@ static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
311 intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); 322 intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
312 323
313 /* init WOPCM */ 324 /* init WOPCM */
314 I915_WRITE(GUC_WOPCM_SIZE, GUC_WOPCM_SIZE_VALUE); 325 I915_WRITE(GUC_WOPCM_SIZE, guc_wopcm_size(dev_priv));
315 I915_WRITE(DMA_GUC_WOPCM_OFFSET, GUC_WOPCM_OFFSET_VALUE); 326 I915_WRITE(DMA_GUC_WOPCM_OFFSET, GUC_WOPCM_OFFSET_VALUE);
316 327
317 /* Enable MIA caching. GuC clock gating is disabled. */ 328 /* Enable MIA caching. GuC clock gating is disabled. */
@@ -555,9 +566,7 @@ static void guc_fw_fetch(struct drm_device *dev, struct intel_guc_fw *guc_fw)
555 566
556 /* Header and uCode will be loaded to WOPCM. Size of the two. */ 567 /* Header and uCode will be loaded to WOPCM. Size of the two. */
557 size = guc_fw->header_size + guc_fw->ucode_size; 568 size = guc_fw->header_size + guc_fw->ucode_size;
558 569 if (size > guc_wopcm_size(dev->dev_private)) {
559 /* Top 32k of WOPCM is reserved (8K stack + 24k RC6 context). */
560 if (size > GUC_WOPCM_SIZE_VALUE - 0x8000) {
561 DRM_ERROR("Firmware is too large to fit in WOPCM\n"); 570 DRM_ERROR("Firmware is too large to fit in WOPCM\n");
562 goto fail; 571 goto fail;
563 } 572 }