From: Tom O'Rourke <Tom.O'Rourke@xxxxxxxxx> Update sysfs and debugfs functions to set SLPC parameters when setting max/min frequency. v2: Update for SLPC 2015.2.4 (params for both slice and unslice) Replace HAS_SLPC with intel_slpc_active() (Paulo) Signed-off-by: Tom O'Rourke <Tom.O'Rourke@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_debugfs.c | 16 ++++++++++++++++ drivers/gpu/drm/i915/i915_sysfs.c | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 1295d8b..f77d32c 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -5014,6 +5014,14 @@ i915_max_freq_set(void *data, u64 val) } dev_priv->rps.max_freq_softlimit = val; + if (intel_slpc_active(dev)) { + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MAX_GT_UNSLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MAX_GT_SLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + } intel_set_rps(dev, val); @@ -5081,6 +5089,14 @@ i915_min_freq_set(void *data, u64 val) } dev_priv->rps.min_freq_softlimit = val; + if (intel_slpc_active(dev)) { + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MIN_GT_UNSLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MIN_GT_SLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + } intel_set_rps(dev, val); diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c index 826e40c..091a936 100644 --- a/drivers/gpu/drm/i915/i915_sysfs.c +++ b/drivers/gpu/drm/i915/i915_sysfs.c @@ -393,6 +393,15 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev, dev_priv->rps.max_freq_softlimit = val; + if (intel_slpc_active(dev)) { + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MAX_GT_UNSLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MAX_GT_SLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + } + val = clamp_t(int, dev_priv->rps.cur_freq, dev_priv->rps.min_freq_softlimit, dev_priv->rps.max_freq_softlimit); @@ -457,6 +466,15 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev, dev_priv->rps.min_freq_softlimit = val; + if (intel_slpc_active(dev)) { + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MIN_GT_UNSLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + intel_slpc_set_param(dev, + SLPC_PARAM_GLOBAL_MIN_GT_SLICE_FREQ_MHZ, + (u32) intel_gpu_freq(dev_priv, val)); + } + val = clamp_t(int, dev_priv->rps.cur_freq, dev_priv->rps.min_freq_softlimit, dev_priv->rps.max_freq_softlimit); -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx