diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2018-03-04 23:42:36 +0200 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2018-09-03 16:13:27 +0300 |
commit | 511afb44d72aa7b6b871fa71f829afaaa27e84f0 (patch) | |
tree | e5c3c1fced5108a88c1bd06e0f3b98a6aa082e94 /drivers/gpu/drm/omapdrm/omap_drv.c | |
parent | 2ee767922e1bc7ede9ceb7aed9a14141480836a7 (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.c | 35 |
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) unsigned int i; for (i = 0; i < priv->num_pipes; i++) { - struct omap_dss_device *display = priv->pipes[i].display; + struct omap_drm_pipeline *pipe = &priv->pipes[i]; + + omapdss_device_disconnect(NULL, pipe->output); - omapdss_device_disconnect(display, NULL); - priv->pipes[i].display = NULL; - omapdss_device_put(display); + omapdss_device_put(pipe->output); + omapdss_device_put(pipe->display); + pipe->output = NULL; + pipe->display = NULL; } priv->num_pipes = 0; @@ -182,26 +185,30 @@ static int omap_compare_pipes(const void *a, const void *b) static int omap_connect_pipelines(struct drm_device *ddev) { struct omap_drm_private *priv = ddev->dev_private; - struct omap_dss_device *display = NULL; + struct omap_dss_device *output = NULL; int r; if (!omapdss_stack_is_ready()) return -EPROBE_DEFER; - for_each_dss_display(display) { - r = omapdss_device_connect(priv->dss, display, NULL); + for_each_dss_output(output) { + r = omapdss_device_connect(priv->dss, NULL, output); if (r == -EPROBE_DEFER) { - omapdss_device_put(display); + omapdss_device_put(output); goto cleanup; } else if (r) { - dev_warn(display->dev, "could not connect display: %s\n", - display->name); + dev_warn(output->dev, "could not connect output %s\n", + output->name); } else { - omapdss_device_get(display); - priv->pipes[priv->num_pipes++].display = display; + struct omap_drm_pipeline *pipe; + + pipe = &priv->pipes[priv->num_pipes++]; + pipe->output = omapdss_device_get(output); + pipe->display = omapdss_display_get(output); + if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { - /* To balance the 'for_each_dss_display' loop */ - omapdss_device_put(display); + /* To balance the 'for_each_dss_output' loop */ + omapdss_device_put(output); break; } } |