summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-09-27 18:22:10 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-09-28 15:41:36 +0200
commit881ba569929ceafd42e3c86228b0172099083d1d (patch)
tree767864066e98bde0d3f1812a1fa2b854cbe12a22 /shared-core
parent2627131e5d0c8cd5e3f0db06451c2e7ae7569b1b (diff)
i915: Avoid mis-counting vblank interrupts when they're only enabled for pipe A.
It looks like 'after a while', I915REG_INT_IDENTITY_R for some reason always has VSYNC_PIPEB_FLAG set in the interrupt handler, even though pipe B is disabled. So we only increase dev->vbl_received if the corresponding bit is also set in dev->vblank_pipe.
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/i915_irq.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c
index 9db38706..fbc66749 100644
--- a/shared-core/i915_irq.c
+++ b/shared-core/i915_irq.c
@@ -153,14 +153,19 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS)
DRM_WAKEUP(&dev_priv->irq_queue);
if (temp & (VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG)) {
- if ((dev_priv->vblank_pipe &
+ int vblank_pipe = dev_priv->vblank_pipe;
+
+ if ((vblank_pipe &
(DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B))
== (DRM_I915_VBLANK_PIPE_A | DRM_I915_VBLANK_PIPE_B)) {
if (temp & VSYNC_PIPEA_FLAG)
atomic_inc(&dev->vbl_received);
if (temp & VSYNC_PIPEB_FLAG)
atomic_inc(&dev->vbl_received2);
- } else
+ } else if (((temp & VSYNC_PIPEA_FLAG) &&
+ (vblank_pipe & DRM_I915_VBLANK_PIPE_A)) ||
+ ((temp & VSYNC_PIPEB_FLAG) &&
+ (vblank_pipe & DRM_I915_VBLANK_PIPE_B)))
atomic_inc(&dev->vbl_received);
DRM_WAKEUP(&dev->vbl_queue);