Skip to contentSkip to conversation

BXT basic slice/subslice/EU stuff

PATCH Superseded [email protected] 3 participants 7 messages Mar 31, 2015 – Apr 9, 2015

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover BXT basic slice/subslice/EU stuff

From: Jeff McGee <[email protected]>

These patches are dependent on the initial BXT enabling set from Imre, particularly the IS_BROXTON macro.

Jeff McGee (2):
drm/i915/bxt: Determine BXT slice/subslice/EU info drm/i915/bxt: Add BXT HW status to SSEU status

 drivers/gpu/drm/i915/i915_debugfs.c | 35 +++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_dma.c     | 47 +++++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_reg.h     |  3 +++
 3 files changed, 85 insertions(+)
Signature · 6 lines
2.3.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 1/2 drm/i915/bxt: Determine BXT slice/subslice/EU info

From: Jeff McGee <[email protected]>

BXT uses a subset of the SKL fuse registers, because it has at most 1 slice and at most 6 EU per subslice.

---
 drivers/gpu/drm/i915/i915_dma.c | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +47 -0
index ec661fe..81afd31 100644
@@ -733,6 +733,53 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		info->has_slice_pg = (info->slice_total > 1) ? 1 : 0;
 		info->has_subslice_pg = 0;
 		info->has_eu_pg = (info->eu_per_subslice > 2) ? 1 : 0;
+	} else if (IS_BROXTON(dev)) {
+		const int ss_max = 4;
+		int ss;
+		u32 fuse2, eu_disable, ss_disable;
+
+		fuse2 = I915_READ(GEN8_FUSE2);
+		ss_disable = (fuse2 & GEN9_F2_SS_DIS_MASK) >>
+			     GEN9_F2_SS_DIS_SHIFT;
+		eu_disable = I915_READ(GEN8_EU_DISABLE0);
+
+		info->slice_total = 1;
+		info->subslice_per_slice = ss_max - hweight32(ss_disable);
+		info->subslice_total = info->subslice_per_slice;
+
+		/*
+		 * Iterate through enabled subslices to count the total
+		 * enabled EU.
+		*/
+		for (ss = 0; ss < ss_max; ss++) {
+			if (ss_disable & (0x1 << ss))
+				/* skip disabled subslice */
+				continue;
+
+			/*
+			 * BXT can have at most 6 EU per subslice. So only the
+			 * lowest 6 bits of the 8-bit EU disable field are
+			 * valid.
+			*/
+			info->eu_total += 6 - hweight8((eu_disable >>
+							(ss * 8)) & 0x3f);
+		}
+
+		/*
+		 * BXT expected to always have a uniform distribution of EU
+		 * across subslices.
+		*/
+		info->eu_per_subslice = info->subslice_total ?
+					info->eu_total / info->subslice_total :
+					0;
+		/*
+		 * BXT supports subslice power gating on devices with more than
+		 * one subslice, and supports EU power gating on devices with
+		 * more than one EU pair per subslice.
+		*/
+		info->has_slice_pg = 0;
+		info->has_subslice_pg = (info->subslice_total > 1);
+		info->has_eu_pg = (info->eu_per_subslice > 2);
 	}
 	DRM_DEBUG_DRIVER("slice total: %u\n", info->slice_total);
 	DRM_DEBUG_DRIVER("subslice total: %u\n", info->subslice_total);
Signature · 6 lines
2.3.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

Re: [PATCH 1/2] drm/i915/bxt: Determine BXT slice/subslice/EU info

Quoted 15 lines · On Tue, Mar 31, 2015 at 09:59:22AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

BXT uses a subset of the SKL fuse registers, because it has at most 1 slice and at most 6 EU per subslice.

---
 drivers/gpu/drm/i915/i915_dma.c | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +0 -0
index ec661fe..81afd31 100644

drivers/gpu/drm/i915/i915_dma.c static void intel_device_info_runtime_init(struct drm_device *dev) · line 736

Quoted 4 lines
drivers/gpu/drm/i915/i915_dma.c +1 -0
@@ -733,6 +733,53 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		info->has_slice_pg = (info->slice_total > 1) ? 1 : 0;
 		info->has_subslice_pg = 0;
 		info->has_eu_pg = (info->eu_per_subslice > 2) ? 1 : 0;
+	} else if (IS_BROXTON(dev)) {

By all reasonable standards this function is getting a bit too long. Can you please create a patch to extract the various platform-specific sseu detection logic.

Also can't we just repurpose the skl version by limiting s_max appropriately and applying

drivers/gpu/drm/i915/i915_dma.c +2 -3
index 68e0c85a17cf..b164aeb09158 100644
@@ -668,9 +668,8 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		ss_disable = (fuse2 & GEN9_F2_SS_DIS_MASK) >>
 			     GEN9_F2_SS_DIS_SHIFT;
 
-		eu_disable[0] = I915_READ(GEN8_EU_DISABLE0);
-		eu_disable[1] = I915_READ(GEN8_EU_DISABLE1);
-		eu_disable[2] = I915_READ(GEN8_EU_DISABLE2);
+		for (s = 0; s < s_max; s++)
+			eu_disable[s] = I915_READ(GEN8_EU_DISABLE(s));
 
 		info->slice_total = hweight32(s_enable);
 

with a suitable added #define ofc?
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#3 lore raw

Re: [PATCH 1/2] drm/i915/bxt: Determine BXT slice/subslice/EU info

Quoted 45 lines · Daniel Vetter
Quoted 15 lines · On Tue, Mar 31, 2015 at 09:59:22AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

BXT uses a subset of the SKL fuse registers, because it has at most 1 slice and at most 6 EU per subslice.

---
 drivers/gpu/drm/i915/i915_dma.c | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +0 -0
index ec661fe..81afd31 100644

drivers/gpu/drm/i915/i915_dma.c static void intel_device_info_runtime_init(struct drm_device *dev) · line 736

Quoted 4 lines
drivers/gpu/drm/i915/i915_dma.c +1 -0
@@ -733,6 +733,53 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		info->has_slice_pg = (info->slice_total > 1) ? 1 : 0;
 		info->has_subslice_pg = 0;
 		info->has_eu_pg = (info->eu_per_subslice > 2) ? 1 : 0;
+	} else if (IS_BROXTON(dev)) {

By all reasonable standards this function is getting a bit too long. Can you please create a patch to extract the various platform-specific sseu detection logic.

Also can't we just repurpose the skl version by limiting s_max appropriately and applying

drivers/gpu/drm/i915/i915_dma.c +2 -3
index 68e0c85a17cf..b164aeb09158 100644
@@ -668,9 +668,8 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		ss_disable = (fuse2 & GEN9_F2_SS_DIS_MASK) >>
 			     GEN9_F2_SS_DIS_SHIFT;
 
-		eu_disable[0] = I915_READ(GEN8_EU_DISABLE0);
-		eu_disable[1] = I915_READ(GEN8_EU_DISABLE1);
-		eu_disable[2] = I915_READ(GEN8_EU_DISABLE2);
+		for (s = 0; s < s_max; s++)
+			eu_disable[s] = I915_READ(GEN8_EU_DISABLE(s));
 
 		info->slice_total = hweight32(s_enable);
 
Quoted 2 lines

with a suitable added #define ofc?
-Daniel

Agree with all of the above. Regarding the 2nd patch in this series which performs related logic in i915_debugfs, would you like to see that broken up similarly?
-Jeff
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

Re: [PATCH 1/2] drm/i915/bxt: Determine BXT slice/subslice/EU info

Quoted 44 lines · Jeff McGee
Quoted 43 lines · Daniel Vetter
Quoted 15 lines · On Tue, Mar 31, 2015 at 09:59:22AM -0700, [email protected] wrote:

From: Jeff McGee <[email protected]>

BXT uses a subset of the SKL fuse registers, because it has at most 1 slice and at most 6 EU per subslice.

---
 drivers/gpu/drm/i915/i915_dma.c | 47 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
drivers/gpu/drm/i915/i915_dma.c +0 -0
index ec661fe..81afd31 100644

drivers/gpu/drm/i915/i915_dma.c static void intel_device_info_runtime_init(struct drm_device *dev) · line 736

Quoted 4 lines
drivers/gpu/drm/i915/i915_dma.c +1 -0
@@ -733,6 +733,53 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		info->has_slice_pg = (info->slice_total > 1) ? 1 : 0;
 		info->has_subslice_pg = 0;
 		info->has_eu_pg = (info->eu_per_subslice > 2) ? 1 : 0;
+	} else if (IS_BROXTON(dev)) {

By all reasonable standards this function is getting a bit too long. Can you please create a patch to extract the various platform-specific sseu detection logic.

Also can't we just repurpose the skl version by limiting s_max appropriately and applying

drivers/gpu/drm/i915/i915_dma.c +2 -3
index 68e0c85a17cf..b164aeb09158 100644
@@ -668,9 +668,8 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 		ss_disable = (fuse2 & GEN9_F2_SS_DIS_MASK) >>
 			     GEN9_F2_SS_DIS_SHIFT;
 
-		eu_disable[0] = I915_READ(GEN8_EU_DISABLE0);
-		eu_disable[1] = I915_READ(GEN8_EU_DISABLE1);
-		eu_disable[2] = I915_READ(GEN8_EU_DISABLE2);
+		for (s = 0; s < s_max; s++)
+			eu_disable[s] = I915_READ(GEN8_EU_DISABLE(s));
 
Quoted 8 lines
Quoted 4 lines
drivers/gpu/drm/i915/i915_dma.c +0 -0
 		info->slice_total = hweight32(s_enable);
 

with a suitable added #define ofc?
-Daniel

Agree with all of the above. Regarding the 2nd patch in this series which performs related logic in i915_debugfs, would you like to see that broken up similarly?

Yeah I think the same rework would benefit the debugfs code too, if only for consistency.

Thanks, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw

PATCH 2/2 drm/i915/bxt: Add BXT HW status to SSEU status

In reply to [email protected]

From: Jeff McGee <[email protected]>

BXT uses the same power gate control ack message registers as SKL. BXT makes use of additional fields which indicate the power gating state of each subslice in BXT's single slice.

---
 drivers/gpu/drm/i915/i915_debugfs.c | 35 +++++++++++++++++++++++++++++++++++
 drivers/gpu/drm/i915/i915_reg.h     |  3 +++
 2 files changed, 38 insertions(+)
drivers/gpu/drm/i915/i915_debugfs.c +35 -0
index 007c7d7..6c5ba28 100644
@@ -4566,6 +4566,41 @@ static int i915_sseu_status(struct seq_file *m, void *unused)
 				eu_per = max(eu_per, eu_cnt);
 			}
 		}
+	} else if (IS_BROXTON(dev)) {
+		const int ss_max = 3;
+		int ss;
+		u32 s_reg, eu_reg[2], eu_mask[2];
+
+		s_reg = I915_READ(GEN9_SLICE0_PGCTL_ACK);
+		eu_reg[0] = I915_READ(GEN9_SLICE0_SS01_EU_PGCTL_ACK);
+		eu_reg[1] = I915_READ(GEN9_SLICE0_SS23_EU_PGCTL_ACK);
+		eu_mask[0] = GEN9_PGCTL_SSA_EU08_ACK |
+			     GEN9_PGCTL_SSA_EU19_ACK |
+			     GEN9_PGCTL_SSA_EU210_ACK |
+			     GEN9_PGCTL_SSA_EU311_ACK;
+		eu_mask[1] = GEN9_PGCTL_SSB_EU08_ACK |
+			     GEN9_PGCTL_SSB_EU19_ACK |
+			     GEN9_PGCTL_SSB_EU210_ACK |
+			     GEN9_PGCTL_SSB_EU311_ACK;
+
+		if (s_reg & GEN9_PGCTL_SLICE_ACK) {
+
+			s_tot = 1;
+			for (ss = 0; ss < ss_max; ss++) {
+				unsigned int eu_cnt;
+
+				if (!(s_reg & (GEN9_PGCTL_SS0_ACK << (2 * ss))))
+					/* skip disabled subslice */
+					continue;
+
+				ss_per++;
+				eu_cnt = 2 * hweight32(eu_reg[ss/2] &
+						       eu_mask[ss%2]);
+				eu_tot += eu_cnt;
+				eu_per = max(eu_per, eu_cnt);
+			}
+		}
+		ss_tot = ss_per;
 	}
 	seq_printf(m, "  Enabled Slice Total: %u\n", s_tot);
 	seq_printf(m, "  Enabled Subslice Total: %u\n", ss_tot);
drivers/gpu/drm/i915/i915_reg.h +3 -0
index 7e1a0fd9..be6554f 100644
@@ -6275,6 +6275,9 @@ enum skl_disp_power_wells {
 #define GEN9_SLICE1_PGCTL_ACK		0x8050
 #define GEN9_SLICE2_PGCTL_ACK		0x8054
 #define   GEN9_PGCTL_SLICE_ACK		(1 << 0)
+#define   GEN9_PGCTL_SS0_ACK		(1 << 2) /* Only for SLICE0 */
+#define   GEN9_PGCTL_SS1_ACK		(1 << 4) /* Only for SLICE0 */
+#define   GEN9_PGCTL_SS2_ACK		(1 << 6) /* Only for SLICE0 */
 
 #define GEN9_SLICE0_SS01_EU_PGCTL_ACK	0x805c
 #define GEN9_SLICE0_SS23_EU_PGCTL_ACK	0x8060
Signature · 6 lines
2.3.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 2/2
#6 lore raw

Re: [PATCH 2/2] drm/i915/bxt: Add BXT HW status to SSEU status

Task id: 6105 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  302/302              302/302
SNB                                  313/313              313/313
IVB                                  337/337              337/337
BYT                                  286/286              286/286
HSW                                  395/395              395/395
BDW                                  321/321              321/321

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx