1 From 9c3d03b62cec67df4f3c989a2eceb38c1415fa71 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Mon, 5 Feb 2018 18:22:03 +0000
4 Subject: [PATCH 121/725] drm/vc4: Remove duplicate primary/cursor fields from
7 The CRTC has those fields and we can just use them.
9 Signed-off-by: Eric Anholt <eric@anholt.net>
11 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 24 +++++++-----------------
12 1 file changed, 7 insertions(+), 17 deletions(-)
14 --- a/drivers/gpu/drm/vc4/vc4_firmware_kms.c
15 +++ b/drivers/gpu/drm/vc4/vc4_firmware_kms.c
16 @@ -37,8 +37,6 @@ struct vc4_crtc {
18 struct drm_encoder *encoder;
19 struct drm_connector *connector;
20 - struct drm_plane *primary;
21 - struct drm_plane *cursor;
24 struct drm_pending_vblank_event *event;
25 @@ -356,29 +354,24 @@ static void vc4_crtc_mode_set_nofb(struc
27 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
29 - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
31 /* Always turn the planes off on CRTC disable. In DRM, planes
32 * are enabled/disabled through the update/disable hooks
33 * above, and the CRTC enable/disable independently controls
34 * whether anything scans out at all, but the firmware doesn't
35 * give us a CRTC-level control for that.
37 - vc4_cursor_plane_atomic_disable(vc4_crtc->cursor,
38 - vc4_crtc->cursor->state);
39 - vc4_plane_set_primary_blank(vc4_crtc->primary, true);
40 + vc4_cursor_plane_atomic_disable(crtc->cursor, crtc->cursor->state);
41 + vc4_plane_set_primary_blank(crtc->primary, true);
44 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
46 - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
48 /* Unblank the planes (if they're supposed to be displayed). */
49 - if (vc4_crtc->primary->state->fb)
50 - vc4_plane_set_primary_blank(vc4_crtc->primary, false);
51 - if (vc4_crtc->cursor->state->fb) {
52 - vc4_cursor_plane_atomic_update(vc4_crtc->cursor,
53 - vc4_crtc->cursor->state);
54 + if (crtc->primary->state->fb)
55 + vc4_plane_set_primary_blank(crtc->primary, false);
56 + if (crtc->cursor->state->fb) {
57 + vc4_cursor_plane_atomic_update(crtc->cursor,
58 + crtc->cursor->state);
62 @@ -689,9 +682,6 @@ static int vc4_fkms_bind(struct device *
63 primary_plane->crtc = crtc;
64 cursor_plane->crtc = crtc;
66 - vc4_crtc->primary = primary_plane;
67 - vc4_crtc->cursor = cursor_plane;
69 vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL);