Skip to contentSkip to conversation

drm/i915: Add boot paramter to control rps boost at boot time.

PATCH In review [email protected] 3 participants 3 messages Mar 3, 2014

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

PATCH 1/1 drm/i915: Add boot paramter to control rps boost at boot time.

From: Deepak S <[email protected]>

We are adding a module paramter to control rps boost. By default, we enable the boost for better performace. Based on the need (perf/power) we can either enable/disable.

---
 drivers/gpu/drm/i915/i915_drv.h    |  1 +
 drivers/gpu/drm/i915/i915_gem.c    | 15 ++++++++++++++-
 drivers/gpu/drm/i915/i915_params.c |  8 ++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 2baeeef..398b101 100644
@@ -1963,6 +1963,7 @@ struct i915_params {
 	int panel_use_ssc;
 	int vbt_sdvo_panel_type;
 	int enable_rc6;
+	int enable_rps_boost;
 	int enable_fbc;
 	bool enable_hangcheck;
 	int enable_ppgtt;
drivers/gpu/drm/i915/i915_gem.c +14 -1
index a8a069f..1478ea6 100644
@@ -990,6 +990,17 @@ static bool can_wait_boost(struct drm_i915_file_private *file_priv)
 	return !atomic_xchg(&file_priv->rps_wait_boost, true);
 }
 
+static int  intel_enable_rps_boost(struct drm_device *dev)
+{
+	/* No RPS Boost before Ironlake */
+	if (INTEL_INFO(dev)->gen < 6)
+		return 0;
+
+	/* Respect the kernel parameter if it is set */
+	return i915.enable_rps_boost;
+
+}
+
 /**
  * __wait_seqno - wait until execution of seqno has finished
  * @ring: the ring expected to report seqno
@@ -1030,7 +1041,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 	timeout_expire = timeout ? jiffies + timespec_to_jiffies_timeout(timeout) : 0;
 
 	if (dev_priv->info->gen >= 6 && can_wait_boost(file_priv)) {
-		gen6_rps_boost(dev_priv);
+		if (intel_enable_rps_boost(ring->dev))
+			gen6_rps_boost(dev_priv);
+
 		if (file_priv)
 			mod_delayed_work(dev_priv->wq,
 					 &file_priv->mm.idle_work,
drivers/gpu/drm/i915/i915_params.c +8 -0
index c743057..a19bd7d 100644
@@ -47,6 +47,7 @@ struct i915_params i915 __read_mostly = {
 	.prefault_disable = 0,
 	.reset = true,
 	.invert_brightness = 0,
+	.enable_rps_boost = 1,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -153,3 +154,10 @@ MODULE_PARM_DESC(invert_brightness,
 	"report PCI device ID, subsystem vendor and subsystem device ID "
 	"to [email protected], if your machine needs it. "
 	"It will then be included in an upcoming module version.");
+
+module_param_named(enable_rps_boost, i915.enable_rps_boost, int, 0600);
+MODULE_PARM_DESC(enable_rps_boost,
+		"Enable/Disable boost RPS frequency (default: true)");
+
+
+
Signature · 1 line
1.8.5.2
maintainer
#1 lore raw
Quoted 71 lines · On Mon, 03 Mar 2014, [email protected] wrote:

From: Deepak S <[email protected]>

We are adding a module paramter to control rps boost. By default, we enable the boost for better performace. Based on the need (perf/power) we can either enable/disable.

---
 drivers/gpu/drm/i915/i915_drv.h    |  1 +
 drivers/gpu/drm/i915/i915_gem.c    | 15 ++++++++++++++-
 drivers/gpu/drm/i915/i915_params.c |  8 ++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 2baeeef..398b101 100644
@@ -1963,6 +1963,7 @@ struct i915_params {
 	int panel_use_ssc;
 	int vbt_sdvo_panel_type;
 	int enable_rc6;
+	int enable_rps_boost;
 	int enable_fbc;
 	bool enable_hangcheck;
 	int enable_ppgtt;
drivers/gpu/drm/i915/i915_gem.c +14 -1
index a8a069f..1478ea6 100644
@@ -990,6 +990,17 @@ static bool can_wait_boost(struct drm_i915_file_private *file_priv)
 	return !atomic_xchg(&file_priv->rps_wait_boost, true);
 }
 
+static int  intel_enable_rps_boost(struct drm_device *dev)
+{
+	/* No RPS Boost before Ironlake */
+	if (INTEL_INFO(dev)->gen < 6)
+		return 0;
+
+	/* Respect the kernel parameter if it is set */
+	return i915.enable_rps_boost;
+
+}
+
 /**
  * __wait_seqno - wait until execution of seqno has finished
  * @ring: the ring expected to report seqno
@@ -1030,7 +1041,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 	timeout_expire = timeout ? jiffies + timespec_to_jiffies_timeout(timeout) : 0;
 
 	if (dev_priv->info->gen >= 6 && can_wait_boost(file_priv)) {
-		gen6_rps_boost(dev_priv);
+		if (intel_enable_rps_boost(ring->dev))
+			gen6_rps_boost(dev_priv);
+
 		if (file_priv)
 			mod_delayed_work(dev_priv->wq,
 					 &file_priv->mm.idle_work,
drivers/gpu/drm/i915/i915_params.c +1 -0
index c743057..a19bd7d 100644
@@ -47,6 +47,7 @@ struct i915_params i915 __read_mostly = {
 	.prefault_disable = 0,
 	.reset = true,
 	.invert_brightness = 0,
+	.enable_rps_boost = 1,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);

drivers/gpu/drm/i915/i915_params.c MODULE_PARM_DESC(invert_brightness, · line 160

Quoted 7 lines
drivers/gpu/drm/i915/i915_params.c +4 -0
@@ -153,3 +154,10 @@ MODULE_PARM_DESC(invert_brightness,
 	"report PCI device ID, subsystem vendor and subsystem device ID "
 	"to [email protected], if your machine needs it. "
 	"It will then be included in an upcoming module version.");
+
+module_param_named(enable_rps_boost, i915.enable_rps_boost, int, 0600);
+MODULE_PARM_DESC(enable_rps_boost,
+		"Enable/Disable boost RPS frequency (default: true)");

Everything about this parameter says it's bool, except that it's an int...

Jani.

Quoted 10 lines
drivers/gpu/drm/i915/i915_params.c +3 -0
+
+
+
Signature · 6 lines
1.8.5.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center
#2 lore raw
In reply to [email protected]
Quoted 33 lines · On Mon, Mar 03, 2014 at 11:36:14AM +0530, [email protected] wrote:

From: Deepak S <[email protected]>

We are adding a module paramter to control rps boost. By default, we enable the boost for better performace. Based on the need (perf/power) we can either enable/disable.

---
 drivers/gpu/drm/i915/i915_drv.h    |  1 +
 drivers/gpu/drm/i915/i915_gem.c    | 15 ++++++++++++++-
 drivers/gpu/drm/i915/i915_params.c |  8 ++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index 2baeeef..398b101 100644
@@ -1963,6 +1963,7 @@ struct i915_params {
 	int panel_use_ssc;
 	int vbt_sdvo_panel_type;
 	int enable_rc6;
+	int enable_rps_boost;
 	int enable_fbc;
 	bool enable_hangcheck;
 	int enable_ppgtt;
drivers/gpu/drm/i915/i915_gem.c +0 -0
index a8a069f..1478ea6 100644
@@ -990,6 +990,17 @@ static bool can_wait_boost(struct drm_i915_file_private *file_priv)
 	return !atomic_xchg(&file_priv->rps_wait_boost, true);
 }
 

drivers/gpu/drm/i915/i915_gem.c static bool can_wait_boost(struct drm_i915_file_private *file_priv) · line 1002

Quoted 10 lines
drivers/gpu/drm/i915/i915_gem.c +10 -0
+static int  intel_enable_rps_boost(struct drm_device *dev)
+{
+	/* No RPS Boost before Ironlake */
+	if (INTEL_INFO(dev)->gen < 6)
+		return 0;
+
+	/* Respect the kernel parameter if it is set */
+	return i915.enable_rps_boost;
+
+}

This function isn't needed since it's never called for gen<6. Also the comment doesn't match the code anyway.

drivers/gpu/drm/i915/i915_gem.c static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno, · line 1046

Quoted 12 lines
drivers/gpu/drm/i915/i915_gem.c +4 -1
+
 /**
  * __wait_seqno - wait until execution of seqno has finished
  * @ring: the ring expected to report seqno
@@ -1030,7 +1041,9 @@ static int __wait_seqno(struct intel_ring_buffer *ring, u32 seqno,
 	timeout_expire = timeout ? jiffies + timespec_to_jiffies_timeout(timeout) : 0;
 
 	if (dev_priv->info->gen >= 6 && can_wait_boost(file_priv)) {
-		gen6_rps_boost(dev_priv);
+		if (intel_enable_rps_boost(ring->dev))
+			gen6_rps_boost(dev_priv);
+

if (dev_priv->info->gen >= 6 &&

    i915.enable_rps.boost && can_wait_boost(file_priv)) {

This seems like a better way since there's no point in scheduling the idle_work if there was no boosting in the first place.

Quoted 33 lines
drivers/gpu/drm/i915/i915_gem.c +0 -0
 		if (file_priv)
 			mod_delayed_work(dev_priv->wq,
 					 &file_priv->mm.idle_work,
drivers/gpu/drm/i915/i915_params.c +8 -0
index c743057..a19bd7d 100644
@@ -47,6 +47,7 @@ struct i915_params i915 __read_mostly = {
 	.prefault_disable = 0,
 	.reset = true,
 	.invert_brightness = 0,
+	.enable_rps_boost = 1,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -153,3 +154,10 @@ MODULE_PARM_DESC(invert_brightness,
 	"report PCI device ID, subsystem vendor and subsystem device ID "
 	"to [email protected], if your machine needs it. "
 	"It will then be included in an upcoming module version.");
+
+module_param_named(enable_rps_boost, i915.enable_rps_boost, int, 0600);
+MODULE_PARM_DESC(enable_rps_boost,
+		"Enable/Disable boost RPS frequency (default: true)");
+
+
+
Signature · 6 lines
1.8.5.2

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC