Skip to contentSkip to conversation

drm/i915/bxt: Broxton doesn't use gen9 scaling for rps frequencies.

PATCH In review Bob Paauwe 3 participants 6 messages Nov 9, 2015 – Nov 13, 2015

Subsystems (2)
lore
Share & tools
lore

Bob Paauwe

author
#0 lore raw

PATCH 1/1 drm/i915/bxt: Broxton doesn't use gen9 scaling for rps frequencies.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 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 647c0ff..fc5097f 100644
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) / GEN9_FREQ_SCALER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_gpu_freq(dev_priv, val);
@@ -7150,7 +7150,7 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
Signature · 6 lines
2.4.3

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 647c0ff..fc5097f 100644

drivers/gpu/drm/i915/intel_pm.c static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val) · line 7143

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) /
 GEN9_FREQ_SCALER;

Documentation disagrees with this patch. The units are 16.67Mhz thus we should use 50/3.

-Mika

Quoted 18 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c +1 -1
 		return chv_gpu_freq(dev_priv, val);
@@ -7150,7 +7150,7 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
Signature · 6 lines
2.4.3

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

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

author
#2 lore raw
Quoted 24 lines · On Tue, 10 Nov 2015 11:04:22 +0200 Mika Kuoppala…
Quoted 11 lines · Bob Paauwe

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 647c0ff..fc5097f 100644

drivers/gpu/drm/i915/intel_pm.c static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val) · line 7143

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) /
 GEN9_FREQ_SCALER;

Documentation disagrees with this patch. The units are 16.67Mhz thus we should use 50/3.

Quoted 1 line

-Mika

I'm not sure I trust the documentation in this case. Elsewhere, in gen6_init_rps_frequencies() we use GEN9_FREQ_SCALER for SKL only, not for BXT.

I tried changing gen6_init_rps_frequencies() to use it for both SKL and BXT but that didn't resolve the problem when running the ps_rps igt test. So if we really should be using the 50/3 scale for BXT, there's another bug somewhere.

Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c +1 -1
 		return chv_gpu_freq(dev_priv, val);
@@ -7150,7 +7150,7 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 27 lines · Bob Paauwe
Quoted 24 lines · On Tue, 10 Nov 2015 11:04:22 +0200 Mika Kuoppala…
Quoted 11 lines · Bob Paauwe

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 647c0ff..fc5097f 100644

drivers/gpu/drm/i915/intel_pm.c static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val) · line 7143

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) /
 GEN9_FREQ_SCALER;

Documentation disagrees with this patch. The units are 16.67Mhz thus we should use 50/3.

Quoted 4 lines
Quoted 1 line

-Mika

I'm not sure I trust the documentation in this case. Elsewhere, in gen6_init_rps_frequencies() we use GEN9_FREQ_SCALER for SKL only, not for BXT.

On SKL the frequency _capability_ register uses 50MHz units, but the frequency _request_ register uses 16.67MHz units. We store the frequency limits in 16.67MHz units in rps.rp*_freq, hence the use of GEN9_FREQ_SCALER in gen6_init_rps_frequencies(). When requesting a frequency we only use GEN9_FREQ_SCALER to get the 16.67MHz constant value.

On BXT both the capability and request registers use 16.67MHz units, so we don't need to convert in gen6_init_rps_frequencies(), but we still use GEN9_FREQ_SCALER when requesting the frequency to get the 16.67MHz constant value.

Confusing like hell, but it works.

Quoted 4 lines

I tried changing gen6_init_rps_frequencies() to use it for both SKL and BXT but that didn't resolve the problem when running the ps_rps igt test. So if we really should be using the 50/3 scale for BXT, there's another bug somewhere.

The problem is that atm we can't set the min/max frequencies via sysfs to the same value that we read out from these same files, due to the rounding down we do in the driver. Using round-to-closest is one way to fix it I posted a patch to do this to the bug report.

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c +1 -1
 		return chv_gpu_freq(dev_priv, val);
@@ -7150,7 +7150,7 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
Signature · 1 line
2.4.3
Quoted 7 lines
Quoted 4 lines
Quoted 4 lines

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

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

author
#4 lore raw
Quoted 40 lines · On Thu, 12 Nov 2015 10:35:00 +0200 Imre Deak <[email protected]> wrote:
Quoted 27 lines · Bob Paauwe
Quoted 24 lines · On Tue, 10 Nov 2015 11:04:22 +0200 Mika Kuoppala…
Quoted 11 lines · Bob Paauwe

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 647c0ff..fc5097f 100644

drivers/gpu/drm/i915/intel_pm.c static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val) · line 7143

Quoted 7 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) /
 GEN9_FREQ_SCALER;

Documentation disagrees with this patch. The units are 16.67Mhz thus we should use 50/3.

Quoted 4 lines
Quoted 1 line

-Mika

I'm not sure I trust the documentation in this case. Elsewhere, in gen6_init_rps_frequencies() we use GEN9_FREQ_SCALER for SKL only, not for BXT.

On SKL the frequency _capability_ register uses 50MHz units, but the frequency _request_ register uses 16.67MHz units. We store the frequency limits in 16.67MHz units in rps.rp*_freq, hence the use of GEN9_FREQ_SCALER in gen6_init_rps_frequencies(). When requesting a frequency we only use GEN9_FREQ_SCALER to get the 16.67MHz constant value.

Quoted 6 lines

On BXT both the capability and request registers use 16.67MHz units, so we don't need to convert in gen6_init_rps_frequencies(), but we still use GEN9_FREQ_SCALER when requesting the frequency to get the 16.67MHz constant value.

Confusing like hell, but it works.

That makes it a bit less confusing, thanks! Is this all documented
somewhere? I'd like to read up on it so if you have any pointers please send me an email.

Quoted 10 lines
Quoted 5 lines

I tried changing gen6_init_rps_frequencies() to use it for both SKL and BXT but that didn't resolve the problem when running the ps_rps igt test. So if we really should be using the 50/3 scale for BXT, there's another bug somewhere.

The problem is that atm we can't set the min/max frequencies via sysfs to the same value that we read out from these same files, due to the rounding down we do in the driver. Using round-to-closest is one way to fix it I posted a patch to do this to the bug report.

I saw your patch there, I'll give that a try.

Quoted 24 lines
Quoted 22 lines
Quoted 19 lines
Quoted 19 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
 	else if (IS_CHERRYVIEW(dev_priv->dev))
drivers/gpu/drm/i915/intel_pm.c +1 -1
 		return chv_gpu_freq(dev_priv, val);
@@ -7150,7 +7150,7 @@ int intel_gpu_freq(struct drm_i915_private *dev_priv, int val)
 
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv->dev))
 		return (val * GEN9_FREQ_SCALER) / GT_FREQUENCY_MULTIPLIER;
 	else if (IS_CHERRYVIEW(dev_priv->dev))
 		return chv_freq_opcode(dev_priv, val);
Signature · 6 lines
2.4.3

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 11 lines
--
Bob Paauwe                  
[email protected]
IOTG / PED Software Organization
Intel Corp.  Folsom, CA
(916) 356-6193    

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 60 lines · Bob Paauwe
Quoted 48 lines · On Thu, 12 Nov 2015 10:35:00 +0200 Imre Deak <[email protected]> wrote:
Quoted 31 lines · Bob Paauwe
Quoted 28 lines · On Tue, 10 Nov 2015 11:04:22 +0200 Mika Kuoppala…
Quoted 12 lines · Bob Paauwe

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92768

---
 drivers/gpu/drm/i915/intel_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 647c0ff..fc5097f 100644

drivers/gpu/drm/i915/intel_pm.c static int chv_freq_opcode(struct

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +1 -2
@@ -7138,7 +7138,7 @@ static int chv_freq_opcode(struct
 drm_i915_private *dev_priv, int val)
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int
 val)
 {
-	if (IS_GEN9(dev_priv->dev))
+	if (IS_GEN9(dev_priv->dev) && !IS_BROXTON(dev_priv
->dev))
 		return (val * GT_FREQUENCY_MULTIPLIER) /
 GEN9_FREQ_SCALER;

Documentation disagrees with this patch. The units are 16.67Mhz thus we should use 50/3.

Quoted 6 lines
Quoted 1 line

-Mika

I'm not sure I trust the documentation in this case. Elsewhere, in
gen6_init_rps_frequencies() we use GEN9_FREQ_SCALER for SKL only, not for BXT.

On SKL the frequency _capability_ register uses 50MHz units, but the
frequency _request_ register uses 16.67MHz units. We store the frequency
limits in 16.67MHz units in rps.rp*_freq, hence the use of GEN9_FREQ_SCALER in gen6_init_rps_frequencies(). When requesting a frequency we only use GEN9_FREQ_SCALER to get the 16.67MHz constant value.

Quoted 8 lines

On BXT both the capability and request registers use 16.67MHz units, so
we don't need to convert in gen6_init_rps_frequencies(), but we still
use GEN9_FREQ_SCALER when requesting the frequency to get the 16.67MHz
constant value.
Confusing like hell, but it works.

Quoted 3 lines

That makes it a bit less confusing, thanks! Is this all documented
somewhere? I'd like to read up on it so if you have any pointers please send me an email.

For SKL:
RP_STATE_CAP in configdb (offset 0x5998)
RP_FREQ_NORMAL in bspec (0xA008)

For BXT:
GRAPHICS_FREQUENCY_CAPABILITIES in configdb (offset 0x8170) RP_FREQ_NORMAL in bspec (0xA008)

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