[Intel-gfx] [PATCH 2/6] drm/i915: Get runtime pm ref when setting min/max freqs
Mika Kuoppala
mika.kuoppala at linux.intel.com
Mon Dec 14 09:14:24 PST 2015
intel_set_rps() does hardware access later in the
chain, so it needs a runtime pm ref.
Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 4 ++++
drivers/gpu/drm/i915/i915_sysfs.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index bd8ba7e..d0e9f2d 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -4923,7 +4923,9 @@ i915_max_freq_set(void *data, u64 val)
dev_priv->rps.max_freq_softlimit = val;
+ intel_runtime_pm_get(dev_priv);
intel_set_rps(dev, val);
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev_priv->rps.hw_lock);
@@ -4990,7 +4992,9 @@ i915_min_freq_set(void *data, u64 val)
dev_priv->rps.min_freq_softlimit = val;
+ intel_runtime_pm_get(dev_priv);
intel_set_rps(dev, val);
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev_priv->rps.hw_lock);
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 37e3f0d..d43aebf 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -391,10 +391,12 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
dev_priv->rps.min_freq_softlimit,
dev_priv->rps.max_freq_softlimit);
+ intel_runtime_pm_get(dev_priv);
/* We still need *_set_rps to process the new max_delay and
* update the interrupt limits and PMINTRMSK even though
* frequency request may be unchanged. */
intel_set_rps(dev, val);
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev_priv->rps.hw_lock);
@@ -450,10 +452,12 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
dev_priv->rps.min_freq_softlimit,
dev_priv->rps.max_freq_softlimit);
+ intel_runtime_pm_get(dev_priv);
/* We still need *_set_rps to process the new min_delay and
* update the interrupt limits and PMINTRMSK even though
* frequency request may be unchanged. */
intel_set_rps(dev, val);
+ intel_runtime_pm_put(dev_priv);
mutex_unlock(&dev_priv->rps.hw_lock);
--
2.5.0
More information about the Intel-gfx
mailing list