diff mbox

[2/7] drm/i915: Store the requested frequency whilst RPS is disabled

Message ID 20170220094713.22874-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Feb. 20, 2017, 9:47 a.m. UTC
If intel_set_rps() is called whilst the hw is disabled, just store the
requested frequency (from the user) for application when we wake the hw
up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_pm.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Szwichtenberg, Radoslaw Feb. 20, 2017, 12:36 p.m. UTC | #1
On Mon, 2017-02-20 at 09:47 +0000, Chris Wilson wrote:
> If intel_set_rps() is called whilst the hw is disabled, just store the

> requested frequency (from the user) for application when we wake the hw

> up.

> 

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index e1878cb5d569..af11c4090c07 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -5105,6 +5105,11 @@  int intel_set_rps(struct drm_i915_private *dev_priv, u8 val)
 	GEM_BUG_ON(val > dev_priv->rps.max_freq);
 	GEM_BUG_ON(val < dev_priv->rps.min_freq);
 
+	if (!dev_priv->rps.enabled) {
+		dev_priv->rps.cur_freq = val;
+		return 0;
+	}
+
 	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
 		err = valleyview_set_rps(dev_priv, val);
 	else