@@ -1244,12 +1244,14 @@ int drm_wait_vblank(struct drm_device *dev, void *data,
DRM_DEBUG("waiting on vblank count %d, crtc %d\n",
vblwait->request.sequence, crtc);
dev->vblank[crtc].last_wait = vblwait->request.sequence;
- DRM_WAIT_ON(ret, dev->vblank[crtc].queue, 3 * HZ,
- (((drm_vblank_count(dev, crtc) -
- vblwait->request.sequence) <= (1 << 23)) ||
- !dev->irq_enabled));
-
- if (ret != -EINTR) {
+#define C \
+ (((drm_vblank_count(dev, crtc) - vblwait->request.sequence) \
+ <= (1 << 23)) || \
+ !dev->irq_enabled)
+ ret = wait_event_interruptible(dev->vblank[crtc].queue, C);
+#undef C
+
+ if (ret == 0) {
struct timeval now;
vblwait->reply.sequence = drm_vblank_count_and_time(dev, crtc, &now);
Note that I've dropped the timeout - we don't expect the display hardware to ever hang, and the current code isn't really up to handle this correctly anyway. The only risk I see is that old user modesetting drivers wreak havoc with themselves by disabling the interrupt support at the wrong time. But then again this means we're running X and will get a signal sooner or later anyway. So it should get out of the loop latest when the user attempts to do a vt switch. Also extract the condition into a temporary macro for better readability. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> --- drivers/gpu/drm/drm_irq.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)