c9ce67fba5fb82057f938e9c9aee26368c23c726
[openwrt/staging/ldir.git] /
1 From fe2432615ecc3500cc265d6b84334950b9cbd4bf Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 9 Apr 2019 18:14:44 +0100
4 Subject: [PATCH] from
5 vc4_crtc_[en|dis]able
6
7 vblank needs to be enabled and disabled by the driver to avoid the
8 DRM framework complaining in the kernel log.
9
10 vc4_fkms_disable_vblank needs to signal that we don't want vblank
11 callbacks too.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
14 ---
15 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 6 ++++++
16 1 file changed, 6 insertions(+)
17
18 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
19 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
20 @@ -562,6 +562,8 @@ static void vc4_crtc_mode_set_nofb(struc
21
22 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
23 {
24 + drm_crtc_vblank_off(crtc);
25 +
26 /* Always turn the planes off on CRTC disable. In DRM, planes
27 * are enabled/disabled through the update/disable hooks
28 * above, and the CRTC enable/disable independently controls
29 @@ -577,6 +579,7 @@ static void vc4_crtc_disable(struct drm_
30
31 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
32 {
33 + drm_crtc_vblank_on(crtc);
34 /* Unblank the planes (if they're supposed to be displayed). */
35
36 if (crtc->primary->state->fb)
37 @@ -673,6 +676,9 @@ static int vc4_fkms_enable_vblank(struct
38
39 static void vc4_fkms_disable_vblank(struct drm_crtc *crtc)
40 {
41 + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
42 +
43 + vc4_crtc->vblank_enabled = false;
44 }
45
46 static const struct drm_crtc_funcs vc4_crtc_funcs = {