OSDN Git Service

vblank: Don't return current sequence number and time if interrupted by signal.
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 3 Jun 2008 09:28:09 +0000 (11:28 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 3 Jun 2008 09:28:09 +0000 (11:28 +0200)
linux-core/drm_irq.c

index 8f27d7f..e2f106e 100644 (file)
@@ -484,7 +484,6 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
                    struct drm_file *file_priv)
 {
        union drm_wait_vblank *vblwait = data;
-       struct timeval now;
        int ret = 0;
        unsigned int flags, seq, crtc;
 
@@ -588,11 +587,16 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
                            (((cur_vblank = drm_vblank_count(dev, crtc))
                              - vblwait->request.sequence) <= (1 << 23)));
                drm_vblank_put(dev, crtc);
-               do_gettimeofday(&now);
 
-               vblwait->reply.tval_sec = now.tv_sec;
-               vblwait->reply.tval_usec = now.tv_usec;
-               vblwait->reply.sequence = cur_vblank;
+               if (ret != -EINTR) {
+                       struct timeval now;
+
+                       do_gettimeofday(&now);
+
+                       vblwait->reply.tval_sec = now.tv_sec;
+                       vblwait->reply.tval_usec = now.tv_usec;
+                       vblwait->reply.sequence = cur_vblank;
+               }
        }
 
       done: