635340c08228bb27e1565f81e30001edcaed7e4f
[oweals/openwrt.git] /
1 From 236758b499086e0de280407396550125f1b6647a 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 | 7 +++++++
16  1 file changed, 7 insertions(+)
17
18 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
19 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
20 @@ -21,6 +21,7 @@
21  #include "drm/drm_fourcc.h"
22  #include "drm/drm_probe_helper.h"
23  #include "drm/drm_drv.h"
24 +#include "drm/drm_vblank.h"
25  #include "linux/clk.h"
26  #include "linux/debugfs.h"
27  #include "drm/drm_fb_cma_helper.h"
28 @@ -563,6 +564,8 @@ static void vc4_crtc_mode_set_nofb(struc
29  
30  static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
31  {
32 +       drm_crtc_vblank_off(crtc);
33 +
34         /* Always turn the planes off on CRTC disable. In DRM, planes
35          * are enabled/disabled through the update/disable hooks
36          * above, and the CRTC enable/disable independently controls
37 @@ -578,6 +581,7 @@ static void vc4_crtc_disable(struct drm_
38  
39  static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
40  {
41 +       drm_crtc_vblank_on(crtc);
42         /* Unblank the planes (if they're supposed to be displayed). */
43  
44         if (crtc->primary->state->fb)
45 @@ -674,6 +678,9 @@ static int vc4_fkms_enable_vblank(struct
46  
47  static void vc4_fkms_disable_vblank(struct drm_crtc *crtc)
48  {
49 +       struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
50 +
51 +       vc4_crtc->vblank_enabled = false;
52  }
53  
54  static const struct drm_crtc_funcs vc4_crtc_funcs = {