Skip to contentSkip to conversation

Fixes for vlv turbo.

PATCH In review [email protected] 2 participants 7 messages Dec 17, 2013 – Dec 19, 2013

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

v2 cover Fixes for vlv turbo.

From: Deepak S <[email protected]>

This patch includes
1. set min delay to rpe delay (Efficient frequency) for better performace.
2. Disable/Enable PM Intrrupts based on the current freq.
3. WA to fix Voltage is not getting dropped to Vmin when Gfx is power gated

Deepak S (5):
drm/i915: set min delay to rpe delay (Efficient frequency). drm/i915: Disable/Enable PM Intrrupts based on the current freq. drm/i915: WA to fix Voltage not getting dropped to Vmin when Gfx is
power gated.

 drivers/gpu/drm/i915/i915_drv.h |  5 +++
 drivers/gpu/drm/i915/i915_irq.c | 31 +++++++++++++++-
 drivers/gpu/drm/i915/i915_reg.h |  5 +++
 drivers/gpu/drm/i915/intel_pm.c | 81 +++++++++++++++++++++++++++++++++++++++--
 4 files changed, 116 insertions(+), 6 deletions(-)
Signature · 1 line
1.8.4.2
#1 lore raw

PATCH v2 1/3 drm/i915: set min delay to rpe delay (Efficient frequency).

From: Deepak S <[email protected]>

We use RPe here since it should match the Vmin we were shooting for. That should give us better perf than if we used the min freq available. System thermal can take the system to lowest possible freq (RPn). We are making sure, we calmp the freq to min_delay (RPe).

---
 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 ca7b537..7c98694 100644
@@ -4157,7 +4157,7 @@ static void valleyview_enable_rps(struct drm_device *dev)
 			 vlv_gpu_freq(dev_priv, dev_priv->rps.rpe_delay),
 			 dev_priv->rps.rpe_delay);
 
-	dev_priv->rps.min_delay = valleyview_rps_min_freq(dev_priv);
+	dev_priv->rps.min_delay = dev_priv->rps.rpe_delay;
 	DRM_DEBUG_DRIVER("min GPU freq: %d MHz (%u)\n",
 			 vlv_gpu_freq(dev_priv, dev_priv->rps.min_delay),
 			 dev_priv->rps.min_delay);
Signature · 1 line
1.8.4.2
#2 lore raw

Re: [PATCH v2 1/3] drm/i915: set min delay to rpe delay (Efficient frequency).

Quoted 8 lines · On Tue, Dec 17, 2013 at 08:35:39PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

We use RPe here since it should match the Vmin we were shooting for. That should give us better perf than if we used the min freq available. System thermal can take the system to lowest possible freq (RPn). We are making sure, we calmp the freq to min_delay (RPe).

Nak. Read the code, explain how it currently fails. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw

PATCH v2 2/3 drm/i915: Disable/Enable PM Intrrupts based on the current freq.

In reply to [email protected]

From: Deepak S <[email protected]>

When current delay is already at max delay, Let's disable the PM UP THRESHOLD INTRRUPTS, so that we will not get further interrupts until current delay is less than max delay, Also request for the PM DOWN THRESHOLD INTRRUPTS to indicate the decrease in clock freq. and viceversa for PM DOWN THRESHOLD INTRRUPTS.

v2: Use bool variables (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.h |  3 +++
 drivers/gpu/drm/i915/i915_irq.c | 31 +++++++++++++++++++++++++++++--
 drivers/gpu/drm/i915/intel_pm.c |  3 +++
 3 files changed, 35 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +3 -0
index c638547..1a6cc69 100644
@@ -914,6 +914,9 @@ struct intel_gen6_power_mgmt {
 	u8 rp0_delay;
 	u8 hw_max;
 
+	bool rp_up_masked;
+	bool rp_down_masked;
+
 	int last_adj;
 	enum { LOW_POWER, BETWEEN, HIGH_POWER } power;
 
drivers/gpu/drm/i915/i915_irq.c +29 -2
index 1d44c79..9dd65a8 100644
@@ -988,7 +988,20 @@ static void gen6_pm_rps_work(struct work_struct *work)
 			adj *= 2;
 		else
 			adj = 1;
-		new_delay = dev_priv->rps.cur_delay + adj;
+
+		if (dev_priv->rps.cur_delay >= dev_priv->rps.max_delay) {
+			I915_WRITE(GEN6_PMINTRMSK,
+					I915_READ(GEN6_PMINTRMSK) | 1 << 5);
+			dev_priv->rps.rp_up_masked = true;
+			new_delay = dev_priv->rps.cur_delay;
+		} else
+			new_delay = dev_priv->rps.cur_delay + adj;
+
+		if (dev_priv->rps.rp_down_masked) {
+			I915_WRITE(GEN6_PMINTRMSK,
+					I915_READ(GEN6_PMINTRMSK) | ~(1 << 4));
+			dev_priv->rps.rp_down_masked = false;
+		}
 
 		/*
 		 * For better performance, jump directly
@@ -1007,7 +1020,21 @@ static void gen6_pm_rps_work(struct work_struct *work)
 			adj *= 2;
 		else
 			adj = -1;
-		new_delay = dev_priv->rps.cur_delay + adj;
+
+		if (dev_priv->rps.cur_delay <= dev_priv->rps.max_delay) {
+			I915_WRITE(GEN6_PMINTRMSK,
+					I915_READ(GEN6_PMINTRMSK) | 1 << 4);
+			dev_priv->rps.rp_down_masked = true;
+			new_delay = dev_priv->rps.cur_delay;
+		} else
+			new_delay = dev_priv->rps.cur_delay + adj;
+
+		if (dev_priv->rps.rp_up_masked) {
+			I915_WRITE(GEN6_PMINTRMSK,
+					I915_READ(GEN6_PMINTRMSK) | ~(1 << 5));
+			dev_priv->rps.rp_up_masked = false;
+		}
+
 	} else { /* unknown event */
 		new_delay = dev_priv->rps.cur_delay;
 	}
drivers/gpu/drm/i915/intel_pm.c +3 -0
index 7c98694..e6e933b 100644
@@ -4166,6 +4166,9 @@ static void valleyview_enable_rps(struct drm_device *dev)
 			 vlv_gpu_freq(dev_priv, dev_priv->rps.rpe_delay),
 			 dev_priv->rps.rpe_delay);
 
+	dev_priv->rps.rp_up_masked = 0;
+	dev_priv->rps.rp_down_masked = 0;
+
 	valleyview_set_rps(dev_priv->dev, dev_priv->rps.rpe_delay);
 
 	gen6_enable_rps_interrupts(dev);
Signature · 1 line
1.8.4.2
#4 lore raw

Re: [PATCH v2 2/3] drm/i915: Disable/Enable PM Intrrupts based on the current freq.

Quoted 11 lines · On Tue, Dec 17, 2013 at 08:35:40PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

When current delay is already at max delay, Let's disable the PM UP THRESHOLD INTRRUPTS, so that we will not get further interrupts until current delay is less than max delay, Also request for the PM DOWN THRESHOLD INTRRUPTS to indicate the decrease in clock freq. and viceversa for PM DOWN THRESHOLD INTRRUPTS.

v2: Use bool variables (Daniel)

Nak. Why not do this with the rest of the threshold interrupt adjusting code?
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
author
#5 lore raw

Re: [PATCH v2 2/3] drm/i915: Disable/Enable PM Intrrupts based on the current freq.

Hi Chris,

If I understand correctly we are using GEN6_RP_INTERRUPT_LIMITS to Make sure we continue to get interrupts until we hit the minimum or maximum frequencies for gen6 right? Also, we do setup the gen6_set_rps_thresholds based on the power in gen6_set_rps right?

Instead of adding it in set_rps_thresholds, would it be better to add the Disable/Enable PM Intrrupts based on the current freq in valleyview_set_rps?

Let me know if my understanding is right.

Thanks
Deepak

-----Original Message-----
From: Chris Wilson [mailto:[email protected]]
Sent: Tuesday, December 17, 2013 8:46 PM
To: S, Deepak
Cc: [email protected]
Subject: Re: [Intel-gfx] [PATCH v2 2/3] drm/i915: Disable/Enable PM Intrrupts based on the current freq.

Quoted 11 lines · On Tue, Dec 17, 2013 at 08:35:40PM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

When current delay is already at max delay, Let's disable the PM UP THRESHOLD INTRRUPTS, so that we will not get further interrupts until current delay is less than max delay, Also request for the PM DOWN THRESHOLD INTRRUPTS to indicate the decrease in clock freq. and viceversa for PM DOWN THRESHOLD INTRRUPTS.

v2: Use bool variables (Daniel)

Nak. Why not do this with the rest of the threshold interrupt adjusting code? -Chris

--
Chris Wilson, Intel Open Source Technology Centre

#6 lore raw

PATCH v2 3/3 drm/i915: WA to fix Voltage not getting dropped to Vmin when Gfx is power gated.

In reply to [email protected]

From: Deepak S <[email protected]>

When we enter RC6 and GFX Clocks are off, the voltage remains higher than Vmin. When we try to set the freq to RPe, it might fail since the Gfx clocks are down.
So to fix this in Gfx idel,Bring the GFX clock up and set the freq to RPe then move GFx down.

v2: remove vlv_update_rps_cur_delay function. Update commit message (Daniel)

---
 drivers/gpu/drm/i915/i915_drv.h |  2 ++
 drivers/gpu/drm/i915/i915_reg.h |  4 +++
 drivers/gpu/drm/i915/intel_pm.c | 61 ++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 66 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +2 -0
index 1a6cc69..8c9b3a1 100644
@@ -923,6 +923,8 @@ struct intel_gen6_power_mgmt {
 	bool enabled;
 	struct delayed_work delayed_resume_work;
 
+	bool gfx_clk_down;
+
 	/*
 	 * Protects RPS/RC6 register access and PCU communication.
 	 * Must be taken after struct_mutex if nested.
drivers/gpu/drm/i915/i915_reg.h +4 -0
index 1e4c693a..0a19219 100644
@@ -4974,6 +4974,10 @@
 						 GEN6_PM_RP_DOWN_THRESHOLD | \
 						 GEN6_PM_RP_DOWN_TIMEOUT)
 
+#define VLV_GTLC_SURVIVABILITY_REG              0x130098
+#define VLV_GFX_CLK_STATUS_BIT			(1<<3)
+#define VLV_GFX_CLK_FORCE_ON_BIT		(1<<2)
+
 #define GEN6_GT_GFX_RC6_LOCKED			0x138104
 #define VLV_COUNTER_CONTROL			0x138104
 #define   VLV_COUNT_RANGE_HIGH			(1<<15)
drivers/gpu/drm/i915/intel_pm.c +60 -1

78 lines not on this page · raw message

Signature · 1 line
1.8.4.2