1 From 78a937b1afc655d2b8f0db7058fedb5957667eb1 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Thu, 2 Feb 2017 09:42:18 -0800
4 Subject: [PATCH 114/773] drm/vc4: Fix sending of page flip completion events
7 In the rewrite of vc4_crtc.c for fkms, I dropped the part of the
8 CRTC's atomic flush handler that moved the completion event from the
9 proposed atomic state change to the CRTC's current state. That meant
10 that when full screen pageflipping happened (glxgears -fullscreen in
11 X, compton, por weston), the app would end up blocked firever waiting
12 to draw its next frame.
14 Signed-off-by: Eric Anholt <eric@anholt.net>
16 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 15 +++++++++++++++
17 1 file changed, 15 insertions(+)
19 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
20 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
21 @@ -336,6 +336,21 @@ static int vc4_crtc_atomic_check(struct
22 static void vc4_crtc_atomic_flush(struct drm_crtc *crtc,
23 struct drm_crtc_state *old_state)
25 + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
26 + struct drm_device *dev = crtc->dev;
28 + if (crtc->state->event) {
29 + unsigned long flags;
31 + crtc->state->event->pipe = drm_crtc_index(crtc);
33 + WARN_ON(drm_crtc_vblank_get(crtc) != 0);
35 + spin_lock_irqsave(&dev->event_lock, flags);
36 + vc4_crtc->event = crtc->state->event;
37 + crtc->state->event = NULL;
38 + spin_unlock_irqrestore(&dev->event_lock, flags);
42 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)