dd3dc03067bb4bf32cdef8d310c3096639623add
[oweals/openwrt.git] /
1 From ff9800ea44f10d38dc60e168e436887838846be9 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 5 Feb 2018 18:01:02 +0000
4 Subject: [PATCH 119/782] drm/vc4: Fix warning about vblank interrupts before
5  DRM core is ready.
6
7 The SMICS interrupt fires continuously, but since it's 1/100 the rate
8 of the USB interrupts, we don't really need a way to turn it off.  We
9 do need to make sure that we don't tell DRM about it until DRM has
10 asked for the interrupt at least once, because otherwise it will throw
11 a warning at boot time.
12
13 Signed-off-by: Eric Anholt <eric@anholt.net>
14 ---
15  drivers/gpu/drm/vc4/vc4_firmware_kms.c | 10 ++++++----
16  1 file changed, 6 insertions(+), 4 deletions(-)
17
18 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
19 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
20 @@ -43,6 +43,7 @@ struct vc4_crtc {
21  
22         struct drm_pending_vblank_event *event;
23         u32 overscan[4];
24 +       bool vblank_enabled;
25  };
26  
27  static inline struct vc4_crtc *to_vc4_crtc(struct drm_crtc *crtc)
28 @@ -420,7 +421,8 @@ static irqreturn_t vc4_crtc_irq_handler(
29  
30         if (stat & SMICS_INTERRUPTS) {
31                 writel(0, vc4_crtc->regs + SMICS);
32 -               drm_crtc_handle_vblank(&vc4_crtc->base);
33 +               if (vc4_crtc->vblank_enabled)
34 +                       drm_crtc_handle_vblank(&vc4_crtc->base);
35                 vc4_crtc_handle_page_flip(vc4_crtc);
36                 ret = IRQ_HANDLED;
37         }
38 @@ -443,9 +445,9 @@ static int vc4_page_flip(struct drm_crtc
39  
40  static int vc4_fkms_enable_vblank(struct drm_crtc *crtc)
41  {
42 -       /* XXX: Need a way to enable/disable the interrupt, to avoid
43 -        * DRM warnings at boot time.
44 -        */
45 +       struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
46 +
47 +       vc4_crtc->vblank_enabled = true;
48  
49         return 0;
50  }