]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/omap: Move display alias ID to omap_drm_pipeline
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 12 Sep 2018 23:34:29 +0000 (02:34 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 18 Mar 2019 09:42:12 +0000 (11:42 +0200)
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>
drivers/gpu/drm/omapdrm/dss/display.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/omapdrm/omap_drv.h

index 398964358386f59cd34c75810de3697c5ee8775b..e93f61a567a81029010799bbfdaab096f71c044d 100644 (file)
@@ -42,8 +42,6 @@ void omapdss_display_init(struct omap_dss_device *dssdev)
        if (id < 0)
                id = disp_num_counter++;
 
-       dssdev->alias_id = id;
-
        /* Use 'label' property for name, if it exists */
        of_property_read_string(dssdev->dev->of_node, "label", &dssdev->name);
 
index 01da7e94b9749b2ed51093338e862469450141b7..dd93c2121a355b6a91603bbe40618632a34127bb 100644 (file)
@@ -414,8 +414,6 @@ struct omap_dss_device {
 
        struct list_head list;
 
-       unsigned int alias_id;
-
        enum omap_display_type type;
        /*
         * DSS output type that this device generates (for DSS internal devices)
index 3b8f0fdf24a8af9cca5e8b14533a4fea3da88241..008eec6356fdd8b06120fad457049587b4475529 100644 (file)
@@ -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);
index 0c57d2814c517667a2350912b9e4eba4dfb51f51..ebff86595167ba58affe070aa11bb8d638661359 100644 (file)
@@ -50,6 +50,7 @@ struct omap_drm_pipeline {
        struct drm_connector *connector;
        struct omap_dss_device *output;
        struct omap_dss_device *display;
+       unsigned int alias_id;
 };
 
 struct omap_drm_private {