[Intel-gfx] [PATCH] drm/i915: Add boot paramter to control rps boost at boot time.

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Mar 3 15:34:55 CET 2014


On Mon, Mar 03, 2014 at 11:36:14AM +0530, deepak.s at intel.com wrote:
> From: Deepak S <deepak.s at 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 at 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 at 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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC



More information about the Intel-gfx mailing list