brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0341-drm-vc4-Fix-drm_vblank_put-get-imbalance-in-page-fli.patch
1 From 4f9f74feec3951986a22aff184d0fa6fb7a47b93 Mon Sep 17 00:00:00 2001
2 From: Mario Kleiner <mario.kleiner.de@gmail.com>
3 Date: Fri, 6 May 2016 19:26:06 +0200
4 Subject: [PATCH 341/423] drm/vc4: Fix drm_vblank_put/get imbalance in page
5 flip path.
6
7 The async page flip path was missing drm_crtc_vblank_get/put
8 completely. The sync flip path was missing a vblank put, so async
9 flips only reported proper pageflip completion events by chance,
10 and vblank irq's never turned off after a first vsync'ed page flip
11 until system reboot.
12
13 Tested against Raspian kernel 4.4.8 tree on RPi 2B.
14
15 Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
16 Cc: Eric Anholt <eric@anholt.net>
17 Signed-off-by: Eric Anholt <eric@anholt.net>
18 ---
19 drivers/gpu/drm/vc4/vc4_crtc.c | 4 ++++
20 1 file changed, 4 insertions(+)
21
22 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
23 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
24 @@ -506,6 +506,7 @@ static void vc4_crtc_handle_page_flip(st
25 if (vc4_crtc->event) {
26 drm_crtc_send_vblank_event(crtc, vc4_crtc->event);
27 vc4_crtc->event = NULL;
28 + drm_crtc_vblank_put(crtc);
29 }
30 spin_unlock_irqrestore(&dev->event_lock, flags);
31 }
32 @@ -556,6 +557,7 @@ vc4_async_page_flip_complete(struct vc4_
33 spin_unlock_irqrestore(&dev->event_lock, flags);
34 }
35
36 + drm_crtc_vblank_put(crtc);
37 drm_framebuffer_unreference(flip_state->fb);
38 kfree(flip_state);
39
40 @@ -598,6 +600,8 @@ static int vc4_async_page_flip(struct dr
41 return ret;
42 }
43
44 + WARN_ON(drm_crtc_vblank_get(crtc) != 0);
45 +
46 /* Immediately update the plane's legacy fb pointer, so that later
47 * modeset prep sees the state that will be present when the semaphore
48 * is released.