diff --git a/shared-core/i915_irq.c b/shared-core/i915_irq.c index 7595200..715e822 100644 --- a/shared-core/i915_irq.c +++ b/shared-core/i915_irq.c @@ -336,18 +336,25 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) if (temp & (VSYNC_PIPEA_FLAG | VSYNC_PIPEB_FLAG)) { 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) + if (i915_get_pipe(dev,0) == 0) { + if ((vblank_pipe & DRM_I915_VBLANK_PIPE_A) && + (temp & VSYNC_PIPEA_FLAG)) { atomic_inc(&dev->vbl_received); - if (temp & VSYNC_PIPEB_FLAG) + } + if ((vblank_pipe & DRM_I915_VBLANK_PIPE_B) && + (temp & VSYNC_PIPEB_FLAG)) { + atomic_inc(&dev->vbl_received2); + } + } else { + if ((vblank_pipe & DRM_I915_VBLANK_PIPE_A) && + (temp & VSYNC_PIPEA_FLAG)) { atomic_inc(&dev->vbl_received2); - } 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); + } + if ((vblank_pipe & DRM_I915_VBLANK_PIPE_B) && + (temp & VSYNC_PIPEB_FLAG)) { + atomic_inc(&dev->vbl_received); + } + } DRM_WAKEUP(&dev->vbl_queue); drm_vbl_send_signals(dev); @@ -455,25 +462,12 @@ static int i915_driver_vblank_do_wait(struct drm_device *dev, int i915_driver_vblank_wait(struct drm_device *dev, unsigned int *sequence) { - atomic_t *counter; - - if (i915_get_pipe(dev, 0) == 0) - counter = &dev->vbl_received; - else - counter = &dev->vbl_received2; - return i915_driver_vblank_do_wait(dev, sequence, counter); + return i915_driver_vblank_do_wait(dev, sequence, &dev->vbl_received); } int i915_driver_vblank_wait2(struct drm_device *dev, unsigned int *sequence) { - atomic_t *counter; - - if (i915_get_pipe(dev, 1) == 0) - counter = &dev->vbl_received; - else - counter = &dev->vbl_received2; - - return i915_driver_vblank_do_wait(dev, sequence, counter); + return i915_driver_vblank_do_wait(dev, sequence, &dev->vbl_received2); } /* Needs the lock as it touches the ring.