drm/i915: Wrap -EIO send-vblank event for failed pageflip in spinlock
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 7 Sep 2014 15:51:12 +0000 (16:51 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 19 Sep 2014 12:41:15 +0000 (14:41 +0200)
drm_send_vblank_event() demands that we hold the event spinlock whilst
calling it, so do so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Fix the double lock as requested by Chris.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c

index f4b8cb388dd6289220a88be2355fe28dd80e7b70..c5079f2c49f367c4f74ee3ed96e99cf53e4a3726 100644 (file)
@@ -10084,8 +10084,11 @@ free_work:
 out_hang:
                intel_crtc_wait_for_pending_flips(crtc);
                ret = intel_pipe_set_base(crtc, crtc->x, crtc->y, fb);
-               if (ret == 0 && event)
+               if (ret == 0 && event) {
+                       spin_lock_irqsave(&dev->event_lock, flags);
                        drm_send_vblank_event(dev, pipe, event);
+                       spin_unlock_irqrestore(&dev->event_lock, flags);
+               }
        }
        return ret;
 }