320f9a595b09b65f3d5a1464778e42712bd5a23b
[openwrt/staging/neocturne.git] /
1 From b5e5e7a57e2a0475826df547921d2bc72f0daf02 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Wed, 15 Dec 2021 17:44:49 +0000
4 Subject: [PATCH] drm/vc4: Remove splitting the bridge chain from the
5 driver.
6
7 Splitting the bridge chain fails for atomic bridges as the
8 framework can't add the relevant state in
9 drm_atomic_add_encoder_bridges.
10 The chain was split because we needed to power up before
11 calling pre_enable, but that is now done in mode_set, and will
12 move into the framework.
13
14 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
15 ---
16 drivers/gpu/drm/vc4/vc4_dsi.c | 38 -----------------------------------
17 1 file changed, 38 deletions(-)
18
19 --- a/drivers/gpu/drm/vc4/vc4_dsi.c
20 +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
21 @@ -554,7 +554,6 @@ struct vc4_dsi {
22 struct mipi_dsi_host dsi_host;
23 struct drm_encoder *encoder;
24 struct drm_bridge *out_bridge;
25 - struct list_head bridge_chain;
26
27 void __iomem *regs;
28
29 @@ -798,23 +797,9 @@ static void vc4_dsi_encoder_disable(stru
30 struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
31 struct vc4_dsi *dsi = vc4_encoder->dsi;
32 struct device *dev = &dsi->pdev->dev;
33 - struct drm_bridge *iter;
34 -
35 - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
36 - if (iter->funcs->disable)
37 - iter->funcs->disable(iter);
38 -
39 - if (iter == dsi->out_bridge)
40 - break;
41 - }
42
43 vc4_dsi_ulps(dsi, true);
44
45 - list_for_each_entry_from(iter, &dsi->bridge_chain, chain_node) {
46 - if (iter->funcs->post_disable)
47 - iter->funcs->post_disable(iter);
48 - }
49 -
50 clk_disable_unprepare(dsi->pll_phy_clock);
51 clk_disable_unprepare(dsi->escape_clock);
52 clk_disable_unprepare(dsi->pixel_clock);
53 @@ -1118,12 +1103,6 @@ static void vc4_dsi_encoder_enable(struc
54 struct vc4_dsi_encoder *vc4_encoder = to_vc4_dsi_encoder(encoder);
55 struct vc4_dsi *dsi = vc4_encoder->dsi;
56 bool debug_dump_regs = false;
57 - struct drm_bridge *iter;
58 -
59 - list_for_each_entry_reverse(iter, &dsi->bridge_chain, chain_node) {
60 - if (iter->funcs->pre_enable)
61 - iter->funcs->pre_enable(iter);
62 - }
63
64 if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO) {
65 DSI_PORT_WRITE(DISP0_CTRL,
66 @@ -1140,11 +1119,6 @@ static void vc4_dsi_encoder_enable(struc
67 DSI_DISP0_ENABLE);
68 }
69
70 - list_for_each_entry(iter, &dsi->bridge_chain, chain_node) {
71 - if (iter->funcs->enable)
72 - iter->funcs->enable(iter);
73 - }
74 -
75 if (debug_dump_regs) {
76 struct drm_printer p = drm_info_printer(&dsi->pdev->dev);
77 dev_info(&dsi->pdev->dev, "DSI regs after:\n");
78 @@ -1588,7 +1562,6 @@ static int vc4_dsi_bind(struct device *d
79 if (!vc4_dsi_encoder)
80 return -ENOMEM;
81
82 - INIT_LIST_HEAD(&dsi->bridge_chain);
83 vc4_dsi_encoder->base.type = dsi->variant->port ?
84 VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
85 vc4_dsi_encoder->dsi = dsi;
86 @@ -1717,12 +1690,6 @@ static int vc4_dsi_bind(struct device *d
87 ret = drm_bridge_attach(dsi->encoder, dsi->out_bridge, NULL, 0);
88 if (ret)
89 return ret;
90 - /* Disable the atomic helper calls into the bridge. We
91 - * manually call the bridge pre_enable / enable / etc. calls
92 - * from our driver, since we need to sequence them within the
93 - * encoder's enable/disable paths.
94 - */
95 - list_splice_init(&dsi->encoder->bridge_chain, &dsi->bridge_chain);
96
97 vc4_debugfs_add_regset32(drm, dsi->variant->debugfs_name, &dsi->regset);
98
99 @@ -1738,11 +1705,6 @@ static void vc4_dsi_unbind(struct device
100
101 pm_runtime_disable(dev);
102
103 - /*
104 - * Restore the bridge_chain so the bridge detach procedure can happen
105 - * normally.
106 - */
107 - list_splice_init(&dsi->bridge_chain, &dsi->encoder->bridge_chain);
108 drm_encoder_cleanup(dsi->encoder);
109 }
110