aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-07-29 04:08:17 -0400
committerThierry Reding <treding@nvidia.com>2015-08-13 07:48:54 -0400
commit32c3dee11e8e8ff790a8724c1bfe87a51976d7f8 (patch)
treeb585f78f3c6a21d4c7ad207f74b4ca63f6260702
parent530239a8b82c0d051ccda341cb346d3f11a80e70 (diff)
drm/tegra: rgb: Restore DPMS
In order to restore DPMS with atomic mode-setting, move all code from the ->mode_set() callback into ->enable(). At the same time, rename the ->prepare() callback to ->disable() to use the names preferred by atomic mode-setting. This simplifies the calling sequence and will allow DPMS code to use runtime PM in subsequent patches. While at it, remove the enabled field that hasn't been used since the demidlayering of the output drivers done in preparation for the atomic mode-setting conversion. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/rgb.c49
1 files changed, 13 insertions, 36 deletions
diff --git a/drivers/gpu/drm/tegra/rgb.c b/drivers/gpu/drm/tegra/rgb.c
index 7cd833f5b5b5..bc9735b4ad60 100644
--- a/drivers/gpu/drm/tegra/rgb.c
+++ b/drivers/gpu/drm/tegra/rgb.c
@@ -18,7 +18,6 @@
18struct tegra_rgb { 18struct tegra_rgb {
19 struct tegra_output output; 19 struct tegra_output output;
20 struct tegra_dc *dc; 20 struct tegra_dc *dc;
21 bool enabled;
22 21
23 struct clk *clk_parent; 22 struct clk *clk_parent;
24 struct clk *clk; 23 struct clk *clk;
@@ -88,13 +87,8 @@ static void tegra_dc_write_regs(struct tegra_dc *dc,
88 tegra_dc_writel(dc, table[i].value, table[i].offset); 87 tegra_dc_writel(dc, table[i].value, table[i].offset);
89} 88}
90 89
91static void tegra_rgb_connector_dpms(struct drm_connector *connector,
92 int mode)
93{
94}
95
96static const struct drm_connector_funcs tegra_rgb_connector_funcs = { 90static const struct drm_connector_funcs tegra_rgb_connector_funcs = {
97 .dpms = tegra_rgb_connector_dpms, 91 .dpms = drm_atomic_helper_connector_dpms,
98 .reset = drm_atomic_helper_connector_reset, 92 .reset = drm_atomic_helper_connector_reset,
99 .detect = tegra_output_connector_detect, 93 .detect = tegra_output_connector_detect,
100 .fill_modes = drm_helper_probe_single_connector_modes, 94 .fill_modes = drm_helper_probe_single_connector_modes,
@@ -125,21 +119,22 @@ static const struct drm_encoder_funcs tegra_rgb_encoder_funcs = {
125 .destroy = tegra_output_encoder_destroy, 119 .destroy = tegra_output_encoder_destroy,
126}; 120};
127 121
128static void tegra_rgb_encoder_dpms(struct drm_encoder *encoder, int mode) 122static void tegra_rgb_encoder_disable(struct drm_encoder *encoder)
129{ 123{
130} 124 struct tegra_output *output = encoder_to_output(encoder);
125 struct tegra_rgb *rgb = to_rgb(output);
131 126
132static void tegra_rgb_encoder_prepare(struct drm_encoder *encoder) 127 if (output->panel)
133{ 128 drm_panel_disable(output->panel);
134}
135 129
136static void tegra_rgb_encoder_commit(struct drm_encoder *encoder) 130 tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable));
137{ 131 tegra_dc_commit(rgb->dc);
132
133 if (output->panel)
134 drm_panel_unprepare(output->panel);
138} 135}
139 136
140static void tegra_rgb_encoder_mode_set(struct drm_encoder *encoder, 137static void tegra_rgb_encoder_enable(struct drm_encoder *encoder)
141 struct drm_display_mode *mode,
142 struct drm_display_mode *adjusted)
143{ 138{
144 struct tegra_output *output = encoder_to_output(encoder); 139 struct tegra_output *output = encoder_to_output(encoder);
145 struct tegra_rgb *rgb = to_rgb(output); 140 struct tegra_rgb *rgb = to_rgb(output);
@@ -174,21 +169,6 @@ static void tegra_rgb_encoder_mode_set(struct drm_encoder *encoder,
174 drm_panel_enable(output->panel); 169 drm_panel_enable(output->panel);
175} 170}
176 171
177static void tegra_rgb_encoder_disable(struct drm_encoder *encoder)
178{
179 struct tegra_output *output = encoder_to_output(encoder);
180 struct tegra_rgb *rgb = to_rgb(output);
181
182 if (output->panel)
183 drm_panel_disable(output->panel);
184
185 tegra_dc_write_regs(rgb->dc, rgb_disable, ARRAY_SIZE(rgb_disable));
186 tegra_dc_commit(rgb->dc);
187
188 if (output->panel)
189 drm_panel_unprepare(output->panel);
190}
191
192static int 172static int
193tegra_rgb_encoder_atomic_check(struct drm_encoder *encoder, 173tegra_rgb_encoder_atomic_check(struct drm_encoder *encoder,
194 struct drm_crtc_state *crtc_state, 174 struct drm_crtc_state *crtc_state,
@@ -231,11 +211,8 @@ tegra_rgb_encoder_atomic_check(struct drm_encoder *encoder,
231} 211}
232 212
233static const struct drm_encoder_helper_funcs tegra_rgb_encoder_helper_funcs = { 213static const struct drm_encoder_helper_funcs tegra_rgb_encoder_helper_funcs = {
234 .dpms = tegra_rgb_encoder_dpms,
235 .prepare = tegra_rgb_encoder_prepare,
236 .commit = tegra_rgb_encoder_commit,
237 .mode_set = tegra_rgb_encoder_mode_set,
238 .disable = tegra_rgb_encoder_disable, 214 .disable = tegra_rgb_encoder_disable,
215 .enable = tegra_rgb_encoder_enable,
239 .atomic_check = tegra_rgb_encoder_atomic_check, 216 .atomic_check = tegra_rgb_encoder_atomic_check,
240}; 217};
241 218