]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm: i915: Only return EBUSY after we've established we need to schedule a new swap.
author=?utf-8?q?Michel_D=C3=A4nzer?= <michel@tungstengraphics.com>
Tue, 24 Oct 2006 14:10:59 +0000 (00:10 +1000)
committerairlied <airlied@linux.ie>
Thu, 7 Dec 2006 04:53:30 +0000 (15:53 +1100)
Signed-off-by: Dave Airlie <airlied@linux.ie>
drivers/char/drm/i915_irq.c

index df28bc1e84c67e021ff4e321354b0b74211a8699..40c55edfa2ee843b247d9ac1d1832aa3d8c8f625 100644 (file)
@@ -392,11 +392,6 @@ int i915_vblank_swap(DRM_IOCTL_ARGS)
                return DRM_ERR(EINVAL);
        }
 
-       if (dev_priv->swaps_pending >= 100) {
-               DRM_DEBUG("Too many swaps queued\n");
-               return DRM_ERR(EBUSY);
-       }
-
        DRM_COPY_FROM_USER_IOCTL(swap, (drm_i915_vblank_swap_t __user *) data,
                                 sizeof(swap));
 
@@ -461,6 +456,11 @@ int i915_vblank_swap(DRM_IOCTL_ARGS)
 
        spin_unlock_irqrestore(&dev_priv->swaps_lock, irqflags);
 
+       if (dev_priv->swaps_pending >= 100) {
+               DRM_DEBUG("Too many swaps queued\n");
+               return DRM_ERR(EBUSY);
+       }
+
        vbl_swap = drm_calloc(1, sizeof(vbl_swap), DRM_MEM_DRIVER);
 
        if (!vbl_swap) {