aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_drv.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-09-12 19:34:29 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2019-03-18 05:42:12 -0400
commitde9225a9bda1b07e11e02a0228a55c5df9fdc9dd (patch)
treefdf3015342c1c49cfe16b36ec5151e1b0c3bac39 /drivers/gpu/drm/omapdrm/omap_drv.c
parent79d11e96e397e1d70b23ac2174d0aba5d8e73b9e (diff)
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 <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_drv.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_drv.c9
1 files changed, 7 insertions, 2 deletions
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)
155 const struct omap_drm_pipeline *pipe1 = a; 155 const struct omap_drm_pipeline *pipe1 = a;
156 const struct omap_drm_pipeline *pipe2 = b; 156 const struct omap_drm_pipeline *pipe2 = b;
157 157
158 if (pipe1->display->alias_id > pipe2->display->alias_id) 158 if (pipe1->alias_id > pipe2->alias_id)
159 return 1; 159 return 1;
160 else if (pipe1->display->alias_id < pipe2->display->alias_id) 160 else if (pipe1->alias_id < pipe2->alias_id)
161 return -1; 161 return -1;
162 return 0; 162 return 0;
163} 163}
@@ -182,11 +182,16 @@ static int omap_connect_pipelines(struct drm_device *ddev)
182 output->name); 182 output->name);
183 } else { 183 } else {
184 struct omap_drm_pipeline *pipe; 184 struct omap_drm_pipeline *pipe;
185 int id;
185 186
186 pipe = &priv->pipes[priv->num_pipes++]; 187 pipe = &priv->pipes[priv->num_pipes++];
187 pipe->output = omapdss_device_get(output); 188 pipe->output = omapdss_device_get(output);
188 pipe->display = omapdss_display_get(output); 189 pipe->display = omapdss_display_get(output);
189 190
191 id = of_alias_get_id(pipe->display->dev->of_node,
192 "display");
193 pipe->alias_id = id >= 0 ? id : priv->num_pipes - 1;
194
190 if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) { 195 if (priv->num_pipes == ARRAY_SIZE(priv->pipes)) {
191 /* To balance the 'for_each_dss_output' loop */ 196 /* To balance the 'for_each_dss_output' loop */
192 omapdss_device_put(output); 197 omapdss_device_put(output);