All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/icl: Fix context RPCS programming
@ 2018-08-31 11:53 Tvrtko Ursulin
  2018-08-31 12:07 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2018-08-31 11:53 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

There are two issues with the current RPCS programming for Icelake:

Expansion of the slice count bitfield has been missed, as well as the
required programming workaround for the subslice count bitfield size
limitation.

1)

Bitfield width for configuring the active slice count has grown so we need
to program the GEN8_R_PWR_CLK_STATE accordingly.

Current code was always requesting eight times the number of slices (due
writting to a bitfield starting three bits higher than it should). These
requests were luckily a) capped by the hardware to the available number of
slices, and b) we haven't yet exported the code to ask for reduced slice
configurations.

Due both of the above there was no impact from this incorrect programming
but we should still fix it.

2)

Due subslice count bitfield being only three bits wide and furthermore
capped to a maximum documented value of four, special programming
workaround is needed to enable more than four subslices.

With this programming driver has to consider the GT configuration as
2x4x8, while the hardware internally translates this to 1x8x8.

A limitation stemming from this is that either a subslice count between
one and four can be selected, or a subslice count equaling the total
number of subslices in all selected slices. In other words, odd subslice
counts greater than four are impossible, as are odd subslice counts
greater than a single slice subslice count.

This also had no impact in the current code base due breakage from 1)
always reqesting more than one slice.

While fixing this we also add some asserts to flag up any future bitfield
overflows.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Bspec: 12247
Reported-by: tony.ye@intel.com
Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: tony.ye@intel.com
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h  |  2 +
 drivers/gpu/drm/i915/intel_lrc.c | 89 +++++++++++++++++++++++++++-----
 2 files changed, 78 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f2321785cbd6..09bc8e730ee1 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -344,6 +344,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   GEN8_RPCS_S_CNT_ENABLE	(1 << 18)
 #define   GEN8_RPCS_S_CNT_SHIFT		15
 #define   GEN8_RPCS_S_CNT_MASK		(0x7 << GEN8_RPCS_S_CNT_SHIFT)
+#define   GEN11_RPCS_S_CNT_SHIFT	12
+#define   GEN11_RPCS_S_CNT_MASK		(0x3f << GEN11_RPCS_S_CNT_SHIFT)
 #define   GEN8_RPCS_SS_CNT_ENABLE	(1 << 11)
 #define   GEN8_RPCS_SS_CNT_SHIFT	8
 #define   GEN8_RPCS_SS_CNT_MASK		(0x7 << GEN8_RPCS_SS_CNT_SHIFT)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index f8ceb9c99dd6..323c46319cb8 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -2480,6 +2480,9 @@ int logical_xcs_ring_init(struct intel_engine_cs *engine)
 static u32
 make_rpcs(struct drm_i915_private *dev_priv)
 {
+	bool subslice_pg = INTEL_INFO(dev_priv)->sseu.has_subslice_pg;
+	u8 slices = hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask);
+	u8 subslices = hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]);
 	u32 rpcs = 0;
 
 	/*
@@ -2489,6 +2492,38 @@ make_rpcs(struct drm_i915_private *dev_priv)
 	if (INTEL_GEN(dev_priv) < 9)
 		return 0;
 
+	/*
+	 * Since the SScount bitfield in GEN8_R_PWR_CLK_STATE is only three bits
+	 * wide and Icelake has up to eight subslices, specfial programming is
+	 * needed in order to correctly enable all subslices.
+	 *
+	 * According to documentation software must consider the configuration
+	 * as 2x4x8 and hardware will translate this to 1x8x8.
+	 *
+	 * Furthemore, even though SScount is three bits, maximum documented
+	 * value for it is four. From this some rules/restrictions follow:
+	 *
+	 * 1.
+	 * If enabled subslice count is greater than four, two whole slices must
+	 * be enabled instead.
+	 *
+	 * 2.
+	 * When more than one slice is enabled, hardware ignores the subslice
+	 * count altogether.
+	 *
+	 * From these restrictions it follows that it is not possible to enable
+	 * a count of subslices between the SScount maximum of four restriction,
+	 * and the maximum available number on a particular SKU. Either all
+	 * subslices are enabled, or a count between one and four on the first
+	 * slice.
+	 */
+	if (IS_GEN11(dev_priv) && slices == 1 && subslices >= 4) {
+		GEM_BUG_ON(subslices & 1);
+
+		subslice_pg = false;
+		slices *= 2;
+	}
+
 	/*
 	 * Starting in Gen9, render power gating can leave
 	 * slice/subslice/EU in a partially enabled state. We
@@ -2496,24 +2531,52 @@ make_rpcs(struct drm_i915_private *dev_priv)
 	 * enablement.
 	*/
 	if (INTEL_INFO(dev_priv)->sseu.has_slice_pg) {
-		rpcs |= GEN8_RPCS_S_CNT_ENABLE;
-		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask) <<
-			GEN8_RPCS_S_CNT_SHIFT;
-		rpcs |= GEN8_RPCS_ENABLE;
+		u32 mask;
+
+		rpcs = slices;
+
+		if (INTEL_GEN(dev_priv) >= 11) {
+			mask = GEN11_RPCS_S_CNT_MASK;
+			rpcs <<= GEN11_RPCS_S_CNT_SHIFT;
+		} else {
+			mask = GEN8_RPCS_S_CNT_MASK;
+			rpcs <<= GEN8_RPCS_S_CNT_SHIFT;
+		}
+
+		GEM_BUG_ON(rpcs & ~mask);
+		rpcs &= mask;
+
+		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_S_CNT_ENABLE;
 	}
 
-	if (INTEL_INFO(dev_priv)->sseu.has_subslice_pg) {
-		rpcs |= GEN8_RPCS_SS_CNT_ENABLE;
-		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]) <<
-			GEN8_RPCS_SS_CNT_SHIFT;
-		rpcs |= GEN8_RPCS_ENABLE;
+	if (subslice_pg) {
+		u32 val = subslices;
+
+		val <<= GEN8_RPCS_SS_CNT_SHIFT;
+
+		GEM_BUG_ON(val & ~GEN8_RPCS_SS_CNT_MASK);
+		val &= GEN8_RPCS_SS_CNT_MASK;
+
+		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_SS_CNT_ENABLE | val;
 	}
 
 	if (INTEL_INFO(dev_priv)->sseu.has_eu_pg) {
-		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
-			GEN8_RPCS_EU_MIN_SHIFT;
-		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
-			GEN8_RPCS_EU_MAX_SHIFT;
+		u32 val;
+
+		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
+		      GEN8_RPCS_EU_MIN_SHIFT;
+		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MIN_MASK);
+		val &= GEN8_RPCS_EU_MIN_MASK;
+
+		rpcs |= val;
+
+		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
+		      GEN8_RPCS_EU_MAX_SHIFT;
+		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MAX_MASK);
+		val &= GEN8_RPCS_EU_MAX_MASK;
+
+		rpcs |= val;
+
 		rpcs |= GEN8_RPCS_ENABLE;
 	}
 
-- 
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] 11+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: Fix context RPCS programming
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
@ 2018-08-31 12:07 ` Patchwork
  2018-08-31 12:23 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-08-31 12:07 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming
URL   : https://patchwork.freedesktop.org/series/49005/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
8b03edf949e3 drm/i915/icl: Fix context RPCS programming
-:18: WARNING:TYPO_SPELLING: 'writting' may be misspelled - perhaps 'writing'?
#18: 
writting to a bitfield starting three bits higher than it should). These

total: 0 errors, 1 warnings, 0 checks, 120 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm/i915/icl: Fix context RPCS programming
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
  2018-08-31 12:07 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-08-31 12:23 ` Patchwork
  2018-08-31 16:18 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-08-31 12:23 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming
URL   : https://patchwork.freedesktop.org/series/49005/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4748 -> Patchwork_10059 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49005/revisions/1/mbox/

== Known issues ==

  Here are the changes found in Patchwork_10059 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-WARN (fdo#102614)
      {fi-byt-clapper}:   PASS -> FAIL (fdo#103167)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

    {igt@kms_psr@primary_page_flip}:
      fi-cnl-psr:         FAIL (fdo#107336) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336


== Participating hosts (53 -> 48) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4748 -> Patchwork_10059

  CI_DRM_4748: 6caeb081ceb9282503439565e7093c1032758289 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4613: 3f89d7b02dcf662e994c7135b13d52bc8e09a4ea @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10059: 8b03edf949e3c9c6d97154e40c11f1f0d2a1aec7 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

8b03edf949e3 drm/i915/icl: Fix context RPCS programming

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10059/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915/icl: Fix context RPCS programming
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
  2018-08-31 12:07 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-08-31 12:23 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-08-31 16:18 ` Patchwork
  2018-08-31 16:52 ` [PATCH] " Lionel Landwerlin
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-08-31 16:18 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming
URL   : https://patchwork.freedesktop.org/series/49005/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4748_full -> Patchwork_10059_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10059_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10059_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10059_full:

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in Patchwork_10059_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_ctx_isolation@vecs0-s3:
      shard-kbl:          PASS -> DMESG-WARN (fdo#103313)

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-snb:          NOTRUN -> INCOMPLETE (fdo#106887, fdo#105411)
      shard-kbl:          PASS -> INCOMPLETE (fdo#106023, fdo#103665)

    igt@kms_cursor_legacy@cursor-vs-flip-atomic-transitions:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_flip@flip-vs-dpms-off-vs-modeset:
      shard-apl:          PASS -> DMESG-WARN (fdo#103558, fdo#105602) +5

    
    ==== Possible fixes ====

    igt@gem_exec_store@pages-blt:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_cursor_crc@cursor-256x256-suspend:
      shard-apl:          INCOMPLETE (fdo#103927) -> PASS

    igt@kms_cursor_legacy@cursor-vs-flip-varying-size:
      shard-hsw:          FAIL (fdo#103355) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
      shard-glk:          FAIL (fdo#103167) -> PASS

    igt@kms_setmode@basic:
      shard-kbl:          FAIL (fdo#99912) -> PASS

    
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103313 https://bugs.freedesktop.org/show_bug.cgi?id=103313
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
  fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4748 -> Patchwork_10059

  CI_DRM_4748: 6caeb081ceb9282503439565e7093c1032758289 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4613: 3f89d7b02dcf662e994c7135b13d52bc8e09a4ea @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10059: 8b03edf949e3c9c6d97154e40c11f1f0d2a1aec7 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10059/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH] drm/i915/icl: Fix context RPCS programming
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
                   ` (2 preceding siblings ...)
  2018-08-31 16:18 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-08-31 16:52 ` Lionel Landwerlin
  2018-09-03 11:11   ` Tvrtko Ursulin
  2018-09-03 12:34 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: Fix context RPCS programming (rev2) Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 11+ messages in thread
From: Lionel Landwerlin @ 2018-08-31 16:52 UTC (permalink / raw)
  To: Tvrtko Ursulin, Intel-gfx

On 31/08/2018 12:53, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> There are two issues with the current RPCS programming for Icelake:
>
> Expansion of the slice count bitfield has been missed, as well as the
> required programming workaround for the subslice count bitfield size
> limitation.
>
> 1)
>
> Bitfield width for configuring the active slice count has grown so we need
> to program the GEN8_R_PWR_CLK_STATE accordingly.
>
> Current code was always requesting eight times the number of slices (due
> writting to a bitfield starting three bits higher than it should). These
> requests were luckily a) capped by the hardware to the available number of
> slices, and b) we haven't yet exported the code to ask for reduced slice
> configurations.
>
> Due both of the above there was no impact from this incorrect programming
> but we should still fix it.
>
> 2)
>
> Due subslice count bitfield being only three bits wide and furthermore
> capped to a maximum documented value of four, special programming
> workaround is needed to enable more than four subslices.
>
> With this programming driver has to consider the GT configuration as
> 2x4x8, while the hardware internally translates this to 1x8x8.
>
> A limitation stemming from this is that either a subslice count between
> one and four can be selected, or a subslice count equaling the total
> number of subslices in all selected slices. In other words, odd subslice
> counts greater than four are impossible, as are odd subslice counts
> greater than a single slice subslice count.
>
> This also had no impact in the current code base due breakage from 1)
> always reqesting more than one slice.
>
> While fixing this we also add some asserts to flag up any future bitfield
> overflows.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Bspec: 12247
> Reported-by: tony.ye@intel.com
> Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> Cc: tony.ye@intel.com
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> ---
>   drivers/gpu/drm/i915/i915_reg.h  |  2 +
>   drivers/gpu/drm/i915/intel_lrc.c | 89 +++++++++++++++++++++++++++-----
>   2 files changed, 78 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index f2321785cbd6..09bc8e730ee1 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -344,6 +344,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
>   #define   GEN8_RPCS_S_CNT_ENABLE	(1 << 18)
>   #define   GEN8_RPCS_S_CNT_SHIFT		15
>   #define   GEN8_RPCS_S_CNT_MASK		(0x7 << GEN8_RPCS_S_CNT_SHIFT)
> +#define   GEN11_RPCS_S_CNT_SHIFT	12
> +#define   GEN11_RPCS_S_CNT_MASK		(0x3f << GEN11_RPCS_S_CNT_SHIFT)
>   #define   GEN8_RPCS_SS_CNT_ENABLE	(1 << 11)
>   #define   GEN8_RPCS_SS_CNT_SHIFT	8
>   #define   GEN8_RPCS_SS_CNT_MASK		(0x7 << GEN8_RPCS_SS_CNT_SHIFT)
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index f8ceb9c99dd6..323c46319cb8 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -2480,6 +2480,9 @@ int logical_xcs_ring_init(struct intel_engine_cs *engine)
>   static u32
>   make_rpcs(struct drm_i915_private *dev_priv)
>   {
> +	bool subslice_pg = INTEL_INFO(dev_priv)->sseu.has_subslice_pg;
> +	u8 slices = hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask);
> +	u8 subslices = hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]);
>   	u32 rpcs = 0;
>   
>   	/*
> @@ -2489,6 +2492,38 @@ make_rpcs(struct drm_i915_private *dev_priv)
>   	if (INTEL_GEN(dev_priv) < 9)
>   		return 0;
>   
> +	/*
> +	 * Since the SScount bitfield in GEN8_R_PWR_CLK_STATE is only three bits
> +	 * wide and Icelake has up to eight subslices, specfial programming is
> +	 * needed in order to correctly enable all subslices.
> +	 *
> +	 * According to documentation software must consider the configuration
> +	 * as 2x4x8 and hardware will translate this to 1x8x8.
> +	 *
> +	 * Furthemore, even though SScount is three bits, maximum documented
> +	 * value for it is four. From this some rules/restrictions follow:
> +	 *
> +	 * 1.
> +	 * If enabled subslice count is greater than four, two whole slices must
> +	 * be enabled instead.
> +	 *
> +	 * 2.
> +	 * When more than one slice is enabled, hardware ignores the subslice
> +	 * count altogether.
> +	 *
> +	 * From these restrictions it follows that it is not possible to enable
> +	 * a count of subslices between the SScount maximum of four restriction,
> +	 * and the maximum available number on a particular SKU. Either all
> +	 * subslices are enabled, or a count between one and four on the first
> +	 * slice.
> +	 */
> +	if (IS_GEN11(dev_priv) && slices == 1 && subslices >= 4) {
> +		GEM_BUG_ON(subslices & 1);
> +
> +		subslice_pg = false;


Err... Now I'm looking at the documentation again and I see this for the 
subslice enable field :


Enable Subslice Count Request.

0 = Use Async subslice count

1 = Use SScount in this register


Searching for "Async subslice count" leads me to another register (BSpec 
9497).

Really confused as to what this does :|

Is the hardware then reading for that second register if you set 
SSCountEn to 0?


We could put max(hweight8(sseu.subslice_mask[0]), 4) in SSCount, but 
it's unclear what's right...


If you feel like this needs to be investigated, go ahead.

Otherwise I have a minor style suggestion below, either way :


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>


> +		slices *= 2;
> +	}
> +
>   	/*
>   	 * Starting in Gen9, render power gating can leave
>   	 * slice/subslice/EU in a partially enabled state. We
> @@ -2496,24 +2531,52 @@ make_rpcs(struct drm_i915_private *dev_priv)
>   	 * enablement.
>   	*/
>   	if (INTEL_INFO(dev_priv)->sseu.has_slice_pg) {
> -		rpcs |= GEN8_RPCS_S_CNT_ENABLE;
> -		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask) <<
> -			GEN8_RPCS_S_CNT_SHIFT;
> -		rpcs |= GEN8_RPCS_ENABLE;


I would use a u32 val; like you did for the subslice part below and just 
OR things together.

Just feels a bit more readable, but up to you.


> +		u32 mask;
> +
> +		rpcs = slices;
> +
> +		if (INTEL_GEN(dev_priv) >= 11) {
> +			mask = GEN11_RPCS_S_CNT_MASK;
> +			rpcs <<= GEN11_RPCS_S_CNT_SHIFT;
> +		} else {
> +			mask = GEN8_RPCS_S_CNT_MASK;
> +			rpcs <<= GEN8_RPCS_S_CNT_SHIFT;
> +		}
> +
> +		GEM_BUG_ON(rpcs & ~mask);
> +		rpcs &= mask;
> +
> +		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_S_CNT_ENABLE;
>   	}
>   
> -	if (INTEL_INFO(dev_priv)->sseu.has_subslice_pg) {
> -		rpcs |= GEN8_RPCS_SS_CNT_ENABLE;
> -		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]) <<
> -			GEN8_RPCS_SS_CNT_SHIFT;
> -		rpcs |= GEN8_RPCS_ENABLE;
> +	if (subslice_pg) {
> +		u32 val = subslices;
> +
> +		val <<= GEN8_RPCS_SS_CNT_SHIFT;
> +
> +		GEM_BUG_ON(val & ~GEN8_RPCS_SS_CNT_MASK);
> +		val &= GEN8_RPCS_SS_CNT_MASK;
> +
> +		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_SS_CNT_ENABLE | val;
>   	}
>   
>   	if (INTEL_INFO(dev_priv)->sseu.has_eu_pg) {
> -		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
> -			GEN8_RPCS_EU_MIN_SHIFT;
> -		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
> -			GEN8_RPCS_EU_MAX_SHIFT;
> +		u32 val;
> +
> +		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
> +		      GEN8_RPCS_EU_MIN_SHIFT;
> +		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MIN_MASK);
> +		val &= GEN8_RPCS_EU_MIN_MASK;
> +
> +		rpcs |= val;
> +
> +		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
> +		      GEN8_RPCS_EU_MAX_SHIFT;
> +		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MAX_MASK);
> +		val &= GEN8_RPCS_EU_MAX_MASK;
> +
> +		rpcs |= val;
> +
>   		rpcs |= GEN8_RPCS_ENABLE;
>   	}
>   


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

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

* Re: [PATCH] drm/i915/icl: Fix context RPCS programming
  2018-08-31 16:52 ` [PATCH] " Lionel Landwerlin
@ 2018-09-03 11:11   ` Tvrtko Ursulin
  2018-09-03 11:30     ` [PATCH v2] " Tvrtko Ursulin
  0 siblings, 1 reply; 11+ messages in thread
From: Tvrtko Ursulin @ 2018-09-03 11:11 UTC (permalink / raw)
  To: Lionel Landwerlin, Tvrtko Ursulin, Intel-gfx


On 31/08/2018 17:52, Lionel Landwerlin wrote:
> On 31/08/2018 12:53, Tvrtko Ursulin wrote:
>> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>
>> There are two issues with the current RPCS programming for Icelake:
>>
>> Expansion of the slice count bitfield has been missed, as well as the
>> required programming workaround for the subslice count bitfield size
>> limitation.
>>
>> 1)
>>
>> Bitfield width for configuring the active slice count has grown so we 
>> need
>> to program the GEN8_R_PWR_CLK_STATE accordingly.
>>
>> Current code was always requesting eight times the number of slices (due
>> writting to a bitfield starting three bits higher than it should). These
>> requests were luckily a) capped by the hardware to the available 
>> number of
>> slices, and b) we haven't yet exported the code to ask for reduced slice
>> configurations.
>>
>> Due both of the above there was no impact from this incorrect programming
>> but we should still fix it.
>>
>> 2)
>>
>> Due subslice count bitfield being only three bits wide and furthermore
>> capped to a maximum documented value of four, special programming
>> workaround is needed to enable more than four subslices.
>>
>> With this programming driver has to consider the GT configuration as
>> 2x4x8, while the hardware internally translates this to 1x8x8.
>>
>> A limitation stemming from this is that either a subslice count between
>> one and four can be selected, or a subslice count equaling the total
>> number of subslices in all selected slices. In other words, odd subslice
>> counts greater than four are impossible, as are odd subslice counts
>> greater than a single slice subslice count.
>>
>> This also had no impact in the current code base due breakage from 1)
>> always reqesting more than one slice.
>>
>> While fixing this we also add some asserts to flag up any future bitfield
>> overflows.
>>
>> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> Bspec: 12247
>> Reported-by: tony.ye@intel.com
>> Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> Cc: tony.ye@intel.com
>> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_reg.h  |  2 +
>>   drivers/gpu/drm/i915/intel_lrc.c | 89 +++++++++++++++++++++++++++-----
>>   2 files changed, 78 insertions(+), 13 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h 
>> b/drivers/gpu/drm/i915/i915_reg.h
>> index f2321785cbd6..09bc8e730ee1 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -344,6 +344,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t 
>> reg)
>>   #define   GEN8_RPCS_S_CNT_ENABLE    (1 << 18)
>>   #define   GEN8_RPCS_S_CNT_SHIFT        15
>>   #define   GEN8_RPCS_S_CNT_MASK        (0x7 << GEN8_RPCS_S_CNT_SHIFT)
>> +#define   GEN11_RPCS_S_CNT_SHIFT    12
>> +#define   GEN11_RPCS_S_CNT_MASK        (0x3f << GEN11_RPCS_S_CNT_SHIFT)
>>   #define   GEN8_RPCS_SS_CNT_ENABLE    (1 << 11)
>>   #define   GEN8_RPCS_SS_CNT_SHIFT    8
>>   #define   GEN8_RPCS_SS_CNT_MASK        (0x7 << GEN8_RPCS_SS_CNT_SHIFT)
>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c 
>> b/drivers/gpu/drm/i915/intel_lrc.c
>> index f8ceb9c99dd6..323c46319cb8 100644
>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>> @@ -2480,6 +2480,9 @@ int logical_xcs_ring_init(struct intel_engine_cs 
>> *engine)
>>   static u32
>>   make_rpcs(struct drm_i915_private *dev_priv)
>>   {
>> +    bool subslice_pg = INTEL_INFO(dev_priv)->sseu.has_subslice_pg;
>> +    u8 slices = hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask);
>> +    u8 subslices = 
>> hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]);
>>       u32 rpcs = 0;
>>       /*
>> @@ -2489,6 +2492,38 @@ make_rpcs(struct drm_i915_private *dev_priv)
>>       if (INTEL_GEN(dev_priv) < 9)
>>           return 0;
>> +    /*
>> +     * Since the SScount bitfield in GEN8_R_PWR_CLK_STATE is only 
>> three bits
>> +     * wide and Icelake has up to eight subslices, specfial 
>> programming is
>> +     * needed in order to correctly enable all subslices.
>> +     *
>> +     * According to documentation software must consider the 
>> configuration
>> +     * as 2x4x8 and hardware will translate this to 1x8x8.
>> +     *
>> +     * Furthemore, even though SScount is three bits, maximum documented
>> +     * value for it is four. From this some rules/restrictions follow:
>> +     *
>> +     * 1.
>> +     * If enabled subslice count is greater than four, two whole 
>> slices must
>> +     * be enabled instead.
>> +     *
>> +     * 2.
>> +     * When more than one slice is enabled, hardware ignores the 
>> subslice
>> +     * count altogether.
>> +     *
>> +     * From these restrictions it follows that it is not possible to 
>> enable
>> +     * a count of subslices between the SScount maximum of four 
>> restriction,
>> +     * and the maximum available number on a particular SKU. Either all
>> +     * subslices are enabled, or a count between one and four on the 
>> first
>> +     * slice.
>> +     */
>> +    if (IS_GEN11(dev_priv) && slices == 1 && subslices >= 4) {
>> +        GEM_BUG_ON(subslices & 1);
>> +
>> +        subslice_pg = false;
> 
> 
> Err... Now I'm looking at the documentation again and I see this for the 
> subslice enable field :
> 
> 
> Enable Subslice Count Request.
> 
> 0 = Use Async subslice count
> 
> 1 = Use SScount in this register
> 
> 
> Searching for "Async subslice count" leads me to another register (BSpec 
> 9497).
> 
> Really confused as to what this does :|
> 
> Is the hardware then reading for that second register if you set 
> SSCountEn to 0?

I think it isn't. Well, by transitive property of subslice shutdown not 
being supported unless slice count is one. So when we set slice count to 
greater than one, it doesn't matter what we put in any subslice control 
fields.

As bspec 33575 says programming via R_PWR_CLK_STATE is preferred over 
the Async mode config, I think we are overall good with this patch.

> 
> 
> We could put max(hweight8(sseu.subslice_mask[0]), 4) in SSCount, but 
> it's unclear what's right...
> 
> 
> If you feel like this needs to be investigated, go ahead.
> 
> Otherwise I have a minor style suggestion below, either way :
> 
> 
> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> 
> 
>> +        slices *= 2;
>> +    }
>> +
>>       /*
>>        * Starting in Gen9, render power gating can leave
>>        * slice/subslice/EU in a partially enabled state. We
>> @@ -2496,24 +2531,52 @@ make_rpcs(struct drm_i915_private *dev_priv)
>>        * enablement.
>>       */
>>       if (INTEL_INFO(dev_priv)->sseu.has_slice_pg) {
>> -        rpcs |= GEN8_RPCS_S_CNT_ENABLE;
>> -        rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask) <<
>> -            GEN8_RPCS_S_CNT_SHIFT;
>> -        rpcs |= GEN8_RPCS_ENABLE;
> 
> 
> I would use a u32 val; like you did for the subslice part below and just 
> OR things together.
> 
> Just feels a bit more readable, but up to you.

I know, was 50-50 on this myself. You tipped the scale now so I'll 
respin. Thanks for the r-b, I'll keep it for this tweak.

Regards,

Tvrtko

> 
>> +        u32 mask;
>> +
>> +        rpcs = slices;
>> +
>> +        if (INTEL_GEN(dev_priv) >= 11) {
>> +            mask = GEN11_RPCS_S_CNT_MASK;
>> +            rpcs <<= GEN11_RPCS_S_CNT_SHIFT;
>> +        } else {
>> +            mask = GEN8_RPCS_S_CNT_MASK;
>> +            rpcs <<= GEN8_RPCS_S_CNT_SHIFT;
>> +        }
>> +
>> +        GEM_BUG_ON(rpcs & ~mask);
>> +        rpcs &= mask;
>> +
>> +        rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_S_CNT_ENABLE;
>>       }
>> -    if (INTEL_INFO(dev_priv)->sseu.has_subslice_pg) {
>> -        rpcs |= GEN8_RPCS_SS_CNT_ENABLE;
>> -        rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]) <<
>> -            GEN8_RPCS_SS_CNT_SHIFT;
>> -        rpcs |= GEN8_RPCS_ENABLE;
>> +    if (subslice_pg) {
>> +        u32 val = subslices;
>> +
>> +        val <<= GEN8_RPCS_SS_CNT_SHIFT;
>> +
>> +        GEM_BUG_ON(val & ~GEN8_RPCS_SS_CNT_MASK);
>> +        val &= GEN8_RPCS_SS_CNT_MASK;
>> +
>> +        rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_SS_CNT_ENABLE | val;
>>       }
>>       if (INTEL_INFO(dev_priv)->sseu.has_eu_pg) {
>> -        rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
>> -            GEN8_RPCS_EU_MIN_SHIFT;
>> -        rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
>> -            GEN8_RPCS_EU_MAX_SHIFT;
>> +        u32 val;
>> +
>> +        val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
>> +              GEN8_RPCS_EU_MIN_SHIFT;
>> +        GEM_BUG_ON(val & ~GEN8_RPCS_EU_MIN_MASK);
>> +        val &= GEN8_RPCS_EU_MIN_MASK;
>> +
>> +        rpcs |= val;
>> +
>> +        val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
>> +              GEN8_RPCS_EU_MAX_SHIFT;
>> +        GEM_BUG_ON(val & ~GEN8_RPCS_EU_MAX_MASK);
>> +        val &= GEN8_RPCS_EU_MAX_MASK;
>> +
>> +        rpcs |= val;
>> +
>>           rpcs |= GEN8_RPCS_ENABLE;
>>       }
> 
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH v2] drm/i915/icl: Fix context RPCS programming
  2018-09-03 11:11   ` Tvrtko Ursulin
@ 2018-09-03 11:30     ` Tvrtko Ursulin
  0 siblings, 0 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2018-09-03 11:30 UTC (permalink / raw)
  To: Intel-gfx

From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

There are two issues with the current RPCS programming for Icelake:

Expansion of the slice count bitfield has been missed, as well as the
required programming workaround for the subslice count bitfield size
limitation.

1)

Bitfield width for configuring the active slice count has grown so we need
to program the GEN8_R_PWR_CLK_STATE accordingly.

Current code was always requesting eight times the number of slices (due
writting to a bitfield starting three bits higher than it should). These
requests were luckily a) capped by the hardware to the available number of
slices, and b) we haven't yet exported the code to ask for reduced slice
configurations.

Due both of the above there was no impact from this incorrect programming
but we should still fix it.

2)

Due subslice count bitfield being only three bits wide and furthermore
capped to a maximum documented value of four, special programming
workaround is needed to enable more than four subslices.

With this programming driver has to consider the GT configuration as
2x4x8, while the hardware internally translates this to 1x8x8.

A limitation stemming from this is that either a subslice count between
one and four can be selected, or a subslice count equaling the total
number of subslices in all selected slices. In other words, odd subslice
counts greater than four are impossible, as are odd subslice counts
greater than a single slice subslice count.

This also had no impact in the current code base due breakage from 1)
always reqesting more than one slice.

While fixing this we also add some asserts to flag up any future bitfield
overflows.

v2:
 * Use a local in all branches for clarity. (Lionel)

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Bspec: 12247
Reported-by: tony.ye@intel.com
Suggested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: tony.ye@intel.com
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h  |  2 +
 drivers/gpu/drm/i915/intel_lrc.c | 87 +++++++++++++++++++++++++++-----
 2 files changed, 76 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index f2321785cbd6..09bc8e730ee1 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -344,6 +344,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define   GEN8_RPCS_S_CNT_ENABLE	(1 << 18)
 #define   GEN8_RPCS_S_CNT_SHIFT		15
 #define   GEN8_RPCS_S_CNT_MASK		(0x7 << GEN8_RPCS_S_CNT_SHIFT)
+#define   GEN11_RPCS_S_CNT_SHIFT	12
+#define   GEN11_RPCS_S_CNT_MASK		(0x3f << GEN11_RPCS_S_CNT_SHIFT)
 #define   GEN8_RPCS_SS_CNT_ENABLE	(1 << 11)
 #define   GEN8_RPCS_SS_CNT_SHIFT	8
 #define   GEN8_RPCS_SS_CNT_MASK		(0x7 << GEN8_RPCS_SS_CNT_SHIFT)
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index f8ceb9c99dd6..def467c2451b 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -2480,6 +2480,9 @@ int logical_xcs_ring_init(struct intel_engine_cs *engine)
 static u32
 make_rpcs(struct drm_i915_private *dev_priv)
 {
+	bool subslice_pg = INTEL_INFO(dev_priv)->sseu.has_subslice_pg;
+	u8 slices = hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask);
+	u8 subslices = hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]);
 	u32 rpcs = 0;
 
 	/*
@@ -2489,6 +2492,38 @@ make_rpcs(struct drm_i915_private *dev_priv)
 	if (INTEL_GEN(dev_priv) < 9)
 		return 0;
 
+	/*
+	 * Since the SScount bitfield in GEN8_R_PWR_CLK_STATE is only three bits
+	 * wide and Icelake has up to eight subslices, specfial programming is
+	 * needed in order to correctly enable all subslices.
+	 *
+	 * According to documentation software must consider the configuration
+	 * as 2x4x8 and hardware will translate this to 1x8x8.
+	 *
+	 * Furthemore, even though SScount is three bits, maximum documented
+	 * value for it is four. From this some rules/restrictions follow:
+	 *
+	 * 1.
+	 * If enabled subslice count is greater than four, two whole slices must
+	 * be enabled instead.
+	 *
+	 * 2.
+	 * When more than one slice is enabled, hardware ignores the subslice
+	 * count altogether.
+	 *
+	 * From these restrictions it follows that it is not possible to enable
+	 * a count of subslices between the SScount maximum of four restriction,
+	 * and the maximum available number on a particular SKU. Either all
+	 * subslices are enabled, or a count between one and four on the first
+	 * slice.
+	 */
+	if (IS_GEN11(dev_priv) && slices == 1 && subslices >= 4) {
+		GEM_BUG_ON(subslices & 1);
+
+		subslice_pg = false;
+		slices *= 2;
+	}
+
 	/*
 	 * Starting in Gen9, render power gating can leave
 	 * slice/subslice/EU in a partially enabled state. We
@@ -2496,24 +2531,50 @@ make_rpcs(struct drm_i915_private *dev_priv)
 	 * enablement.
 	*/
 	if (INTEL_INFO(dev_priv)->sseu.has_slice_pg) {
-		rpcs |= GEN8_RPCS_S_CNT_ENABLE;
-		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.slice_mask) <<
-			GEN8_RPCS_S_CNT_SHIFT;
-		rpcs |= GEN8_RPCS_ENABLE;
+		u32 mask, val = slices;
+
+		if (INTEL_GEN(dev_priv) >= 11) {
+			mask = GEN11_RPCS_S_CNT_MASK;
+			val <<= GEN11_RPCS_S_CNT_SHIFT;
+		} else {
+			mask = GEN8_RPCS_S_CNT_MASK;
+			val <<= GEN8_RPCS_S_CNT_SHIFT;
+		}
+
+		GEM_BUG_ON(val & ~mask);
+		val &= mask;
+
+		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_S_CNT_ENABLE | val;
 	}
 
-	if (INTEL_INFO(dev_priv)->sseu.has_subslice_pg) {
-		rpcs |= GEN8_RPCS_SS_CNT_ENABLE;
-		rpcs |= hweight8(INTEL_INFO(dev_priv)->sseu.subslice_mask[0]) <<
-			GEN8_RPCS_SS_CNT_SHIFT;
-		rpcs |= GEN8_RPCS_ENABLE;
+	if (subslice_pg) {
+		u32 val = subslices;
+
+		val <<= GEN8_RPCS_SS_CNT_SHIFT;
+
+		GEM_BUG_ON(val & ~GEN8_RPCS_SS_CNT_MASK);
+		val &= GEN8_RPCS_SS_CNT_MASK;
+
+		rpcs |= GEN8_RPCS_ENABLE | GEN8_RPCS_SS_CNT_ENABLE | val;
 	}
 
 	if (INTEL_INFO(dev_priv)->sseu.has_eu_pg) {
-		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
-			GEN8_RPCS_EU_MIN_SHIFT;
-		rpcs |= INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
-			GEN8_RPCS_EU_MAX_SHIFT;
+		u32 val;
+
+		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
+		      GEN8_RPCS_EU_MIN_SHIFT;
+		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MIN_MASK);
+		val &= GEN8_RPCS_EU_MIN_MASK;
+
+		rpcs |= val;
+
+		val = INTEL_INFO(dev_priv)->sseu.eu_per_subslice <<
+		      GEN8_RPCS_EU_MAX_SHIFT;
+		GEM_BUG_ON(val & ~GEN8_RPCS_EU_MAX_MASK);
+		val &= GEN8_RPCS_EU_MAX_MASK;
+
+		rpcs |= val;
+
 		rpcs |= GEN8_RPCS_ENABLE;
 	}
 
-- 
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] 11+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: Fix context RPCS programming (rev2)
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
                   ` (3 preceding siblings ...)
  2018-08-31 16:52 ` [PATCH] " Lionel Landwerlin
@ 2018-09-03 12:34 ` Patchwork
  2018-09-03 12:53 ` ✓ Fi.CI.BAT: success " Patchwork
  2018-09-03 17:36 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-09-03 12:34 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming (rev2)
URL   : https://patchwork.freedesktop.org/series/49005/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
9a2751c01ca2 drm/i915/icl: Fix context RPCS programming
-:18: WARNING:TYPO_SPELLING: 'writting' may be misspelled - perhaps 'writing'?
#18: 
writting to a bitfield starting three bits higher than it should). These

total: 0 errors, 1 warnings, 0 checks, 118 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm/i915/icl: Fix context RPCS programming (rev2)
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
                   ` (4 preceding siblings ...)
  2018-09-03 12:34 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: Fix context RPCS programming (rev2) Patchwork
@ 2018-09-03 12:53 ` Patchwork
  2018-09-04 13:51   ` Tvrtko Ursulin
  2018-09-03 17:36 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 1 reply; 11+ messages in thread
From: Patchwork @ 2018-09-03 12:53 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming (rev2)
URL   : https://patchwork.freedesktop.org/series/49005/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4757 -> Patchwork_10070 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/49005/revisions/2/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10070:

  === IGT changes ===

    ==== Warnings ====

    {igt@pm_rpm@module-reload}:
      fi-hsw-4770r:       PASS -> SKIP

    
== Known issues ==

  Here are the changes found in Patchwork_10070 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#107425)

    {igt@pm_rpm@module-reload}:
      fi-cnl-psr:         PASS -> WARN (fdo#107708, fdo#107602)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
      {fi-byt-clapper}:   FAIL (fdo#103191, fdo#107362) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS

    igt@kms_psr@primary_page_flip:
      fi-cnl-psr:         FAIL (fdo#107336) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
  fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
  fdo#107708 https://bugs.freedesktop.org/show_bug.cgi?id=107708


== Participating hosts (53 -> 48) ==

  Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u 


== Build changes ==

    * Linux: CI_DRM_4757 -> Patchwork_10070

  CI_DRM_4757: 1465de895e2b5d9e74e9a85189c9075155efa30d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4621: 125eee6e981eac0a004aeb4f327439a132ceac5c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10070: 9a2751c01ca21789da2a8f95dab23033540ad6c9 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

9a2751c01ca2 drm/i915/icl: Fix context RPCS programming

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10070/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* ✓ Fi.CI.IGT: success for drm/i915/icl: Fix context RPCS programming (rev2)
  2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
                   ` (5 preceding siblings ...)
  2018-09-03 12:53 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-09-03 17:36 ` Patchwork
  6 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-09-03 17:36 UTC (permalink / raw)
  To: Tvrtko Ursulin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/icl: Fix context RPCS programming (rev2)
URL   : https://patchwork.freedesktop.org/series/49005/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4757_full -> Patchwork_10070_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_10070_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_10070_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_10070_full:

  === IGT changes ===

    ==== Warnings ====

    igt@perf_pmu@rc6:
      shard-kbl:          PASS -> SKIP

    
== Known issues ==

  Here are the changes found in Patchwork_10070_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_exec_await@wide-contexts:
      shard-glk:          FAIL (fdo#105900) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      shard-apl:          DMESG-WARN (fdo#105602, fdo#103558) -> PASS +2

    igt@kms_setmode@basic:
      shard-apl:          FAIL (fdo#99912) -> PASS

    igt@kms_vblank@pipe-b-ts-continuation-idle-hang:
      shard-apl:          DMESG-WARN -> PASS

    igt@pm_rc6_residency@rc6-accuracy:
      shard-glk:          INCOMPLETE (fdo#103359, k.org#198133) -> PASS

    
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#105900 https://bugs.freedesktop.org/show_bug.cgi?id=105900
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4757 -> Patchwork_10070

  CI_DRM_4757: 1465de895e2b5d9e74e9a85189c9075155efa30d @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4621: 125eee6e981eac0a004aeb4f327439a132ceac5c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_10070: 9a2751c01ca21789da2a8f95dab23033540ad6c9 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10070/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: ✓ Fi.CI.BAT: success for drm/i915/icl: Fix context RPCS programming (rev2)
  2018-09-03 12:53 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-09-04 13:51   ` Tvrtko Ursulin
  0 siblings, 0 replies; 11+ messages in thread
From: Tvrtko Ursulin @ 2018-09-04 13:51 UTC (permalink / raw)
  To: intel-gfx, Patchwork, Tvrtko Ursulin


On 03/09/2018 13:53, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915/icl: Fix context RPCS programming (rev2)
> URL   : https://patchwork.freedesktop.org/series/49005/
> State : success
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_4757 -> Patchwork_10070 =
> 
> == Summary - SUCCESS ==
> 
>    No regressions found.
> 
>    External URL: https://patchwork.freedesktop.org/api/1.0/series/49005/revisions/2/mbox/
> 
> == Possible new issues ==
> 
>    Here are the unknown changes that may have been introduced in Patchwork_10070:
> 
>    === IGT changes ===
> 
>      ==== Warnings ====
> 
>      {igt@pm_rpm@module-reload}:
>        fi-hsw-4770r:       PASS -> SKIP
> 
>      
> == Known issues ==
> 
>    Here are the changes found in Patchwork_10070 that come from known issues:
> 
>    === IGT changes ===
> 
>      ==== Issues hit ====
> 
>      igt@drv_module_reload@basic-reload-inject:
>        fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#107425)
> 
>      {igt@pm_rpm@module-reload}:
>        fi-cnl-psr:         PASS -> WARN (fdo#107708, fdo#107602)
> 
>      
>      ==== Possible fixes ====
> 
>      igt@kms_pipe_crc_basic@nonblocking-crc-pipe-b-frame-sequence:
>        {fi-byt-clapper}:   FAIL (fdo#103191, fdo#107362) -> PASS
> 
>      igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
>        fi-bxt-dsi:         INCOMPLETE (fdo#103927) -> PASS
> 
>      igt@kms_psr@primary_page_flip:
>        fi-cnl-psr:         FAIL (fdo#107336) -> PASS
> 
>      
>    {name}: This element is suppressed. This means it is ignored when computing
>            the status of the difference (SUCCESS, WARNING, or FAILURE).
> 
>    fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
>    fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
>    fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
>    fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
>    fdo#107425 https://bugs.freedesktop.org/show_bug.cgi?id=107425
>    fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
>    fdo#107708 https://bugs.freedesktop.org/show_bug.cgi?id=107708
> 
> 
> == Participating hosts (53 -> 48) ==
> 
>    Missing    (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-hsw-4200u
> 
> 
> == Build changes ==
> 
>      * Linux: CI_DRM_4757 -> Patchwork_10070
> 
>    CI_DRM_4757: 1465de895e2b5d9e74e9a85189c9075155efa30d @ git://anongit.freedesktop.org/gfx-ci/linux
>    IGT_4621: 125eee6e981eac0a004aeb4f327439a132ceac5c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>    Patchwork_10070: 9a2751c01ca21789da2a8f95dab23033540ad6c9 @ git://anongit.freedesktop.org/gfx-ci/linux
> 
> 
> == Linux commits ==
> 
> 9a2751c01ca2 drm/i915/icl: Fix context RPCS programming

Pushed, thanks for the review!

Regards,

Tvrtko

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

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

end of thread, other threads:[~2018-09-04 13:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31 11:53 [PATCH] drm/i915/icl: Fix context RPCS programming Tvrtko Ursulin
2018-08-31 12:07 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-08-31 12:23 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-31 16:18 ` ✓ Fi.CI.IGT: " Patchwork
2018-08-31 16:52 ` [PATCH] " Lionel Landwerlin
2018-09-03 11:11   ` Tvrtko Ursulin
2018-09-03 11:30     ` [PATCH v2] " Tvrtko Ursulin
2018-09-03 12:34 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/icl: Fix context RPCS programming (rev2) Patchwork
2018-09-03 12:53 ` ✓ Fi.CI.BAT: success " Patchwork
2018-09-04 13:51   ` Tvrtko Ursulin
2018-09-03 17:36 ` ✓ Fi.CI.IGT: " Patchwork

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.