1 From 10d8194f8415a69d3ea049450e86e14572591a71 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Tue, 30 Jan 2018 14:21:02 -0800
4 Subject: [PATCH] drm/vc4: Add missing enable/disable vblank handlers
7 Fixes hang at boot in 4.14.
9 Signed-off-by: Eric Anholt <eric@anholt.net>
11 drivers/gpu/drm/vc4/vc4_crtc.c | 14 --------------
12 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 15 +++++++++++++++
13 2 files changed, 15 insertions(+), 14 deletions(-)
15 --- a/drivers/gpu/drm/vc4/vc4_crtc.c
16 +++ b/drivers/gpu/drm/vc4/vc4_crtc.c
17 @@ -764,15 +764,8 @@ static void vc4_crtc_atomic_flush(struct
19 static int vc4_enable_vblank(struct drm_crtc *crtc)
21 - struct drm_device *dev = crtc->dev;
22 - struct vc4_dev *vc4 = to_vc4_dev(dev);
23 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
25 - if (vc4->firmware_kms) {
26 - /* XXX: Can we mask the SMI interrupt? */
30 CRTC_WRITE(PV_INTEN, PV_INT_VFP_START);
33 @@ -780,15 +773,8 @@ static int vc4_enable_vblank(struct drm_
35 static void vc4_disable_vblank(struct drm_crtc *crtc)
37 - struct drm_device *dev = crtc->dev;
38 - struct vc4_dev *vc4 = to_vc4_dev(dev);
39 struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
41 - if (vc4->firmware_kms) {
42 - /* XXX: Can we mask the SMI interrupt? */
46 CRTC_WRITE(PV_INTEN, 0);
49 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
50 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
51 @@ -433,6 +433,19 @@ static int vc4_page_flip(struct drm_crtc
52 return drm_atomic_helper_page_flip(crtc, fb, event, flags, ctx);
55 +static int vc4_fkms_enable_vblank(struct drm_crtc *crtc)
57 + /* XXX: Need a way to enable/disable the interrupt, to avoid
58 + * DRM warnings at boot time.
64 +static void vc4_fkms_disable_vblank(struct drm_crtc *crtc)
68 static const struct drm_crtc_funcs vc4_crtc_funcs = {
69 .set_config = drm_atomic_helper_set_config,
70 .destroy = drm_crtc_cleanup,
71 @@ -443,6 +456,8 @@ static const struct drm_crtc_funcs vc4_c
72 .reset = drm_atomic_helper_crtc_reset,
73 .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
74 .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
75 + .enable_vblank = vc4_fkms_enable_vblank,
76 + .disable_vblank = vc4_fkms_disable_vblank,
79 static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {