a146cd5e383631e20d6b2e4b9c2233bb4b57d615
[oweals/openwrt.git] /
1 From 1f2718aa829aac2c918f48bad20e686add305819 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 601/773] drm: vc4: Need to call drm_crtc_vblank_[on|off] 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 = {