diff --git a/linux-core/drm_irq.c b/linux-core/drm_irq.c index 592ea2a..19c7601 100644 --- a/linux-core/drm_irq.c +++ b/linux-core/drm_irq.c @@ -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) { + 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: