97e1a0a383a17631c7571706484020e6e1d7b5de
[openwrt/staging/noltari.git] /
1 From 33e5892858fc43e06037f8acc685f836a7d1a3e5 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] drm/vc4: Fix sending of page flip completion events
5 in FKMS mode.
6
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.
13
14 Signed-off-by: Eric Anholt <eric@anholt.net>
15 ---
16 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 15 +++++++++++++++
17 1 file changed, 15 insertions(+)
18
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)
24 {
25 + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
26 + struct drm_device *dev = crtc->dev;
27 +
28 + if (crtc->state->event) {
29 + unsigned long flags;
30 +
31 + crtc->state->event->pipe = drm_crtc_index(crtc);
32 +
33 + WARN_ON(drm_crtc_vblank_get(crtc) != 0);
34 +
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);
39 + }
40 }
41
42 static void vc4_crtc_handle_page_flip(struct vc4_crtc *vc4_crtc)