a2bd18065929dc5621eee7c1e03abd6754b013a1
[openwrt/staging/blogic.git] /
1 From 7815410d46ef8c5462eadbeff59d8c7e43639b03 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 117/703] drm/vc4: Add missing enable/disable vblank handlers
5 in fkms.
6
7 Fixes hang at boot in 4.14.
8
9 Signed-off-by: Eric Anholt <eric@anholt.net>
10 ---
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(-)
14
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
18
19 static int vc4_enable_vblank(struct drm_crtc *crtc)
20 {
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);
24
25 - if (vc4->firmware_kms) {
26 - /* XXX: Can we mask the SMI interrupt? */
27 - return 0;
28 - }
29 -
30 CRTC_WRITE(PV_INTEN, PV_INT_VFP_START);
31
32 return 0;
33 @@ -780,15 +773,8 @@ static int vc4_enable_vblank(struct drm_
34
35 static void vc4_disable_vblank(struct drm_crtc *crtc)
36 {
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);
40
41 - if (vc4->firmware_kms) {
42 - /* XXX: Can we mask the SMI interrupt? */
43 - return;
44 - }
45 -
46 CRTC_WRITE(PV_INTEN, 0);
47 }
48
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);
53 }
54
55 +static int vc4_fkms_enable_vblank(struct drm_crtc *crtc)
56 +{
57 + /* XXX: Need a way to enable/disable the interrupt, to avoid
58 + * DRM warnings at boot time.
59 + */
60 +
61 + return 0;
62 +}
63 +
64 +static void vc4_fkms_disable_vblank(struct drm_crtc *crtc)
65 +{
66 +}
67 +
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,
77 };
78
79 static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {