Skip to contentSkip to conversation

Update turbo (rps) min frequency for HSW/BDW

PATCH In review Tom.O'[email protected] 3 participants 7 messages Nov 19, 2014 – Nov 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Update turbo (rps) min frequency for HSW/BDW

From: Tom O'Rourke <Tom.O'[email protected]>

These patches update the turbo minimum frequency to match the values used for Windows and Android.

v2: Updated patches 1 and 2 based on comments
from Daniel and Chris. Added 2 related patches.

Tom O'Rourke (4):
drm/i915: Use efficient frequency for HSW/BDW drm/i915: Keep min freq above floor on HSW/BDW drm/i915: change initial rps frequency for gen8 drm/i915: Update ring freq for full gpu freq range

 drivers/gpu/drm/i915/i915_reg.h |    1 +
 drivers/gpu/drm/i915/intel_pm.c |   51 +++++++++++++++++++++++++++------------
 2 files changed, 37 insertions(+), 15 deletions(-)
Signature · 6 lines
1.7.9.5

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

PATCH v2 1/4 drm/i915: Use efficient frequency for HSW/BDW

From: Tom O'Rourke <Tom.O'[email protected]>

Added gen6_init_rps_frequencies() to initialize the rps frequency values. This function replaces parse_rp_state_cap(). In addition to reading RPn, RP0, and RP1 from RP_STATE_CAP register, the new function reads efficient frequency (aka RPe) from pcode for Haswell and Broadwell and sets the turbo softlimits. The turbo minimum frequency softlimit is set to RPe for Haswell and Broadwell and to RPn otherwise.

For RPe, the efficiency is based on the frequency/power ratio (MHz/W); this is considering GT power and not package power. The efficent frequency is the highest frequency for which the frequency/power ratio is within some threshold of the highest frequency/power ratio. A fixed decrease in frequency results in smaller decrease in power at frequencies less than RPe than at frequencies above RPe.

v2: Following suggestions from Chris Wilson and Daniel Vetter to extend and rename parse_rp_state_cap and to open-code a poorly named function.

---
 drivers/gpu/drm/i915/i915_reg.h |    1 +
 drivers/gpu/drm/i915/intel_pm.c |   43 ++++++++++++++++++++++++++++-----------
 2 files changed, 32 insertions(+), 12 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 7a77cd5..3a51c05 100644
@@ -6038,6 +6038,7 @@ enum punit_power_well {
 #define   GEN6_ENCODE_RC6_VID(mv)		(((mv) - 245) / 5)
 #define   GEN6_DECODE_RC6_VID(vids)		(((vids) * 5) + 245)
 #define   DISPLAY_IPS_CONTROL			0x19
+#define	  HSW_PCODE_DYNAMIC_DUTY_CYCLE_CONTROL	0x1A
 #define GEN6_PCODE_DATA				0x138128
 #define   GEN6_PCODE_FREQ_IA_RATIO_SHIFT	8
 #define   GEN6_PCODE_FREQ_RING_RATIO_SHIFT	16
drivers/gpu/drm/i915/intel_pm.c +31 -12

73 lines not on this page · raw message

Signature · 6 lines
1.7.9.5

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

PATCH v2 2/4 drm/i915: Keep min freq above floor on HSW/BDW

In reply to Tom.O'[email protected]

From: Tom O'Rourke <Tom.O'[email protected]>

Set the min_freq_softlimit to max(RPe, 450MHz).

Setting a floor can ensure a minimum experience level. The 450MHz value came from a power and performance study of various types of workloads (3D, Media, GPGPU, idle, etc).

v2: rebased

---
 drivers/gpu/drm/i915/intel_pm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +2 -1
index 2434542..9f9afb3 100644
@@ -4649,7 +4649,8 @@ static void gen6_init_rps_frequencies(struct drm_device *dev)
 	if (dev_priv->rps.min_freq_softlimit == 0) {
 		if (IS_HASWELL(dev) || IS_BROADWELL(dev))
 			dev_priv->rps.min_freq_softlimit =
-				dev_priv->rps.efficient_freq;
+				/* max(RPe, 450 MHz) */
+				max(dev_priv->rps.efficient_freq, (u8) 9);
 		else
 			dev_priv->rps.min_freq_softlimit =
 				dev_priv->rps.min_freq;
Signature · 6 lines
1.7.9.5

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

PATCH v2 3/4 drm/i915: change initial rps frequency for gen8

In reply to Tom.O'[email protected]

From: Tom O'Rourke <Tom.O'[email protected]>

In gen8_enable_rps, change the initial rps setting to the min_freq_softlimit (same as gen6_enable_rps).

---
 drivers/gpu/drm/i915/intel_pm.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +2 -1
index 9f9afb3..4fd063f 100644
@@ -4772,7 +4772,8 @@ static void gen8_enable_rps(struct drm_device *dev)
 
 	/* 6: Ring frequency + overclocking (our driver does this later */
 
-	gen6_set_rps(dev, (I915_READ(GEN6_GT_PERF_STATUS) & 0xff00) >> 8);
+	dev_priv->rps.power = HIGH_POWER; /* force a reset */
+	gen6_set_rps(dev_priv->dev, dev_priv->rps.min_freq_softlimit);
 
 	gen6_enable_rps_interrupts(dev);
 
Signature · 6 lines
1.7.9.5

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

PATCH v2 4/4 drm/i915: Update ring freq for full gpu freq range

In reply to Tom.O'[email protected]

From: Tom O'Rourke <Tom.O'[email protected]>

In __gen6_update_ring_freq, use the full range of possible gpu frequencies from max_freq to min_freq. The actual gpu frequency could be outside the range from max_freq_softlimit to min_freq_softlimit due to power/thermal constraints.

---
 drivers/gpu/drm/i915/intel_pm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -2
index 4fd063f..2f744aa 100644
@@ -4926,9 +4926,9 @@ static void __gen6_update_ring_freq(struct drm_device *dev)
 	 * to use for memory access.  We do this by specifying the IA frequency
 	 * the PCU should use as a reference to determine the ring frequency.
 	 */
-	for (gpu_freq = dev_priv->rps.max_freq_softlimit; gpu_freq >= dev_priv->rps.min_freq_softlimit;
+	for (gpu_freq = dev_priv->rps.max_freq; gpu_freq >= dev_priv->rps.min_freq;
 	     gpu_freq--) {
-		int diff = dev_priv->rps.max_freq_softlimit - gpu_freq;
+		int diff = dev_priv->rps.max_freq - gpu_freq;
 		unsigned int ia_freq = 0, ring_freq = 0;
 
 		if (INTEL_INFO(dev)->gen >= 8) {
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on the v2 series
#5 lore raw
In reply to Tom.O'[email protected]
Quoted 5 lines · On Wed, Nov 19, 2014 at 02:21:51PM -0800, Tom.O'[email protected] wrote:

From: Tom O'Rourke <Tom.O'[email protected]>

These patches update the turbo minimum frequency to match the values used for Windows and Android.

Quoted 8 lines

v2: Updated patches 1 and 2 based on comments
from Daniel and Chris. Added 2 related patches.

Tom O'Rourke (4):
drm/i915: Use efficient frequency for HSW/BDW drm/i915: Keep min freq above floor on HSW/BDW drm/i915: change initial rps frequency for gen8 drm/i915: Update ring freq for full gpu freq range

-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 9 lines · Chris Wilson
Quoted 8 lines · On Wed, Nov 19, 2014 at 02:21:51PM -0800, Tom.O'[email protected] wrote:

From: Tom O'Rourke <Tom.O'[email protected]>

These patches update the turbo minimum frequency to match the values used for Windows and Android.

v2: Updated patches 1 and 2 based on comments
from Daniel and Chris. Added 2 related patches.

Quoted 6 lines
Quoted 5 lines

Tom O'Rourke (4):
drm/i915: Use efficient frequency for HSW/BDW drm/i915: Keep min freq above floor on HSW/BDW drm/i915: change initial rps frequency for gen8 drm/i915: Update ring freq for full gpu freq range

All merged, thanks for patches&review.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx