Core vsync: Don't clobber target sequence number when scheduling signal.
authorMichel Dänzer <michel@tungstengraphics.com>
Fri, 1 Sep 2006 09:35:31 +0000 (11:35 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Thu, 28 Sep 2006 13:41:36 +0000 (15:41 +0200)
It looks like this would have caused signals to always get sent on the next
vertical blank, regardless of the sequence number.

linux-core/drm_irq.c

index bd8a9c8..d1a6a6b 100644 (file)
@@ -295,8 +295,6 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)
                                      ? &dev->vbl_sigs2 : &dev->vbl_sigs;
                drm_vbl_sig_t *vbl_sig;
 
-               vblwait.reply.sequence = seq;
-
                spin_lock_irqsave(&dev->vbl_lock, irqflags);
 
                /* Check if this task has already scheduled the same signal
@@ -309,6 +307,7 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)
                            && vbl_sig->task == current) {
                                spin_unlock_irqrestore(&dev->vbl_lock,
                                                       irqflags);
+                               vblwait.reply.sequence = seq;
                                goto done;
                        }
                }
@@ -339,6 +338,8 @@ int drm_wait_vblank(DRM_IOCTL_ARGS)
                list_add_tail((struct list_head *)vbl_sig, &vbl_sigs->head);
 
                spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
+
+               vblwait.reply.sequence = seq;
        } else {
                if (flags & _DRM_VBLANK_SECONDARY) {
                        if (dev->driver->vblank_wait2)