aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.4/950-0245-drm-vc4-Iterate-over-all-planes-in-vc4_crtc_-dis-en-.patch
blob: 05f50cd91347018b1ff24f1cf6b6b28fcc309ac6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 016e6e68a119d3f4cae3c148433e2d661c7835be Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Wed, 10 Apr 2019 17:42:37 +0100
Subject: [PATCH] drm: vc4: Iterate over all planes in
 vc4_crtc_[dis|en]able

Fixes a FIXME where the overlay plane wouldn't be restored.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
---
 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

--- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
+++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
@@ -600,6 +600,8 @@ static void vc4_crtc_mode_set_nofb(struc
 
 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
 {
+	struct drm_plane *plane;
+
 	drm_crtc_vblank_off(crtc);
 
 	/* Always turn the planes off on CRTC disable. In DRM, planes
@@ -609,23 +611,23 @@ static void vc4_crtc_disable(struct drm_
 	 * give us a CRTC-level control for that.
 	 */
 
-	vc4_plane_atomic_disable(crtc->cursor, crtc->cursor->state);
-	vc4_plane_atomic_disable(crtc->primary, crtc->primary->state);
-
-	/* FIXME: Disable overlay planes */
+	drm_atomic_crtc_for_each_plane(plane, crtc)
+		vc4_plane_atomic_disable(plane, plane->state);
 }
 
 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
 {
+	struct drm_plane *plane;
+
 	drm_crtc_vblank_on(crtc);
+
 	/* Unblank the planes (if they're supposed to be displayed). */
+	drm_atomic_crtc_for_each_plane(plane, crtc)
+		if (plane->state->fb)
+			vc4_plane_set_blank(plane, plane->state->visible);
+}
 
-	if (crtc->primary->state->fb)
-		vc4_plane_set_blank(crtc->primary, false);
-	if (crtc->cursor->state->fb)
-		vc4_plane_set_blank(crtc->cursor, crtc->cursor->state);
 
-	/* FIXME: Enable overlay planes */
 }
 
 static int vc4_crtc_atomic_check(struct drm_crtc *crtc,