5f93f537164f0dd98143cd0d8374b81ac15bbff9
[openwrt/staging/aparcar.git] /
1 From 987e5c40893f587ed8654f0cc83a399d6bf3c47d 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/782] drm/vc4: Remove duplicate primary/cursor fields from
5 FKMS driver.
6
7 The CRTC has those fields and we can just use them.
8
9 Signed-off-by: Eric Anholt <eric@anholt.net>
10 ---
11 drivers/gpu/drm/vc4/vc4_firmware_kms.c | 24 +++++++-----------------
12 1 file changed, 7 insertions(+), 17 deletions(-)
13
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 {
17 struct drm_crtc base;
18 struct drm_encoder *encoder;
19 struct drm_connector *connector;
20 - struct drm_plane *primary;
21 - struct drm_plane *cursor;
22 void __iomem *regs;
23
24 struct drm_pending_vblank_event *event;
25 @@ -356,29 +354,24 @@ static void vc4_crtc_mode_set_nofb(struc
26
27 static void vc4_crtc_disable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
28 {
29 - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
30 -
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.
36 */
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);
42 }
43
44 static void vc4_crtc_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
45 {
46 - struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc);
47 -
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);
59 }
60 }
61
62 @@ -689,9 +682,6 @@ static int vc4_fkms_bind(struct device *
63 primary_plane->crtc = crtc;
64 cursor_plane->crtc = crtc;
65
66 - vc4_crtc->primary = primary_plane;
67 - vc4_crtc->cursor = cursor_plane;
68 -
69 vc4_encoder = devm_kzalloc(dev, sizeof(*vc4_encoder), GFP_KERNEL);
70 if (!vc4_encoder)
71 return -ENOMEM;