diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-02-02 12:09:50 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-02-13 17:27:59 -0500 |
commit | ffe02b403dff23798a33a342ab685555aa088786 (patch) | |
tree | 27e067452050dfd29af12473c4a728d71e0e4a43 /drivers/gpu/drm/i915/i915_irq.c | |
parent | ab8d66752a9c28cd6c94fa173feacdfc1554aa03 (diff) |
drm/i915: Introduce intel_set_rps()
Replace the valleyview_set_rps() and gen6_set_rps() calls with
intel_set_rps() which itself does the IS_VALLEYVIEW() check. The
code becomes simpler since the callers don't have to do this check
themselves.
Most of the change was performe with the following semantic patch:
@@
expression E1, E2, E3;
@@
- if (IS_VALLEYVIEW(E1)) {
- valleyview_set_rps(E2, E3);
- } else {
- gen6_set_rps(E2, E3);
- }
+ intel_set_rps(E2, E3);
Adding intel_set_rps() and making valleyview_set_rps() and gen6_set_rps()
static was done manually. Also valleyview_set_rps() had to be moved a
bit avoid a forward declaration.
v2: Use a less greedy semantic patch
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_irq.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_irq.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 4145d95902f5..90731195ab52 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -1243,10 +1243,7 @@ static void gen6_pm_rps_work(struct work_struct *work) | |||
1243 | 1243 | ||
1244 | dev_priv->rps.last_adj = new_delay - dev_priv->rps.cur_freq; | 1244 | dev_priv->rps.last_adj = new_delay - dev_priv->rps.cur_freq; |
1245 | 1245 | ||
1246 | if (IS_VALLEYVIEW(dev_priv->dev)) | 1246 | intel_set_rps(dev_priv->dev, new_delay); |
1247 | valleyview_set_rps(dev_priv->dev, new_delay); | ||
1248 | else | ||
1249 | gen6_set_rps(dev_priv->dev, new_delay); | ||
1250 | 1247 | ||
1251 | mutex_unlock(&dev_priv->rps.hw_lock); | 1248 | mutex_unlock(&dev_priv->rps.hw_lock); |
1252 | } | 1249 | } |