aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorDeepak S <deepak.s@linux.intel.com>2014-03-15 10:53:22 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-28 13:31:58 -0400
commita6706b45a57a23a613b34793e1414991b60a09c1 (patch)
tree36b1707d2a687103de2ab8617313278fed9c5dff /drivers/gpu/drm/i915/intel_pm.c
parent4cc314893064dd3166708242dd0836ef47805d5c (diff)
drm/i915: Track the enabled PM interrupts in dev_priv.
When we use different rps events for different platforms or due to wa, we might end up needing this logic in a lot of places. Instead of this let's use a variable in dev_priv to track the enabled PM interrupts. v2: Initialize pm_rps_events in intel_irq_init() (Ville). Signed-off-by: Deepak S <deepak.s@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> [danvet: Frob the commit message a bit since the English was a bit too garbled ;-) ] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index fd68f93671bb..faa059a902a1 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3160,7 +3160,8 @@ static void gen6_disable_rps_interrupts(struct drm_device *dev)
3160 struct drm_i915_private *dev_priv = dev->dev_private; 3160 struct drm_i915_private *dev_priv = dev->dev_private;
3161 3161
3162 I915_WRITE(GEN6_PMINTRMSK, 0xffffffff); 3162 I915_WRITE(GEN6_PMINTRMSK, 0xffffffff);
3163 I915_WRITE(GEN6_PMIER, I915_READ(GEN6_PMIER) & ~GEN6_PM_RPS_EVENTS); 3163 I915_WRITE(GEN6_PMIER, I915_READ(GEN6_PMIER) &
3164 ~dev_priv->pm_rps_events);
3164 /* Complete PM interrupt masking here doesn't race with the rps work 3165 /* Complete PM interrupt masking here doesn't race with the rps work
3165 * item again unmasking PM interrupts because that is using a different 3166 * item again unmasking PM interrupts because that is using a different
3166 * register (PMIMR) to mask PM interrupts. The only risk is in leaving 3167 * register (PMIMR) to mask PM interrupts. The only risk is in leaving
@@ -3170,7 +3171,7 @@ static void gen6_disable_rps_interrupts(struct drm_device *dev)
3170 dev_priv->rps.pm_iir = 0; 3171 dev_priv->rps.pm_iir = 0;
3171 spin_unlock_irq(&dev_priv->irq_lock); 3172 spin_unlock_irq(&dev_priv->irq_lock);
3172 3173
3173 I915_WRITE(GEN6_PMIIR, GEN6_PM_RPS_EVENTS); 3174 I915_WRITE(GEN6_PMIIR, dev_priv->pm_rps_events);
3174} 3175}
3175 3176
3176static void gen6_disable_rps(struct drm_device *dev) 3177static void gen6_disable_rps(struct drm_device *dev)
@@ -3232,12 +3233,12 @@ static void gen6_enable_rps_interrupts(struct drm_device *dev)
3232 3233
3233 spin_lock_irq(&dev_priv->irq_lock); 3234 spin_lock_irq(&dev_priv->irq_lock);
3234 WARN_ON(dev_priv->rps.pm_iir); 3235 WARN_ON(dev_priv->rps.pm_iir);
3235 snb_enable_pm_irq(dev_priv, GEN6_PM_RPS_EVENTS); 3236 snb_enable_pm_irq(dev_priv, dev_priv->pm_rps_events);
3236 I915_WRITE(GEN6_PMIIR, GEN6_PM_RPS_EVENTS); 3237 I915_WRITE(GEN6_PMIIR, dev_priv->pm_rps_events);
3237 spin_unlock_irq(&dev_priv->irq_lock); 3238 spin_unlock_irq(&dev_priv->irq_lock);
3238 3239
3239 /* only unmask PM interrupts we need. Mask all others. */ 3240 /* only unmask PM interrupts we need. Mask all others. */
3240 enabled_intrs = GEN6_PM_RPS_EVENTS; 3241 enabled_intrs = dev_priv->pm_rps_events;
3241 3242
3242 /* IVB and SNB hard hangs on looping batchbuffer 3243 /* IVB and SNB hard hangs on looping batchbuffer
3243 * if GEN6_PM_UP_EI_EXPIRED is masked. 3244 * if GEN6_PM_UP_EI_EXPIRED is masked.