ca1b777b4b7de032434ed9061d97cdf88f22b36d
[oweals/openwrt.git] /
1 From 501dabdd480e2da1b3b1395b5ebf9d5306fec689 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 10 Apr 2019 17:42:37 +0100
4 Subject: [PATCH] drm: vc4: Iterate over all planes in
5  vc4_crtc_[dis|en]able
6
7 Fixes a FIXME where the overlay plane wouldn't be restored.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
10 ---
11  drivers/gpu/drm/vc4/vc4_firmware_kms.c | 20 +++++++++++---------
12  1 file changed, 11 insertions(+), 9 deletions(-)
13
14 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
15 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
16 @@ -598,6 +598,8 @@ static void vc4_crtc_mode_set_nofb(struc
17  
18  static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
19  {
20 +       struct drm_plane *plane;
21 +
22         drm_crtc_vblank_off(crtc);
23  
24         /* Always turn the planes off on CRTC disable. In DRM, planes
25 @@ -607,23 +609,23 @@ static void vc4_crtc_disable(struct drm_
26          * give us a CRTC-level control for that.
27          */
28  
29 -       vc4_plane_atomic_disable(crtc->cursor, crtc->cursor->state);
30 -       vc4_plane_atomic_disable(crtc->primary, crtc->primary->state);
31 -
32 -       /* FIXME: Disable overlay planes */
33 +       drm_atomic_crtc_for_each_plane(plane, crtc)
34 +               vc4_plane_atomic_disable(plane, plane->state);
35  }
36  
37  static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
38  {
39 +       struct drm_plane *plane;
40 +
41         drm_crtc_vblank_on(crtc);
42 +
43         /* Unblank the planes (if they're supposed to be displayed). */
44 +       drm_atomic_crtc_for_each_plane(plane, crtc)
45 +               if (plane->state->fb)
46 +                       vc4_plane_set_blank(plane, plane->state->visible);
47 +}
48  
49 -       if (crtc->primary->state->fb)
50 -               vc4_plane_set_blank(crtc->primary, false);
51 -       if (crtc->cursor->state->fb)
52 -               vc4_plane_set_blank(crtc->cursor, crtc->cursor->state);
53  
54 -       /* FIXME: Enable overlay planes */
55  }
56  
57  static int vc4_crtc_atomic_check(struct drm_crtc *crtc,