7718e3be81036d0d5116cbf3d720716ba42631ae
[openwrt/staging/ansuel.git] /
1 From bd58cbe5c5155279ccd85c29ddef53094cf6dc81 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 | 47 -----------------------------------
17 1 file changed, 47 deletions(-)
18
19 --- a/drivers/gpu/drm/vc4/vc4_dsi.c
20 +++ b/drivers/gpu/drm/vc4/vc4_dsi.c
21 @@ -557,7 +557,6 @@ struct vc4_dsi {
22 struct platform_device *pdev;
23
24 struct drm_bridge *out_bridge;
25 - struct list_head bridge_chain;
26
27 void __iomem *regs;
28
29 @@ -794,23 +793,9 @@ static void vc4_dsi_encoder_disable(stru
30 {
31 struct vc4_dsi *dsi = to_vc4_dsi(encoder);
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 @@ -1112,12 +1097,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 @@ -1134,11 +1113,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 @@ -1626,7 +1600,6 @@ static int vc4_dsi_bind(struct device *d
79
80 dsi->variant = of_device_get_match_data(dev);
81
82 - INIT_LIST_HEAD(&dsi->bridge_chain);
83 dsi->encoder.type = dsi->variant->port ?
84 VC4_ENCODER_TYPE_DSI1 : VC4_ENCODER_TYPE_DSI0;
85
86 @@ -1763,32 +1736,12 @@ static int vc4_dsi_bind(struct device *d
87 ret = drm_bridge_attach(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(&encoder->bridge_chain, &dsi->bridge_chain);
96
97 return 0;
98 }
99
100 -static void vc4_dsi_unbind(struct device *dev, struct device *master,
101 - void *data)
102 -{
103 - struct vc4_dsi *dsi = dev_get_drvdata(dev);
104 - struct drm_encoder *encoder = &dsi->encoder.base;
105 -
106 - /*
107 - * Restore the bridge_chain so the bridge detach procedure can happen
108 - * normally.
109 - */
110 - list_splice_init(&dsi->bridge_chain, &encoder->bridge_chain);
111 -}
112 -
113 static const struct component_ops vc4_dsi_ops = {
114 .bind = vc4_dsi_bind,
115 - .unbind = vc4_dsi_unbind,
116 };
117
118 static int vc4_dsi_dev_probe(struct platform_device *pdev)