aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-04 16:42:36 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 09:13:27 -0400
commit511afb44d72aa7b6b871fa71f829afaaa27e84f0 (patch)
treee5c3c1fced5108a88c1bd06e0f3b98a6aa082e94 /drivers/gpu/drm/omapdrm/omap_drv.c
parent2ee767922e1bc7ede9ceb7aed9a14141480836a7 (diff)
drm/omap: Reverse direction of DSS device (dis)connect 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. To reconcile the omapdrm and omapdss drivers with the DRM bridge and panel model, we need to reverse the direction of the DSS device operations. Start with the connect and disconnect operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c35
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index f10e5053580b..0052f151bf7a 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -157,11 +157,14 @@ static void omap_disconnect_pipelines(struct drm_device *ddev)
157 unsigned int i; 157 unsigned int i;
158 158
159 for (i = 0; i < priv->num_pipes; i++) { 159 for (i = 0; i < priv->num_pipes; i++) {
160 struct omap_dss_device *display = priv->pipes[i].display; 160 struct omap_drm_pipeline *pipe = &priv->pipes[i];
161
162 omapdss_device_disconnect(NULL, pipe->output);
161 163
162 omapdss_device_disconnect(display, NULL); 164 omapdss_device_put(pipe->output);
163 priv->pipes[i].display = NULL; 165 omapdss_device_put(pipe->display);
164 omapdss_device_put(display); 166 pipe->output = NULL;
167 pipe->display = NULL;
165 } 168 }
166 169
167 priv->num_pipes = 0; 170 priv->num_pipes = 0;
@@ -182,26 +185,30 @@ static int omap_compare_pipes(const void *a, const void *b)
182static int omap_connect_pipelines(struct drm_device *ddev) 185static int omap_connect_pipelines(struct drm_device *ddev)
183{ 186{
184 struct omap_drm_private *priv = ddev->dev_private; 187 struct omap_drm_private *priv = ddev->dev_private;
185 struct omap_dss_device *display = NULL; 188 struct omap_dss_device *output = NULL;
186 int r; 189 int r;
187 190
188 if (!omapdss_stack_is_ready()) 191 if (!omapdss_stack_is_ready())
189 return -EPROBE_DEFER; 192 return -EPROBE_DEFER;
190 193
191 for_each_dss_display(display) { 194 for_each_dss_output(output) {
192 r = omapdss_device_connect(priv->dss, display, NULL); 195 r = omapdss_device_connect(priv->dss, NULL, output);
193 if (r == -EPROBE_DEFER) { 196 if (r == -EPROBE_DEFER) {
194 omapdss_device_put(display); 197 omapdss_device_put(output);
195 goto cleanup; 198 goto cleanup;
196 } else if (r) { 199 } else if (r) {
197 dev_warn(display->dev, "could not connect display: %s\n", 200 dev_warn(output->dev, "could not connect output %s\n",
198 display->name); 201 output->name);
199 } else { 202 } else {
200 omapdss_device_get(display); 203 struct omap_drm_pipeline *pipe;
201 priv->pipes[priv->num_pipes++].display = display; 204
205 pipe = &priv->pipes[priv->num_pipes++];
206 pipe->output = omapdss_device_get(output);
207 pipe->display = omapdss_display_get(output);
208
202 if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { 209 if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) {
203 /* To balance the 'for_each_dss_display' loop */ 210 /* To balance the 'for_each_dss_output' loop */
204 omapdss_device_put(display); 211 omapdss_device_put(output);
205 break; 212 break;
206 } 213 }
207 } 214 }