kernel: bump kernel 4.4 to 4.4.129 for 17.01
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0519-drm-vc4-Enable-Disable-vblanks-properly-in-crtc-en-d.patch
1 From c4bd9665b145cacfdf9cbd5f3d83ed0961080236 Mon Sep 17 00:00:00 2001
2 From: Mario Kleiner <mario.kleiner.de@gmail.com>
3 Date: Tue, 19 Jul 2016 20:59:01 +0200
4 Subject: [PATCH] drm/vc4: Enable/Disable vblanks properly in crtc en/disable.
5
6 Add missing drm_crtc_vblank_on/off() calls so vblank irq
7 handling/updating/timestamping never runs with a crtc shut down
8 or during its shutdown/startup, as that causes large jumps in
9 vblank count and trouble for compositors.
10
11 Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
12 Signed-off-by: Eric Anholt <eric@anholt.net>
13 ---
14 drivers/gpu/drm/vc4/vc4_crtc.c | 6 ++++++
15 1 file changed, 6 insertions(+)
16
17 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
18 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
19 @@ -468,6 +468,9 @@ static void vc4_crtc_disable(struct drm_
20 int ret;
21 require_hvs_enabled(dev);
22
23 + /* Disable vblank irq handling before crtc is disabled. */
24 + drm_crtc_vblank_off(crtc);
25 +
26 if (VC4_DSI_USE_FIRMWARE_SETUP &&
27 (CRTC_READ(PV_V_CONTROL) & PV_VCONTROL_DSI)) {
28 /* Skip disabling the PV/HVS for the channel if it was
29 @@ -531,6 +534,9 @@ static void vc4_crtc_enable(struct drm_c
30 /* Turn on the pixel valve, which will emit the vstart signal. */
31 CRTC_WRITE(PV_V_CONTROL,
32 CRTC_READ(PV_V_CONTROL) | PV_VCONTROL_VIDEN);
33 +
34 + /* Enable vblank irq handling after crtc is started. */
35 + drm_crtc_vblank_on(crtc);
36 }
37
38 static bool vc4_crtc_mode_fixup(struct drm_crtc *crtc,