public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Add boot paramter to control rps boost at boot time.
@ 2014-03-03  6:06 deepak.s
  2014-03-03 14:00 ` Jani Nikula
  2014-03-03 14:34 ` Ville Syrjälä
  0 siblings, 2 replies; 3+ messages in thread
From: deepak.s @ 2014-03-03  6:06 UTC (permalink / raw)
  To: intel-gfx

From: Deepak S <deepak.s@intel.com>

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.

Signed-off-by: Deepak S <deepak.s@intel.com>
---
 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(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2baeeef..398b101 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -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;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index a8a069f..1478ea6 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -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,
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index c743057..a19bd7d 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -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 dri-devel@lists.freedesktop.org, 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)");
+
+
+
-- 
1.8.5.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Add boot paramter to control rps boost at boot time.
  2014-03-03  6:06 [PATCH] drm/i915: Add boot paramter to control rps boost at boot time deepak.s
@ 2014-03-03 14:00 ` Jani Nikula
  2014-03-03 14:34 ` Ville Syrjälä
  1 sibling, 0 replies; 3+ messages in thread
From: Jani Nikula @ 2014-03-03 14:00 UTC (permalink / raw)
  To: deepak.s, intel-gfx

On Mon, 03 Mar 2014, deepak.s@intel.com wrote:
> From: Deepak S <deepak.s@intel.com>
>
> 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.
>
> Signed-off-by: Deepak S <deepak.s@intel.com>
> ---
>  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(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 2baeeef..398b101 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a8a069f..1478ea6 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -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,
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index c743057..a19bd7d 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -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 dri-devel@lists.freedesktop.org, 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.



> +
> +
> +
> -- 
> 1.8.5.2
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: Add boot paramter to control rps boost at boot time.
  2014-03-03  6:06 [PATCH] drm/i915: Add boot paramter to control rps boost at boot time deepak.s
  2014-03-03 14:00 ` Jani Nikula
@ 2014-03-03 14:34 ` Ville Syrjälä
  1 sibling, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2014-03-03 14:34 UTC (permalink / raw)
  To: deepak.s; +Cc: intel-gfx

On Mon, Mar 03, 2014 at 11:36:14AM +0530, deepak.s@intel.com wrote:
> From: Deepak S <deepak.s@intel.com>
> 
> 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.
> 
> Signed-off-by: Deepak S <deepak.s@intel.com>
> ---
>  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(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 2baeeef..398b101 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -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;
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index a8a069f..1478ea6 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -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;
> +
> +}

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

> +
>  /**
>   * __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.

>  		if (file_priv)
>  			mod_delayed_work(dev_priv->wq,
>  					 &file_priv->mm.idle_work,
> diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
> index c743057..a19bd7d 100644
> --- a/drivers/gpu/drm/i915/i915_params.c
> +++ b/drivers/gpu/drm/i915/i915_params.c
> @@ -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 dri-devel@lists.freedesktop.org, 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)");
> +
> +
> +
> -- 
> 1.8.5.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-03 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-03  6:06 [PATCH] drm/i915: Add boot paramter to control rps boost at boot time deepak.s
2014-03-03 14:00 ` Jani Nikula
2014-03-03 14:34 ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox