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
7 Fixes a FIXME where the overlay plane wouldn't be restored.
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
11 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 20 +++++++++++---------
12 1 file changed, 11 insertions(+), 9 deletions(-)
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
18 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
20 + struct drm_plane *plane;
22 drm_crtc_vblank_off(crtc);
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.
29 - vc4_plane_atomic_disable(crtc->cursor, crtc->cursor->state);
30 - vc4_plane_atomic_disable(crtc->primary, crtc->primary->state);
32 - /* FIXME: Disable overlay planes */
33 + drm_atomic_crtc_for_each_plane(plane, crtc)
34 + vc4_plane_atomic_disable(plane, plane->state);
37 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
39 + struct drm_plane *plane;
41 drm_crtc_vblank_on(crtc);
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);
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);
54 - /* FIXME: Enable overlay planes */
57 static int vc4_crtc_atomic_check(struct drm_crtc *crtc,