diff mbox

[v2] drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM

Message ID 1463494365-26330-1-git-send-email-david.s.gordon@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Dave Gordon May 17, 2016, 2:12 p.m. UTC
From: Peter Antoine <peter.antoine@intel.com>

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>
---
 drivers/gpu/drm/i915/i915_guc_reg.h     |  6 +++---
 drivers/gpu/drm/i915/intel_guc_loader.c | 17 +++++++++++++----
 2 files changed, 16 insertions(+), 7 deletions(-)

Comments

Dave Gordon May 18, 2016, 11:10 a.m. UTC | #1
On 17/05/16 17:03, Patchwork wrote:
> == Series Details ==
>
> Series: drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
> URL   : https://patchwork.freedesktop.org/series/7300/
> State : failure
>
> == Summary ==
>
> Series 7300v1 drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
> http://patchwork.freedesktop.org/api/1.0/series/7300/revisions/1/mbox
>
> Test drv_hangman:
>          Subgroup error-state-basic:
>                  pass       -> INCOMPLETE (fi-snb-i7-2600)

No results - this machine seems to lose its connection quite frequently :(

> Test gem_exec_flush:
>          Subgroup basic-batch-kernel-default-cmd:
>                  pass       -> FAIL       (fi-byt-n2820)

https://bugs.freedesktop.org/show_bug.cgi?id=95372
[BAT BYT] Sporadic failure from 
igt/gem_exec_flush@basic-batch-kernel-default-cmd

> Test kms_pipe_crc_basic:
>          Subgroup suspend-read-crc-pipe-c:
>                  pass       -> INCOMPLETE (fi-hsw-i7-4770k)

Also seen 2 hours earlier, on this same machine
http://www.spinics.net/lists/intel-gfx/msg96005.html
Looks like a (recent) h/w issue with this system?

> Test kms_sink_crc_basic:
>                  skip       -> PASS       (ro-skl-i7-6700hq)
>
> fi-bsw-n3050     total:218  pass:174  dwarn:0   dfail:0   fail:2   skip:42
> fi-byt-n2820     total:218  pass:174  dwarn:0   dfail:0   fail:3   skip:41
> fi-hsw-i7-4770k  total:206  pass:186  dwarn:0   dfail:0   fail:0   skip:19
> fi-hsw-i7-4770r  total:219  pass:193  dwarn:0   dfail:0   fail:0   skip:26
> fi-kbl-y         total:219  pass:191  dwarn:1   dfail:0   fail:2   skip:25
> fi-skl-i7-6700k  total:219  pass:191  dwarn:0   dfail:0   fail:0   skip:28
> fi-snb-i7-2600   total:37   pass:27   dwarn:0   dfail:0   fail:0   skip:9
> ro-bdw-i5-5250u  total:219  pass:181  dwarn:0   dfail:0   fail:0   skip:38
> ro-bdw-i7-5557U  total:219  pass:206  dwarn:0   dfail:0   fail:0   skip:13
> ro-bdw-i7-5600u  total:219  pass:187  dwarn:0   dfail:0   fail:0   skip:32
> ro-bsw-n3050     total:219  pass:175  dwarn:0   dfail:0   fail:2   skip:42
> ro-byt-n2820     total:218  pass:174  dwarn:0   dfail:0   fail:3   skip:41
> ro-hsw-i3-4010u  total:218  pass:193  dwarn:0   dfail:0   fail:0   skip:25
> ro-hsw-i7-4770r  total:219  pass:194  dwarn:0   dfail:0   fail:0   skip:25
> ro-ilk-i7-620lm  total:219  pass:151  dwarn:0   dfail:0   fail:1   skip:67
> ro-ilk1-i5-650   total:214  pass:151  dwarn:0   dfail:0   fail:2   skip:61
> ro-ivb-i7-3770   total:219  pass:183  dwarn:0   dfail:0   fail:0   skip:36
> ro-ivb2-i7-3770  total:219  pass:187  dwarn:0   dfail:0   fail:0   skip:32
> ro-skl-i7-6700hq total:214  pass:190  dwarn:0   dfail:0   fail:0   skip:24
> ro-snb-i7-2620M  total:219  pass:177  dwarn:0   dfail:0   fail:1   skip:41
>
> Results at /archive/results/CI_IGT_test/RO_Patchwork_922/
>
> 68c6a6d drm-intel-nightly: 2016y-05m-17d-13h-59m-27s UTC integration manifest
> 0c07ab7 drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
>
Tvrtko Ursulin May 18, 2016, 11:50 a.m. UTC | #2
On 18/05/16 12:10, Dave Gordon wrote:
> On 17/05/16 17:03, Patchwork wrote:
>> == Series Details ==
>>
>> Series: drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
>> URL   : https://patchwork.freedesktop.org/series/7300/
>> State : failure
>>
>> == Summary ==
>>
>> Series 7300v1 drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM
>> http://patchwork.freedesktop.org/api/1.0/series/7300/revisions/1/mbox
>>
>> Test drv_hangman:
>>          Subgroup error-state-basic:
>>                  pass       -> INCOMPLETE (fi-snb-i7-2600)
>
> No results - this machine seems to lose its connection quite frequently :(
>
>> Test gem_exec_flush:
>>          Subgroup basic-batch-kernel-default-cmd:
>>                  pass       -> FAIL       (fi-byt-n2820)
>
> https://bugs.freedesktop.org/show_bug.cgi?id=95372
> [BAT BYT] Sporadic failure from
> igt/gem_exec_flush@basic-batch-kernel-default-cmd
>
>> Test kms_pipe_crc_basic:
>>          Subgroup suspend-read-crc-pipe-c:
>>                  pass       -> INCOMPLETE (fi-hsw-i7-4770k)
>
> Also seen 2 hours earlier, on this same machine
> http://www.spinics.net/lists/intel-gfx/msg96005.html
> Looks like a (recent) h/w issue with this system?
>
>> Test kms_sink_crc_basic:
>>                  skip       -> PASS       (ro-skl-i7-6700hq)
>>
>> fi-bsw-n3050     total:218  pass:174  dwarn:0   dfail:0   fail:2
>> skip:42
>> fi-byt-n2820     total:218  pass:174  dwarn:0   dfail:0   fail:3
>> skip:41
>> fi-hsw-i7-4770k  total:206  pass:186  dwarn:0   dfail:0   fail:0
>> skip:19
>> fi-hsw-i7-4770r  total:219  pass:193  dwarn:0   dfail:0   fail:0
>> skip:26
>> fi-kbl-y         total:219  pass:191  dwarn:1   dfail:0   fail:2
>> skip:25
>> fi-skl-i7-6700k  total:219  pass:191  dwarn:0   dfail:0   fail:0
>> skip:28
>> fi-snb-i7-2600   total:37   pass:27   dwarn:0   dfail:0   fail:0   skip:9
>> ro-bdw-i5-5250u  total:219  pass:181  dwarn:0   dfail:0   fail:0
>> skip:38
>> ro-bdw-i7-5557U  total:219  pass:206  dwarn:0   dfail:0   fail:0
>> skip:13
>> ro-bdw-i7-5600u  total:219  pass:187  dwarn:0   dfail:0   fail:0
>> skip:32
>> ro-bsw-n3050     total:219  pass:175  dwarn:0   dfail:0   fail:2
>> skip:42
>> ro-byt-n2820     total:218  pass:174  dwarn:0   dfail:0   fail:3
>> skip:41
>> ro-hsw-i3-4010u  total:218  pass:193  dwarn:0   dfail:0   fail:0
>> skip:25
>> ro-hsw-i7-4770r  total:219  pass:194  dwarn:0   dfail:0   fail:0
>> skip:25
>> ro-ilk-i7-620lm  total:219  pass:151  dwarn:0   dfail:0   fail:1
>> skip:67
>> ro-ilk1-i5-650   total:214  pass:151  dwarn:0   dfail:0   fail:2
>> skip:61
>> ro-ivb-i7-3770   total:219  pass:183  dwarn:0   dfail:0   fail:0
>> skip:36
>> ro-ivb2-i7-3770  total:219  pass:187  dwarn:0   dfail:0   fail:0
>> skip:32
>> ro-skl-i7-6700hq total:214  pass:190  dwarn:0   dfail:0   fail:0
>> skip:24
>> ro-snb-i7-2620M  total:219  pass:177  dwarn:0   dfail:0   fail:1
>> skip:41
>>
>> Results at /archive/results/CI_IGT_test/RO_Patchwork_922/
>>
>> 68c6a6d drm-intel-nightly: 2016y-05m-17d-13h-59m-27s UTC integration
>> manifest
>> 0c07ab7 drm/i915/bxt: reserve space for RC6 in the the GuC WOPCM

Merged, thanks for the patch and review.

Regards,

Tvrtko
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_guc_reg.h b/drivers/gpu/drm/i915/i915_guc_reg.h
index 80786d9..cf5a65b 100644
--- a/drivers/gpu/drm/i915/i915_guc_reg.h
+++ b/drivers/gpu/drm/i915/i915_guc_reg.h
@@ -67,11 +67,11 @@ 
 #define   GUC_WOPCM_OFFSET_VALUE	  0x80000	/* 512KB */
 #define GUC_MAX_IDLE_COUNT		_MMIO(0xC3E4)
 
+/* Defines WOPCM space available to GuC firmware */
 #define GUC_WOPCM_SIZE			_MMIO(0xc050)
-#define   GUC_WOPCM_SIZE_VALUE  	  (0x80 << 12)	/* 512KB */
-
 /* GuC addresses below GUC_WOPCM_TOP don't map through the GTT */
-#define	GUC_WOPCM_TOP			(GUC_WOPCM_SIZE_VALUE)
+#define   GUC_WOPCM_TOP			  (0x80 << 12)	/* 512KB */
+#define   BXT_GUC_WOPCM_RC6_RESERVED	  (0x10 << 12)	/* 64KB  */
 
 #define GEN8_GT_PM_CONFIG		_MMIO(0x138140)
 #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 23345e1..34405de 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)
 	return ret;
 }
 
+static u32 guc_wopcm_size(struct drm_i915_private *dev_priv)
+{
+	u32 wopcm_size = GUC_WOPCM_TOP;
+
+	/* On BXT, the top of WOPCM is reserved for RC6 context */
+	if (IS_BROXTON(dev_priv))
+		wopcm_size -= BXT_GUC_WOPCM_RC6_RESERVED;
+
+	return wopcm_size;
+}
+
 /*
  * Load the GuC firmware blob into the MinuteIA.
  */
@@ -311,7 +322,7 @@  static int guc_ucode_xfer(struct drm_i915_private *dev_priv)
 	intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
 
 	/* init WOPCM */
-	I915_WRITE(GUC_WOPCM_SIZE, GUC_WOPCM_SIZE_VALUE);
+	I915_WRITE(GUC_WOPCM_SIZE, guc_wopcm_size(dev_priv));
 	I915_WRITE(DMA_GUC_WOPCM_OFFSET, GUC_WOPCM_OFFSET_VALUE);
 
 	/* 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)
 
 	/* Header and uCode will be loaded to WOPCM. Size of the two. */
 	size = guc_fw->header_size + guc_fw->ucode_size;
-
-	/* Top 32k of WOPCM is reserved (8K stack + 24k RC6 context). */
-	if (size > GUC_WOPCM_SIZE_VALUE - 0x8000) {
+	if (size > guc_wopcm_size(dev->dev_private)) {
 		DRM_ERROR("Firmware is too large to fit in WOPCM\n");
 		goto fail;
 	}