aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_encoder.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-08-24 12:38:07 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:12 -0400
commit19b4200d8f4b90b5a41592f9021b52153ac2b6b5 (patch)
tree81ced875a59f6ca14bc19d7cc9ff1b207eb82f7a /drivers/gpu/drm/omapdrm/omap_encoder.c
parent3f3623dd0f881dd5615097fdc9eeeb1ec732e59a (diff)
drm/omap: Reverse direction of the DSS device enable/disable operations
The omapdrm and omapdss drivers are architectured based on display pipelines made of multiple components handled from sink (display) to source (DSS output). This is incompatible with the DRM bridge and panel APIs that handle components from source to sink. Reconcile the omapdrm and omapdss drivers with the DRM bridge and panel model by reversing the direction of the DSS device .enable() and .disable() operations. This completes the move to the DRM bridge model, with the notable exception of the DSI pipelines that will require more work. We also adapt the omapdss shutdown handler dss_shutdown() to shut down all active pipelines starting from the pipeline output device instead of the display device. As a consequence the for_each_dss_display() macro isn't used and can be removed, and the omapdss_device_get_next() function underlying the macro can be simplified to search for output devices only. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_encoder.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_encoder.c49
1 files changed, 38 insertions, 11 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index d14d465392dd..acdfd2176423 100644
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
@@ -146,33 +146,60 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
146static void omap_encoder_disable(struct drm_encoder *encoder) 146static void omap_encoder_disable(struct drm_encoder *encoder)
147{ 147{
148 struct omap_encoder *omap_encoder = to_omap_encoder(encoder); 148 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
149 struct omap_dss_device *dssdev = omap_encoder->display; 149 struct omap_dss_device *dssdev = omap_encoder->output;
150 struct drm_device *dev = encoder->dev; 150 struct drm_device *dev = encoder->dev;
151 151
152 dev_dbg(dev->dev, "disable(%s)\n", dssdev->name); 152 dev_dbg(dev->dev, "disable(%s)\n", dssdev->name);
153 153
154 dssdev->ops->disable(dssdev); 154 /*
155 * Disable the chain of external devices, starting at the one at the
156 * internal encoder's output.
157 */
158 omapdss_device_disable(dssdev->next);
159
160 /*
161 * Disable the internal encoder. This will disable the DSS output. The
162 * DSI is treated as an exception as DSI pipelines still use the legacy
163 * flow where the pipeline output controls the encoder.
164 */
165 if (dssdev->output_type != OMAP_DISPLAY_TYPE_DSI) {
166 dssdev->ops->disable(dssdev);
167 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
168 }
155 169
156 dssdev->state = OMAP_DSS_DISPLAY_DISABLED; 170 /*
171 * Perform the post-disable operations on the chain of external devices
172 * to complete the display pipeline disable.
173 */
174 omapdss_device_post_disable(dssdev->next);
157} 175}
158 176
159static void omap_encoder_enable(struct drm_encoder *encoder) 177static void omap_encoder_enable(struct drm_encoder *encoder)
160{ 178{
161 struct omap_encoder *omap_encoder = to_omap_encoder(encoder); 179 struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
162 struct omap_dss_device *dssdev = omap_encoder->display; 180 struct omap_dss_device *dssdev = omap_encoder->output;
163 struct drm_device *dev = encoder->dev; 181 struct drm_device *dev = encoder->dev;
164 int r;
165 182
166 dev_dbg(dev->dev, "enable(%s)\n", dssdev->name); 183 dev_dbg(dev->dev, "enable(%s)\n", dssdev->name);
167 184
168 r = dssdev->ops->enable(dssdev); 185 /* Prepare the chain of external devices for pipeline enable. */
169 if (r) { 186 omapdss_device_pre_enable(dssdev->next);
170 dev_err(dev->dev, "Failed to enable display '%s': %d\n", 187
171 dssdev->name, r); 188 /*
172 return; 189 * Enable the internal encoder. This will enable the DSS output. The
190 * DSI is treated as an exception as DSI pipelines still use the legacy
191 * flow where the pipeline output controls the encoder.
192 */
193 if (dssdev->output_type != OMAP_DISPLAY_TYPE_DSI) {
194 dssdev->ops->enable(dssdev);
195 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
173 } 196 }
174 197
175 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE; 198 /*
199 * Enable the chain of external devices, starting at the one at the
200 * internal encoder's output.
201 */
202 omapdss_device_enable(dssdev->next);
176} 203}
177 204
178static int omap_encoder_atomic_check(struct drm_encoder *encoder, 205static int omap_encoder_atomic_check(struct drm_encoder *encoder,