diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-06-27 11:52:10 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-07-05 17:56:24 -0400 |
commit | b79480ba5074ae81d1c32073bce3981652e0f717 (patch) | |
tree | 677ad4607f35ee842abf430314603dee55845323 /drivers/gpu/drm/i915/i915_irq.c | |
parent | 190d6cd5cd3606dd13a3ca5bf0c23dc520659c15 (diff) |
drm/i915: assert_spin_locked for pipestat interrupt enable/disable
Just to keep the paranoia equal also sprinkle locking asserts over the
pipestat interrupt enable/disable functions.
Again this results in false positives in the interrupt setup. Add
bogo-locking for these and a big comment explaining why it's there and
that it's indeed unnecessary.
v2: Fix up the spelling fail Paulo spotted in comments.
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 4c1b1e3dbf79..c2e11a0fa40c 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -319,6 +319,8 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | |||
319 | u32 reg = PIPESTAT(pipe); | 319 | u32 reg = PIPESTAT(pipe); |
320 | u32 pipestat = I915_READ(reg) & 0x7fff0000; | 320 | u32 pipestat = I915_READ(reg) & 0x7fff0000; |
321 | 321 | ||
322 | assert_spin_locked(&dev_priv->irq_lock); | ||
323 | |||
322 | if ((pipestat & mask) == mask) | 324 | if ((pipestat & mask) == mask) |
323 | return; | 325 | return; |
324 | 326 | ||
@@ -334,6 +336,8 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u32 mask) | |||
334 | u32 reg = PIPESTAT(pipe); | 336 | u32 reg = PIPESTAT(pipe); |
335 | u32 pipestat = I915_READ(reg) & 0x7fff0000; | 337 | u32 pipestat = I915_READ(reg) & 0x7fff0000; |
336 | 338 | ||
339 | assert_spin_locked(&dev_priv->irq_lock); | ||
340 | |||
337 | if ((pipestat & mask) == 0) | 341 | if ((pipestat & mask) == 0) |
338 | return; | 342 | return; |
339 | 343 | ||
@@ -2818,6 +2822,7 @@ static int valleyview_irq_postinstall(struct drm_device *dev) | |||
2818 | u32 gt_irqs; | 2822 | u32 gt_irqs; |
2819 | u32 enable_mask; | 2823 | u32 enable_mask; |
2820 | u32 pipestat_enable = PLANE_FLIP_DONE_INT_EN_VLV; | 2824 | u32 pipestat_enable = PLANE_FLIP_DONE_INT_EN_VLV; |
2825 | unsigned long irqflags; | ||
2821 | 2826 | ||
2822 | enable_mask = I915_DISPLAY_PORT_INTERRUPT; | 2827 | enable_mask = I915_DISPLAY_PORT_INTERRUPT; |
2823 | enable_mask |= I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | | 2828 | enable_mask |= I915_DISPLAY_PIPE_A_EVENT_INTERRUPT | |
@@ -2843,9 +2848,13 @@ static int valleyview_irq_postinstall(struct drm_device *dev) | |||
2843 | I915_WRITE(PIPESTAT(1), 0xffff); | 2848 | I915_WRITE(PIPESTAT(1), 0xffff); |
2844 | POSTING_READ(VLV_IER); | 2849 | POSTING_READ(VLV_IER); |
2845 | 2850 | ||
2851 | /* Interrupt setup is already guaranteed to be single-threaded, this is | ||
2852 | * just to make the assert_spin_locked check happy. */ | ||
2853 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | ||
2846 | i915_enable_pipestat(dev_priv, 0, pipestat_enable); | 2854 | i915_enable_pipestat(dev_priv, 0, pipestat_enable); |
2847 | i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE); | 2855 | i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE); |
2848 | i915_enable_pipestat(dev_priv, 1, pipestat_enable); | 2856 | i915_enable_pipestat(dev_priv, 1, pipestat_enable); |
2857 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | ||
2849 | 2858 | ||
2850 | I915_WRITE(VLV_IIR, 0xffffffff); | 2859 | I915_WRITE(VLV_IIR, 0xffffffff); |
2851 | I915_WRITE(VLV_IIR, 0xffffffff); | 2860 | I915_WRITE(VLV_IIR, 0xffffffff); |
@@ -3324,6 +3333,7 @@ static int i965_irq_postinstall(struct drm_device *dev) | |||
3324 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; | 3333 | drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; |
3325 | u32 enable_mask; | 3334 | u32 enable_mask; |
3326 | u32 error_mask; | 3335 | u32 error_mask; |
3336 | unsigned long irqflags; | ||
3327 | 3337 | ||
3328 | /* Unmask the interrupts that we always want on. */ | 3338 | /* Unmask the interrupts that we always want on. */ |
3329 | dev_priv->irq_mask = ~(I915_ASLE_INTERRUPT | | 3339 | dev_priv->irq_mask = ~(I915_ASLE_INTERRUPT | |
@@ -3342,7 +3352,11 @@ static int i965_irq_postinstall(struct drm_device *dev) | |||
3342 | if (IS_G4X(dev)) | 3352 | if (IS_G4X(dev)) |
3343 | enable_mask |= I915_BSD_USER_INTERRUPT; | 3353 | enable_mask |= I915_BSD_USER_INTERRUPT; |
3344 | 3354 | ||
3355 | /* Interrupt setup is already guaranteed to be single-threaded, this is | ||
3356 | * just to make the assert_spin_locked check happy. */ | ||
3357 | spin_lock_irqsave(&dev_priv->irq_lock, irqflags); | ||
3345 | i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE); | 3358 | i915_enable_pipestat(dev_priv, 0, PIPE_GMBUS_EVENT_ENABLE); |
3359 | spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags); | ||
3346 | 3360 | ||
3347 | /* | 3361 | /* |
3348 | * Enable some error detection, note the instruction error mask | 3362 | * Enable some error detection, note the instruction error mask |