From de9225a9bda1b07e11e02a0228a55c5df9fdc9dd Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 13 Sep 2018 02:34:29 +0300 Subject: drm/omap: Move display alias ID to omap_drm_pipeline The DT bindings for the OMAP DSS allow assigning numerical IDs to display outputs through display entries in the alias node. The driver uses this information to sort pipelines according to the order specified in DT, making it possible for a system to give a priority order to outputs. Retrieval of the alias ID is done when initializing display dss devices. That code will be removed when moving to drm_bridge and drm_panel. Move retrieval of the alias ID to display pipeline connection time and store it in the pipeline structure instead to keep the feature. Signed-off-by: Laurent Pinchart Reviewed-by: Sebastian Reichel Tested-by: Sebastian Reichel Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/drm/omapdrm/omap_drv.c') diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 3b8f0fdf24a8..008eec6356fd 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -155,9 +155,9 @@ static int omap_compare_pipes(const void *a, const void *b) const struct omap_drm_pipeline *pipe1 = a; const struct omap_drm_pipeline *pipe2 = b; - if (pipe1->display->alias_id > pipe2->display->alias_id) + if (pipe1->alias_id > pipe2->alias_id) return 1; - else if (pipe1->display->alias_id < pipe2->display->alias_id) + else if (pipe1->alias_id < pipe2->alias_id) return -1; return 0; } @@ -182,11 +182,16 @@ static int omap_connect_pipelines(struct drm_device *ddev) output->name); } else { struct omap_drm_pipeline *pipe; + int id; pipe = &priv->pipes[priv->num_pipes++]; pipe->output = omapdss_device_get(output); pipe->display = omapdss_display_get(output); + id = of_alias_get_id(pipe->display->dev->of_node, + "display"); + pipe->alias_id = id >= 0 ? id : priv->num_pipes - 1; + if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { /* To balance the 'for_each_dss_output' loop */ omapdss_device_put(output); -- cgit v1.2.3-70-g09d2