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
7 vblank needs to be enabled and disabled by the driver to avoid the
8 DRM framework complaining in the kernel log.
10 vc4_fkms_disable_vblank needs to signal that we don't want vblank
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
15 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 7 +++++++
16 1 file changed, 7 insertions(+)
18 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
19 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
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
30 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
32 + drm_crtc_vblank_off(crtc);
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_
39 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
41 + drm_crtc_vblank_on(crtc);
42 /* Unblank the planes (if they're supposed to be displayed). */
44 if (crtc->primary->state->fb)
45 @@ -674,6 +678,9 @@ static int vc4_fkms_enable_vblank(struct
47 static void vc4_fkms_disable_vblank(struct drm_crtc *crtc)
49 + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
51 + vc4_crtc->vblank_enabled = false;
54 static const struct drm_crtc_funcs vc4_crtc_funcs = {