Skip to contentSkip to conversation

drm/i915: CHV RC6/turbo fixes and improvements

PATCH In review [email protected] 5 participants 25 messages Jan 19, 2015 – Jan 20, 2015

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

cover drm/i915: CHV RC6/turbo fixes and improvements

From: Ville Syrjälä <[email protected]>

This series fixes the performance regression caused by the CHV RC6 EI->TO mode change. I also slapped on some other cleanups, and I added a new media_rc6 residency file to sysfs so that we can observe the RC6 residency of the media well and not just the render well.

Ville Syrjälä (7):
drm/i915: Disable RC6 before configuring in on VLV/CHV drm/i915: Change VLV GEN6_RP_DOWN_TIMEOUT value to decimal drm/i915: Configure GEN6_RP_DOWN_TIMEOUT on CHV
Revert "Revert "drm/i915/chv: Use timeout mode for RC6 on chv"" drm/i915: Drop VLV checks from rc6p and rc6pp sysfs files drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other

    'reg'

drm/i915: Add media rc6 residency file to sysfs

 drivers/gpu/drm/i915/i915_sysfs.c | 37 +++++++++++++++++++++++++++++--------
 drivers/gpu/drm/i915/intel_pm.c   | 14 +++++++++++---
 2 files changed, 40 insertions(+), 11 deletions(-)
Signature · 6 lines
2.0.5

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

PATCH 1/7 drm/i915: Disable RC6 before configuring in on VLV/CHV

From: Ville Syrjälä <[email protected]>

Follow the sequence in the BIOS spec and clear the RC_CONTROL register before changing any of the other RC6/RP registers.

---
 drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +6 -0
index b73d601..e7f0f21 100644
@@ -4712,6 +4712,9 @@ static void cherryview_enable_rps(struct drm_device *dev)
 	 * hasn't enabled a state yet where we need forcewake, BIOS may have.*/
 	gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL);
 
+	/*  Disable RC states. */
+	I915_WRITE(GEN6_RC_CONTROL, 0);
+
 	/* 2a: Program RC6 thresholds.*/
 	I915_WRITE(GEN6_RC6_WAKE_RATE_LIMIT, 40 << 16);
 	I915_WRITE(GEN6_RC_EVALUATION_INTERVAL, 125000); /* 12500 * 1280ns */
@@ -4801,6 +4804,9 @@ static void valleyview_enable_rps(struct drm_device *dev)
 	/* If VLV, Forcewake all wells, else re-direct to regular path */
 	gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL);
 
+	/*  Disable RC states. */
+	I915_WRITE(GEN6_RC_CONTROL, 0);
+
 	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
 	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
 	I915_WRITE(GEN6_RP_UP_EI, 66000);
Signature · 6 lines
2.0.5

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

Re: [PATCH 1/7] drm/i915: Disable RC6 before configuring in on VLV/CHV

Quoted 4 lines · On Mon, Jan 19, 2015 at 01:50:47PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

Follow the sequence in the BIOS spec and clear the RC_CONTROL register before changing any of the other RC6/RP registers.

Hmm, we do disable RC_CONTROL except for a very notable absence of santiizing register state following a reset.

Quoted 1 line

I do like this patch for its documentary though.

-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
Reviewed-by on v1 1/7
#3 lore raw

Re: [PATCH 1/7] drm/i915: Disable RC6 before configuring in on VLV/CHV

In reply to [email protected]
Quoted 25 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

Follow the sequence in the BIOS spec and clear the RC_CONTROL register before changing any of the other RC6/RP registers.

---
  drivers/gpu/drm/i915/intel_pm.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +3 -0
index b73d601..e7f0f21 100644
@@ -4712,6 +4712,9 @@ static void cherryview_enable_rps(struct drm_device *dev)
  	 * hasn't enabled a state yet where we need forcewake, BIOS may have.*/
  	gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL);
 
+	/*  Disable RC states. */
+	I915_WRITE(GEN6_RC_CONTROL, 0);
+
  	/* 2a: Program RC6 thresholds.*/
  	I915_WRITE(GEN6_RC6_WAKE_RATE_LIMIT, 40 << 16);
  	I915_WRITE(GEN6_RC_EVALUATION_INTERVAL, 125000); /* 12500 * 1280ns */

drivers/gpu/drm/i915/intel_pm.c static void valleyview_enable_rps(struct drm_device *dev) · line 4812

Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
@@ -4801,6 +4804,9 @@ static void valleyview_enable_rps(struct drm_device *dev)
  	/* If VLV, Forcewake all wells, else re-direct to regular path */
  	gen6_gt_force_wake_get(dev_priv, FORCEWAKE_ALL);
 
+	/*  Disable RC states. */
+	I915_WRITE(GEN6_RC_CONTROL, 0);
+
  	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
  	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
  	I915_WRITE(GEN6_RP_UP_EI, 66000);

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

#4 lore raw

PATCH 2/7 drm/i915: Change VLV GEN6_RP_DOWN_TIMEOUT value to decimal

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

We use decimal for all the other RP magic values, so change GEN6_RP_DOWN_TIMEOUT to decimal as well. Also change the order of the register writes to match the BIOS spec for easier verification.

---
 drivers/gpu/drm/i915/intel_pm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +1 -1
index e7f0f21..ee9a5f9 100644
@@ -4807,13 +4807,13 @@ static void valleyview_enable_rps(struct drm_device *dev)
 	/*  Disable RC states. */
 	I915_WRITE(GEN6_RC_CONTROL, 0);
 
+	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 1000000);
 	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
 	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
 	I915_WRITE(GEN6_RP_UP_EI, 66000);
 	I915_WRITE(GEN6_RP_DOWN_EI, 350000);
 
 	I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10);
-	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 0xf4240);
 
 	I915_WRITE(GEN6_RP_CONTROL,
 		   GEN6_RP_MEDIA_TURBO |
Signature · 6 lines
2.0.5

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

Re: [PATCH 2/7] drm/i915: Change VLV GEN6_RP_DOWN_TIMEOUT value to decimal

Quoted 7 lines · On Mon, Jan 19, 2015 at 01:50:48PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

We use decimal for all the other RP magic values, so change GEN6_RP_DOWN_TIMEOUT to decimal as well. Also change the order of the register writes to match the BIOS spec for easier verification.

-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
Reviewed-by on v1 2/7
#6 lore raw

Re: [PATCH 2/7] drm/i915: Change VLV GEN6_RP_DOWN_TIMEOUT value to decimal

In reply to [email protected]
Quoted 20 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

We use decimal for all the other RP magic values, so change GEN6_RP_DOWN_TIMEOUT to decimal as well. Also change the order of the register writes to match the BIOS spec for easier verification.

---
  drivers/gpu/drm/i915/intel_pm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_pm.c +1 -0
index e7f0f21..ee9a5f9 100644
@@ -4807,13 +4807,13 @@ static void valleyview_enable_rps(struct drm_device *dev)
  	/*  Disable RC states. */
  	I915_WRITE(GEN6_RC_CONTROL, 0);
 
+	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 1000000);

drivers/gpu/drm/i915/intel_pm.c static void valleyview_enable_rps(struct drm_device *dev) · line 4819

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +0 -1
  	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
  	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
  	I915_WRITE(GEN6_RP_UP_EI, 66000);
  	I915_WRITE(GEN6_RP_DOWN_EI, 350000);
 
  	I915_WRITE(GEN6_RP_IDLE_HYSTERSIS, 10);
-	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 0xf4240);
 
  	I915_WRITE(GEN6_RP_CONTROL,
  		   GEN6_RP_MEDIA_TURBO |

:)

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

#7 lore raw

PATCH 3/7 drm/i915: Configure GEN6_RP_DOWN_TIMEOUT on CHV

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

CherryViewA0_iGfx_BIOS_DRIVER_PUNIT_spec_y14w28d5 tells us not to enable the RP down timeout interrupt, and says that the timeout value is hence not used. We do enable that interrupt currently though, so leaving the timeout as 0 results in very poor performance as the GPU frequency keeps dropping constantly. So just program the register with the recommended value.

Leaving the interrupt enabled doesn't seem to do any harm so far. So I've decided to leave it on for now, just to avoid making CHV a special case.

This fixes the performance regression from:
commit 5a0afd4b78ec23f27f5d486ac3d102c2e8d66bd7
Author: Deepak S <[email protected]>
Date: Sat Dec 13 11:43:27 2014 +0530

drm/i915/chv: Use timeout mode for RC6 on chv

---
 drivers/gpu/drm/i915/intel_pm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +1 -0
index ee9a5f9..8c7a07d 100644
@@ -4743,6 +4743,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
 	/* 4 Program defaults and thresholds for RPS*/
+	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 1000000);
 	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
 	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
 	I915_WRITE(GEN6_RP_UP_EI, 66000);
Signature · 6 lines
2.0.5

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

Re: [PATCH 3/7] drm/i915: Configure GEN6_RP_DOWN_TIMEOUT on CHV

Quoted 31 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

CherryViewA0_iGfx_BIOS_DRIVER_PUNIT_spec_y14w28d5 tells us not to enable the RP down timeout interrupt, and says that the timeout value is hence not used. We do enable that interrupt currently though, so leaving the timeout as 0 results in very poor performance as the GPU frequency keeps dropping constantly. So just program the register with the recommended value.

Leaving the interrupt enabled doesn't seem to do any harm so far. So I've decided to leave it on for now, just to avoid making CHV a special case.

This fixes the performance regression from:
commit 5a0afd4b78ec23f27f5d486ac3d102c2e8d66bd7
Author: Deepak S <[email protected]>
Date: Sat Dec 13 11:43:27 2014 +0530

drm/i915/chv: Use timeout mode for RC6 on chv

---
  drivers/gpu/drm/i915/intel_pm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index ee9a5f9..8c7a07d 100644

drivers/gpu/drm/i915/intel_pm.c static void cherryview_enable_rps(struct drm_device *dev) · line 4746

Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +1 -0
@@ -4743,6 +4743,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
  	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
  	/* 4 Program defaults and thresholds for RPS*/
+	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 1000000);

I agree programing RP_DOWN_TIMEOUT Can cause the perf issue. I am surprised why we are not seeing similar issues with RC6 EI?

anways, we do not use GEN6_RP_DOWN_TIMEOUT in chv. Programing it's value to default should not harm

drivers/gpu/drm/i915/intel_pm.c static void cherryview_enable_rps(struct drm_device *dev) · line 4749

Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
  	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
  	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
  	I915_WRITE(GEN6_RP_UP_EI, 66000);

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

#9 lore raw

Re: [PATCH 3/7] drm/i915: Configure GEN6_RP_DOWN_TIMEOUT on CHV

Quoted 35 lines · Deepak S
Quoted 33 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

CherryViewA0_iGfx_BIOS_DRIVER_PUNIT_spec_y14w28d5 tells us not to enable the RP down timeout interrupt, and says that the timeout value is hence not used. We do enable that interrupt currently though, so leaving the timeout as 0 results in very poor performance as the GPU frequency keeps dropping constantly. So just program the register with the recommended value.

Leaving the interrupt enabled doesn't seem to do any harm so far. So I've decided to leave it on for now, just to avoid making CHV a special case.

This fixes the performance regression from:
commit 5a0afd4b78ec23f27f5d486ac3d102c2e8d66bd7
Author: Deepak S <[email protected]>
Date: Sat Dec 13 11:43:27 2014 +0530

drm/i915/chv: Use timeout mode for RC6 on chv

---
  drivers/gpu/drm/i915/intel_pm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index ee9a5f9..8c7a07d 100644
@@ -4743,6 +4743,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
  	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
Quoted 4 lines

drivers/gpu/drm/i915/intel_pm.c static void cherryview_enable_rps(struct drm_device *dev) · line 4746

Quoted 2 lines
drivers/gpu/drm/i915/intel_pm.c +1 -0
  	/* 4 Program defaults and thresholds for RPS*/
+	I915_WRITE(GEN6_RP_DOWN_TIMEOUT, 1000000);

I agree programing RP_DOWN_TIMEOUT Can cause the perf issue. I am surprised why we are not seeing similar issues with RC6 EI?

My observation running xonotic was that the freq did seem to drop in EI mode too (as it should since the TO vs. EI is about RC not RP), but somehow it didn't impact performance. I can't really explain why. RC6 residency was a flat 0 with EI, and 5-20% with TO. With the fix performace was the more or less the same in both cases, without the fix TO mode suffered a 40% performance drop whereas EI didn't.

Quoted 2 lines

anways, we do not use GEN6_RP_DOWN_TIMEOUT in chv. Programing it's value to default should not harm

Except we do use GEN6_RP_DOWN_TIMEOUT, as in we enable the relevant interrupt. I did also test a patch that left GEN6_RP_DOWN_TIMEOUT at 0, and instead disabled the interrupt, and that also fixed the performance bug. But I wanted to avoid making CHV even more of a special case, so I've left the interrupt enabled, at least for now.

Quoted 5 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c +0 -0
  	I915_WRITE(GEN6_RP_UP_THRESHOLD, 59400);
  	I915_WRITE(GEN6_RP_DOWN_THRESHOLD, 245000);
  	I915_WRITE(GEN6_RP_UP_EI, 66000);
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH 4/7 Revert "Revert "drm/i915/chv: Use timeout mode for RC6 on chv""

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

The performance regression from the CHV RC6 EI->TO change is now fixed so re-enable TO mode for better RC6 resicency.

This reverts commit e85a5c7989c5be8fe30acc35eba9fb54b3450f36.

---
 drivers/gpu/drm/i915/intel_pm.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +3 -2
index 8c7a07d..8ee65da 100644
@@ -4724,7 +4724,8 @@ static void cherryview_enable_rps(struct drm_device *dev)
 		I915_WRITE(RING_MAX_IDLE(ring->mmio_base), 10);
 	I915_WRITE(GEN6_RC_SLEEP, 0);
 
-	I915_WRITE(GEN6_RC6_THRESHOLD, 50000); /* 50/125ms per EI */
+	/* TO threshold set to 1750 us ( 0x557 * 1.28 us) */
+	I915_WRITE(GEN6_RC6_THRESHOLD, 0x557);
 
 	/* allows RC6 residency counter to work */
 	I915_WRITE(VLV_COUNTER_CONTROL,
@@ -4738,7 +4739,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
 	/* 3: Enable RC6 */
 	if ((intel_enable_rc6(dev) & INTEL_RC6_ENABLE) &&
 						(pcbr >> VLV_PCBR_ADDR_SHIFT))
-		rc6_mode = GEN6_RC_CTL_EI_MODE(1);
+		rc6_mode = GEN7_RC_CTL_TO_MODE;
 
 	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 
Signature · 6 lines
2.0.5

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

Re: [PATCH 4/7] Revert "Revert "drm/i915/chv: Use timeout mode for RC6 on chv""

Quoted 27 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

The performance regression from the CHV RC6 EI->TO change is now fixed so re-enable TO mode for better RC6 resicency.

This reverts commit e85a5c7989c5be8fe30acc35eba9fb54b3450f36.

---
  drivers/gpu/drm/i915/intel_pm.c | 5 +++--
  1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +2 -1
index 8c7a07d..8ee65da 100644
@@ -4724,7 +4724,8 @@ static void cherryview_enable_rps(struct drm_device *dev)
  		I915_WRITE(RING_MAX_IDLE(ring->mmio_base), 10);
  	I915_WRITE(GEN6_RC_SLEEP, 0);
 
-	I915_WRITE(GEN6_RC6_THRESHOLD, 50000); /* 50/125ms per EI */
+	/* TO threshold set to 1750 us ( 0x557 * 1.28 us) */
+	I915_WRITE(GEN6_RC6_THRESHOLD, 0x557);
 
  	/* allows RC6 residency counter to work */
  	I915_WRITE(VLV_COUNTER_CONTROL,

drivers/gpu/drm/i915/intel_pm.c static void cherryview_enable_rps(struct drm_device *dev) · line 4745

Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
@@ -4738,7 +4739,7 @@ static void cherryview_enable_rps(struct drm_device *dev)
  	/* 3: Enable RC6 */
  	if ((intel_enable_rc6(dev) & INTEL_RC6_ENABLE) &&
  						(pcbr >> VLV_PCBR_ADDR_SHIFT))
-		rc6_mode = GEN6_RC_CTL_EI_MODE(1);
+		rc6_mode = GEN7_RC_CTL_TO_MODE;
 
  	I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
 

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

#12 lore raw

PATCH 5/7 drm/i915: Drop VLV checks from rc6p and rc6pp sysfs files

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

We don't register the rc6p and rc6pp sysfs files on VLV, so there's no point in having any VLV checks in them. Drop the checks.

---
 drivers/gpu/drm/i915/i915_sysfs.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/i915_sysfs.c +0 -4
index 4a5af69..04174f0 100644
@@ -116,8 +116,6 @@ show_rc6p_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 {
 	struct drm_minor *dminor = dev_to_drm_minor(kdev);
 	u32 rc6p_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6p);
-	if (IS_VALLEYVIEW(dminor->dev))
-		rc6p_residency = 0;
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6p_residency);
 }
 
@@ -126,8 +124,6 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 {
 	struct drm_minor *dminor = dev_to_drm_minor(kdev);
 	u32 rc6pp_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6pp);
-	if (IS_VALLEYVIEW(dminor->dev))
-		rc6pp_residency = 0;
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
 }
 
Signature · 6 lines
2.0.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 5/7
#13 lore raw

Re: [PATCH 5/7] drm/i915: Drop VLV checks from rc6p and rc6pp sysfs files

Quoted 6 lines · On Mon, Jan 19, 2015 at 01:50:51PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

We don't register the rc6p and rc6pp sysfs files on VLV, so there's no point in having any VLV checks in them. Drop the checks.

-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
Reviewed-by on v1 5/7
#14 lore raw

Re: [PATCH 5/7] drm/i915: Drop VLV checks from rc6p and rc6pp sysfs files

In reply to [email protected]
Quoted 24 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

We don't register the rc6p and rc6pp sysfs files on VLV, so there's no point in having any VLV checks in them. Drop the checks.

---
  drivers/gpu/drm/i915/i915_sysfs.c | 4 ----
  1 file changed, 4 deletions(-)
drivers/gpu/drm/i915/i915_sysfs.c +0 -2
index 4a5af69..04174f0 100644
@@ -116,8 +116,6 @@ show_rc6p_ms(struct device *kdev, struct device_attribute *attr, char *buf)
  {
  	struct drm_minor *dminor = dev_to_drm_minor(kdev);
  	u32 rc6p_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6p);
-	if (IS_VALLEYVIEW(dminor->dev))
-		rc6p_residency = 0;
  	return snprintf(buf, PAGE_SIZE, "%u\n", rc6p_residency);
  }
 

drivers/gpu/drm/i915/i915_sysfs.c show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf) · line 129

Quoted 8 lines
drivers/gpu/drm/i915/i915_sysfs.c +0 -2
@@ -126,8 +124,6 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
  {
  	struct drm_minor *dminor = dev_to_drm_minor(kdev);
  	u32 rc6pp_residency = calc_residency(dminor->dev, GEN6_GT_GFX_RC6pp);
-	if (IS_VALLEYVIEW(dminor->dev))
-		rc6pp_residency = 0;
  	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
  }
 

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

#15 lore raw

PATCH 6/7 drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other 'reg'

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

On VLV/CHV the rc6 residency calculations read a second register to determine the actual units used for the residency value. The variable name 'reg' where that register value is stored shadows the function argument 'reg'. That can easily leave the readed utterly confused, so rename the internal variable to 'clk_reg'.

---
 drivers/gpu/drm/i915/i915_sysfs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_sysfs.c +4 -4
index 04174f0..1ca944b 100644
@@ -49,14 +49,14 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)
 
 	/* On VLV and CHV, residency time is in CZ units rather than 1.28us */
 	if (IS_VALLEYVIEW(dev)) {
-		u32 reg, czcount_30ns;
+		u32 clk_reg, czcount_30ns;
 
 		if (IS_CHERRYVIEW(dev))
-			reg = CHV_CLK_CTL1;
+			clk_reg = CHV_CLK_CTL1;
 		else
-			reg = VLV_CLK_CTL2;
+			clk_reg = VLV_CLK_CTL2;
 
-		czcount_30ns = I915_READ(reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;
+		czcount_30ns = I915_READ(clk_reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;
 
 		if (!czcount_30ns) {
 			WARN(!czcount_30ns, "bogus CZ count value");
Signature · 6 lines
2.0.5

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

Re: [PATCH 6/7] drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other 'reg'

Quoted 9 lines · On Mon, Jan 19, 2015 at 01:50:52PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the rc6 residency calculations read a second register to determine the actual units used for the residency value. The variable name 'reg' where that register value is stored shadows the function argument 'reg'. That can easily leave the readed utterly confused, so rename the internal variable to 'clk_reg'.

-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
Reviewed-by on v1 6/7
#17 lore raw

Re: [PATCH 6/7] drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other 'reg'

In reply to [email protected]
Quoted 9 lines · On Mon, Jan 19, 2015 at 01:50:52PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the rc6 residency calculations read a second register to determine the actual units used for the residency value. The variable name 'reg' where that register value is stored shadows the function argument 'reg'. That can easily leave the readed utterly confused, so rename the internal variable to 'clk_reg'.

-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
Reviewed-by on v1 6/7
#18 lore raw

Re: [PATCH 6/7] drm/i915: Rename 'reg' to 'clk_reg' to unconfuse it from the other 'reg'

In reply to [email protected]
Quoted 26 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the rc6 residency calculations read a second register to determine the actual units used for the residency value. The variable name 'reg' where that register value is stored shadows the function argument 'reg'. That can easily leave the readed utterly confused, so rename the internal variable to 'clk_reg'.

---
  drivers/gpu/drm/i915/i915_sysfs.c | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_sysfs.c +1 -2
index 04174f0..1ca944b 100644
@@ -49,14 +49,14 @@ static u32 calc_residency(struct drm_device *dev, const u32 reg)
 
  	/* On VLV and CHV, residency time is in CZ units rather than 1.28us */
  	if (IS_VALLEYVIEW(dev)) {
-		u32 reg, czcount_30ns;
+		u32 clk_reg, czcount_30ns;
 
  		if (IS_CHERRYVIEW(dev))
-			reg = CHV_CLK_CTL1;

drivers/gpu/drm/i915/i915_sysfs.c static u32 calc_residency(struct drm_device *dev, const u32 reg) · line 62

Quoted 10 lines
drivers/gpu/drm/i915/i915_sysfs.c +3 -2
+			clk_reg = CHV_CLK_CTL1;
  		else
-			reg = VLV_CLK_CTL2;
+			clk_reg = VLV_CLK_CTL2;
 
-		czcount_30ns = I915_READ(reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;
+		czcount_30ns = I915_READ(clk_reg) >> CLK_CTL2_CZCOUNT_30NS_SHIFT;
 
  		if (!czcount_30ns) {
  			WARN(!czcount_30ns, "bogus CZ count value");

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

#19 lore raw

PATCH 7/7 drm/i915: Add media rc6 residency file to sysfs

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

On VLV/CHV the media well rc6 residency gets reported separately from the render well, so add another file to sysfs so that we can report the residency to the user.

---
 drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +25 -0
index 1ca944b..db14d3e 100644
@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
 }
 
+static ssize_t
+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
+{
+	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
+}
+
 static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
 static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
 static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
 static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
 
 static struct attribute *rc6_attrs[] = {
 	&dev_attr_rc6_enable.attr,
@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6p_attrs
 };
+
+static struct attribute *media_rc6_attrs[] = {
+	&dev_attr_media_rc6_residency_ms.attr,
+	NULL
+};
+
+static struct attribute_group media_rc6_attr_group = {
+	.name = power_group_name,
+	.attrs =  media_rc6_attrs
+};
 #endif
 
 static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
 		if (ret)
 			DRM_ERROR("RC6p residency sysfs setup failed\n");
 	}
+	if (IS_VALLEYVIEW(dev)) {
+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
+					&media_rc6_attr_group);
+		if (ret)
+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
+	}
 #endif
 	if (HAS_L3_DPF(dev)) {
 		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);
Signature · 6 lines
2.0.5

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

Re: [PATCH 7/7] drm/i915: Add media rc6 residency file to sysfs

Quoted 7 lines · On Mon, Jan 19, 2015 at 01:50:53PM +0200, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the media well rc6 residency gets reported separately from the render well, so add another file to sysfs so that we can report the residency to the user.

To be extended in future I am sure.

-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
Tested-by on v1 7/7
#21 lore raw

Re: [PATCH 7/7] drm/i915: Add media rc6 residency file to sysfs

In reply to [email protected]

Task id: 5603 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -1 353/353 352/353

ILK                                  353/353              353/353
SNB                                  400/422              400/422
IVB                                  487/487              487/487
BYT                                  296/296              296/296
HSW              +21                 487/508              508/508
BDW                                  401/402              401/402
-------------------------------------Detailed-------------------------------------
Platform  Test                                drm-intel-nightly          Series Applied
*PNV  igt_gen3_render_linear_blits      PASS(5, M25M23)      CRASH(1, M23)
 HSW  igt_kms_cursor_crc_cursor-size-change      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_fence_pin_leak      NSPT(1, M19)DMESG_WARN(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_mmio_vs_cs_flip_setcrtc_vs_cs_flip      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_kms_mmio_vs_cs_flip_setplane_vs_cs_flip      NSPT(1, M19)TIMEOUT(1, M40)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_lpsp_non-edp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_cursor      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_cursor-dpms      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_dpms-mode-unset-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_dpms-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_drm-resources-equal      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_fences      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_fences-dpms      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-execbuf      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-mmap-cpu      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-mmap-gtt      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_gem-pread      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_i2c      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_modeset-non-lpsp      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_modeset-non-lpsp-stress-no-wait      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_pci-d3-state      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)
 HSW  igt_pm_rpm_rte      NSPT(1, M19)PASS(4, M20M19)      PASS(1, M19)

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

Reviewed-by on v1 7/7
#22 lore raw

Re: [PATCH 7/7] drm/i915: Add media rc6 residency file to sysfs

In reply to [email protected]
Quoted 7 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the media well rc6 residency gets reported separately from the render well, so add another file to sysfs so that we can report the residency to the user.

Looks like we missed Media well completely :) and I think we need igt test to verify media residency?

Quoted 48 lines
---
  drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +19 -0
index 1ca944b..db14d3e 100644
@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
  	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
  }
 
+static ssize_t
+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
+{
+	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
+}
+
  static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
  static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
  static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
  static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
 
  static struct attribute *rc6_attrs[] = {
  	&dev_attr_rc6_enable.attr,
@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
  	.name = power_group_name,
  	.attrs =  rc6p_attrs
  };
+
+static struct attribute *media_rc6_attrs[] = {
+	&dev_attr_media_rc6_residency_ms.attr,
+	NULL
+};
+
+static struct attribute_group media_rc6_attr_group = {
+	.name = power_group_name,
+	.attrs =  media_rc6_attrs
+};
  #endif
 
  static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
  		if (ret)
  			DRM_ERROR("RC6p residency sysfs setup failed\n");

drivers/gpu/drm/i915/i915_sysfs.c void i915_setup_sysfs(struct drm_device *dev) · line 642

Quoted 10 lines
drivers/gpu/drm/i915/i915_sysfs.c +6 -0
  	}
+	if (IS_VALLEYVIEW(dev)) {
+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
+					&media_rc6_attr_group);
+		if (ret)
+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
+	}
  #endif
  	if (HAS_L3_DPF(dev)) {
  		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);

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

#23 lore raw

Re: [PATCH 7/7] drm/i915: Add media rc6 residency file to sysfs

Quoted 11 lines · Deepak S
Quoted 7 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the media well rc6 residency gets reported separately from the render well, so add another file to sysfs so that we can report the residency to the user.

Looks like we missed Media well completely :) and I think we need igt test to verify media residency?

Indeed, Testcase: line is missing. And unfortunately the current testcase is severly broken, so there's some work to be done there.

I've merged all the other patches from this series.

Thanks, Daniel

Quoted 63 lines
Quoted 45 lines
---
 drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +19 -0
index 1ca944b..db14d3e 100644
@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
 }
+static ssize_t
+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
+{
+	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
+}
+
 static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
 static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
 static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
 static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
 static struct attribute *rc6_attrs[] = {
 	&dev_attr_rc6_enable.attr,
@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6p_attrs
 };
+
+static struct attribute *media_rc6_attrs[] = {
+	&dev_attr_media_rc6_residency_ms.attr,
+	NULL
+};
+
+static struct attribute_group media_rc6_attr_group = {
+	.name = power_group_name,
+	.attrs =  media_rc6_attrs
+};
 #endif
 static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
 		if (ret)
 			DRM_ERROR("RC6p residency sysfs setup failed\n");

drivers/gpu/drm/i915/i915_sysfs.c void i915_setup_sysfs(struct drm_device *dev) · line 642

Quoted 10 lines
drivers/gpu/drm/i915/i915_sysfs.c +6 -0
 	}
+	if (IS_VALLEYVIEW(dev)) {
+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
+					&media_rc6_attr_group);
+		if (ret)
+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
+	}
 #endif
 	if (HAS_L3_DPF(dev)) {
 		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);

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

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
#24 lore raw

Re: [PATCH 7/7] drm/i915: Add media rc6 residency file to sysfs

Quoted 9 lines · Daniel Vetter
Quoted 8 lines · Deepak S
Quoted 6 lines · On Monday 19 January 2015 05:20 PM, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

On VLV/CHV the media well rc6 residency gets reported separately from the render well, so add another file to sysfs so that we can report the residency to the user.

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Looks like we missed Media well completely :) and I think we need igt test to verify media residency?

Indeed, Testcase: line is missing. And unfortunately the current testcase is severly broken, so there's some work to be done there.

Do we have any volunteers? I have a boatload of bigger fish to fry at the moment so can't take up another project.

Quoted 76 lines

I've merged all the other patches from this series.

Thanks, Daniel

Quoted 63 lines
Quoted 45 lines
---
 drivers/gpu/drm/i915/i915_sysfs.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
drivers/gpu/drm/i915/i915_sysfs.c +19 -0
index 1ca944b..db14d3e 100644
@@ -127,10 +127,19 @@ show_rc6pp_ms(struct device *kdev, struct device_attribute *attr, char *buf)
 	return snprintf(buf, PAGE_SIZE, "%u\n", rc6pp_residency);
 }
+static ssize_t
+show_media_rc6_ms(struct device *kdev, struct device_attribute *attr, char *buf)
+{
+	struct drm_minor *dminor = dev_get_drvdata(kdev);
+	u32 rc6_residency = calc_residency(dminor->dev, VLV_GT_MEDIA_RC6);
+	return snprintf(buf, PAGE_SIZE, "%u\n", rc6_residency);
+}
+
 static DEVICE_ATTR(rc6_enable, S_IRUGO, show_rc6_mask, NULL);
 static DEVICE_ATTR(rc6_residency_ms, S_IRUGO, show_rc6_ms, NULL);
 static DEVICE_ATTR(rc6p_residency_ms, S_IRUGO, show_rc6p_ms, NULL);
 static DEVICE_ATTR(rc6pp_residency_ms, S_IRUGO, show_rc6pp_ms, NULL);
+static DEVICE_ATTR(media_rc6_residency_ms, S_IRUGO, show_media_rc6_ms, NULL);
 static struct attribute *rc6_attrs[] = {
 	&dev_attr_rc6_enable.attr,
@@ -153,6 +162,16 @@ static struct attribute_group rc6p_attr_group = {
 	.name = power_group_name,
 	.attrs =  rc6p_attrs
 };
+
+static struct attribute *media_rc6_attrs[] = {
+	&dev_attr_media_rc6_residency_ms.attr,
+	NULL
+};
+
+static struct attribute_group media_rc6_attr_group = {
+	.name = power_group_name,
+	.attrs =  media_rc6_attrs
+};
 #endif
 static int l3_access_valid(struct drm_device *dev, loff_t offset)
@@ -612,6 +631,12 @@ void i915_setup_sysfs(struct drm_device *dev)
 		if (ret)
 			DRM_ERROR("RC6p residency sysfs setup failed\n");

drivers/gpu/drm/i915/i915_sysfs.c void i915_setup_sysfs(struct drm_device *dev) · line 642

Quoted 10 lines
drivers/gpu/drm/i915/i915_sysfs.c +6 -0
 	}
+	if (IS_VALLEYVIEW(dev)) {
+		ret = sysfs_merge_group(&dev->primary->kdev->kobj,
+					&media_rc6_attr_group);
+		if (ret)
+			DRM_ERROR("Media RC6 residency sysfs setup failed\n");
+	}
 #endif
 	if (HAS_L3_DPF(dev)) {
 		ret = device_create_bin_file(dev->primary->kdev, &dpf_attrs);

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

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
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx