]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/omap: Merge omap_dss_device type and output_type fields
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 10 Dec 2018 12:00:38 +0000 (14:00 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 18 Mar 2019 09:42:13 +0000 (11:42 +0200)
The omap_dss_device type and output_type fields differ mostly for
historical reasons. The output_type field is required for all devices
but the display at the end of the pipeline, and must be set to
OMAP_DISPLAY_TYPE_NONE for the latter. The type field is required for
all devices but the internal encoder, for which it is ignored.

The only reason why the output_type field must be set to
OMAP_DISPLAY_TYPE_NONE for the display at the end of the pipeline is to
identify omap_dss_device instances corresponding to displays. This is
not documented and confusing.

Clean the code by adding a new display field to the omap_dss_device
structure to identify displays, and merge the type and output_type
fields.

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>
25 files changed:
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c
drivers/gpu/drm/omapdrm/displays/connector-dvi.c
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
drivers/gpu/drm/omapdrm/displays/panel-dpi.c
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c
drivers/gpu/drm/omapdrm/dss/base.c
drivers/gpu/drm/omapdrm/dss/dpi.c
drivers/gpu/drm/omapdrm/dss/dsi.c
drivers/gpu/drm/omapdrm/dss/hdmi4.c
drivers/gpu/drm/omapdrm/dss/hdmi5.c
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/dss/output.c
drivers/gpu/drm/omapdrm/dss/sdi.c
drivers/gpu/drm/omapdrm/dss/venc.c
drivers/gpu/drm/omapdrm/omap_crtc.c
drivers/gpu/drm/omapdrm/omap_encoder.c

index 1503563117f3e2f35e40040df774653967df7590..6c056110187405cd9970834b3d849d7ec63fa239 100644 (file)
@@ -56,6 +56,7 @@ static int tvc_probe(struct platform_device *pdev)
        dssdev->ops = &tvc_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_VENC;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
 
index bf5ee50ce5feeda1b37bc2767b736c34046b0870..fa3a69bf8a04dff0cbce53c1beee80b40d5478bd 100644 (file)
@@ -239,6 +239,7 @@ static int dvic_probe(struct platform_device *pdev)
        dssdev->ops = &dvic_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_DVI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
 
index 797da4a3f22e48bea87ce4b38bb398405c44c37e..68d6f6e44b0363a65f14fc7fde42ef6206cf0edc 100644 (file)
@@ -140,6 +140,7 @@ static int hdmic_probe(struct platform_device *pdev)
        dssdev->ops = &hdmic_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = ddata->hpd_gpio
index fc5e0c47054d090c72ccd980599d8c05f392995d..29a5a130ebd121a934b7177cc75e523c724b8caf 100644 (file)
@@ -88,7 +88,6 @@ static int opa362_probe(struct platform_device *pdev)
        dssdev->ops = &opa362_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_VENC;
-       dssdev->output_type = OMAP_DISPLAY_TYPE_VENC;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(1) | BIT(0);
 
index 82035078377ab1fa849316da64c52bc5bab05058..fb88537de1ccd8918105a6ddc0e98b6d5f8f7b19 100644 (file)
@@ -84,7 +84,6 @@ static int tfp410_probe(struct platform_device *pdev)
        dssdev->ops = &tfp410_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
-       dssdev->output_type = OMAP_DISPLAY_TYPE_DVI;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(1) | BIT(0);
        dssdev->bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_SYNC_POSEDGE
index ced36718a95fc7707b2540831e2dc608b567620d..bc03752d27629332feea281ebadf718b6c1ce57f 100644 (file)
@@ -167,7 +167,6 @@ static int tpd_probe(struct platform_device *pdev)
        dssdev->ops = &tpd_ops;
        dssdev->dev = &pdev->dev;
        dssdev->type = OMAP_DISPLAY_TYPE_HDMI;
-       dssdev->output_type = OMAP_DISPLAY_TYPE_HDMI;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(1) | BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_DETECT
index 897b8820e000c1ef2de340627f760552faa3d133..389ae282122208e65cc948161756bb41769572e0 100644 (file)
@@ -150,6 +150,7 @@ static int panel_dpi_probe(struct platform_device *pdev)
        dssdev->dev = &pdev->dev;
        dssdev->ops = &panel_dpi_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index d9f10f41ddfb75bc07bd643ae87275c8dca56eb5..741a5e3247676e76f23f6b44b858e637b5cc6e71 100644 (file)
@@ -1272,6 +1272,7 @@ static int dsicm_probe(struct platform_device *pdev)
        dssdev->ops = &dsicm_ops;
        dssdev->driver = &dsicm_dss_driver;
        dssdev->type = OMAP_DISPLAY_TYPE_DSI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index f37931bf1c5ff513779bf4cc291342a29af3206c..4133351924bea1067c2928aa0398bc7576d0bab1 100644 (file)
@@ -197,6 +197,7 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi)
        dssdev->dev = &spi->dev;
        dssdev->ops = &lb035q02_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index 8f2fb3d0492fddaccd3434a3af6540c1598a4be9..498a88307f0489ac405c77e0f3e65e02cd5dcac7 100644 (file)
@@ -192,6 +192,7 @@ static int nec_8048_probe(struct spi_device *spi)
        dssdev->dev = &spi->dev;
        dssdev->ops = &nec_8048_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index 8d5d7f775b5553e41557bb732dda875bbb28b482..1e68e0d14f87a906e7811b92230238dc5461bc2a 100644 (file)
@@ -207,6 +207,7 @@ static int sharp_ls_probe(struct platform_device *pdev)
        dssdev->dev = &pdev->dev;
        dssdev->ops = &sharp_ls_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index b8360cef37549bb857f4c3740d44aa27d822260c..abee0b348cffff2a235cecf2ed80b1944857cc09 100644 (file)
@@ -706,6 +706,7 @@ static int acx565akm_probe(struct spi_device *spi)
        dssdev->dev = &spi->dev;
        dssdev->ops = &acx565akm_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_SDI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index 721c5bb3bdefe7aa988597a0f998fa2338d76989..5b4fbcc196bc72abbc3a71c4611765fbd53a7e24 100644 (file)
@@ -321,6 +321,7 @@ static int td028ttec1_panel_probe(struct spi_device *spi)
        dssdev->dev = &spi->dev;
        dssdev->ops = &td028ttec1_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index 50960018dbe8bffbc78d4a1d2c1cf495a9f58b4b..781dc8b0afe7c5b61d924ca7223741deebfe7ad5 100644 (file)
@@ -420,6 +420,7 @@ static int tpo_td043_probe(struct spi_device *spi)
        dssdev->dev = &spi->dev;
        dssdev->ops = &tpo_td043_ops;
        dssdev->type = OMAP_DISPLAY_TYPE_DPI;
+       dssdev->display = true;
        dssdev->owner = THIS_MODULE;
        dssdev->of_ports = BIT(0);
        dssdev->ops_flags = OMAP_DSS_DEVICE_OP_MODES;
index d14abde3c5f07058c561b0293026dabebe03d884..81ea0f55cd75bc93cba231b27abc4b09df9df561 100644 (file)
@@ -207,7 +207,7 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
        dev_dbg(dst->dev, "disconnect\n");
 
        if (!dst->id && !omapdss_device_is_connected(dst)) {
-               WARN_ON(dst->output_type);
+               WARN_ON(!dst->display);
                return;
        }
 
index 295bc3eeea8070f628b758b763d8c70b79741a53..cc78dfa07f04abbbfc021cc845269c3d90aae6c7 100644 (file)
@@ -634,7 +634,7 @@ static int dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
 
        out->dev = &dpi->pdev->dev;
        out->id = OMAP_DSS_OUTPUT_DPI;
-       out->output_type = OMAP_DISPLAY_TYPE_DPI;
+       out->type = OMAP_DISPLAY_TYPE_DPI;
        out->dispc_channel = dpi_get_channel(dpi);
        out->of_ports = BIT(port_num);
        out->ops = &dpi_ops;
index 4ac325e664b5fb17d776d16ab4c20427447a57b3..2582b566e0b02fc16737def9004b8e02e573eec3 100644 (file)
@@ -5121,7 +5121,7 @@ static int dsi_init_output(struct dsi_data *dsi)
        out->id = dsi->module_id == 0 ?
                        OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
 
-       out->output_type = OMAP_DISPLAY_TYPE_DSI;
+       out->type = OMAP_DISPLAY_TYPE_DSI;
        out->name = dsi->module_id == 0 ? "dsi.0" : "dsi.1";
        out->dispc_channel = dsi_get_channel(dsi);
        out->ops = &dsi_ops;
index 4337380b1bf7122c77cb58f588fb0ea1de633471..6339e2756b341e457e8aaf55dcdac9f333082079 100644 (file)
@@ -679,7 +679,7 @@ static int hdmi4_init_output(struct omap_hdmi *hdmi)
 
        out->dev = &hdmi->pdev->dev;
        out->id = OMAP_DSS_OUTPUT_HDMI;
-       out->output_type = OMAP_DISPLAY_TYPE_HDMI;
+       out->type = OMAP_DISPLAY_TYPE_HDMI;
        out->name = "hdmi.0";
        out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
        out->ops = &hdmi_ops;
index b94f884c5c1a05dca54d74230df709eff6bfaf71..2955bbad13bb99db8cd08a757c9e5911b92e0db2 100644 (file)
@@ -663,7 +663,7 @@ static int hdmi5_init_output(struct omap_hdmi *hdmi)
 
        out->dev = &hdmi->pdev->dev;
        out->id = OMAP_DSS_OUTPUT_HDMI;
-       out->output_type = OMAP_DISPLAY_TYPE_HDMI;
+       out->type = OMAP_DISPLAY_TYPE_HDMI;
        out->name = "hdmi.0";
        out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
        out->ops = &hdmi_ops;
index d13a6b5774e84805592b1a655ad9344fae4464f3..ab5467a1e92c6ee2db7ec4ce81224e208759fd09 100644 (file)
@@ -413,14 +413,18 @@ struct omap_dss_device {
 
        struct list_head list;
 
+       /*
+        * DSS type that this device generates (for DSS internal devices) or
+        * requires (for external encoders, connectors and panels). Must be a
+        * non-zero (different than OMAP_DISPLAY_TYPE_NONE) value.
+        */
        enum omap_display_type type;
+
        /*
-        * DSS output type that this device generates (for DSS internal devices)
-        * or requires (for external encoders). Must be OMAP_DISPLAY_TYPE_NONE
-        * for display devices (connectors and panels) and to non-zero value for
-        * all other devices.
+        * True if the device is a display (panel or connector) at the end of
+        * the pipeline, false otherwise.
         */
-       enum omap_display_type output_type;
+       bool display;
 
        const char *name;
 
index 0ac400a521f33be1cda6eaec16e92ec5cdc3bfae..f25ecfd26534d0a1ad57c92853ac3441a6006a0b 100644 (file)
@@ -33,7 +33,7 @@ int omapdss_device_init_output(struct omap_dss_device *out)
                return PTR_ERR(out->next);
        }
 
-       if (out->next && out->output_type != out->next->type) {
+       if (out->next && out->type != out->next->type) {
                dev_err(out->dev, "output type and display type don't match\n");
                return -EINVAL;
        }
index 38b0bf19538d128c63c9f0e6885b738cf3742896..e7945322c47122985fc040f22f4db79af4269869 100644 (file)
@@ -272,7 +272,7 @@ static int sdi_init_output(struct sdi_device *sdi)
 
        out->dev = &sdi->pdev->dev;
        out->id = OMAP_DSS_OUTPUT_SDI;
-       out->output_type = OMAP_DISPLAY_TYPE_SDI;
+       out->type = OMAP_DISPLAY_TYPE_SDI;
        out->name = "sdi.0";
        out->dispc_channel = OMAP_DSS_CHANNEL_LCD;
        /* We have SDI only on OMAP3, where it's on port 1 */
index f2cbecfd05b534e5e752fbb51e4a886f9e285ffd..da43b865d9738a1aa9fe5a9b4bd84777f0497673 100644 (file)
@@ -760,7 +760,7 @@ static int venc_init_output(struct venc_device *venc)
 
        out->dev = &venc->pdev->dev;
        out->id = OMAP_DSS_OUTPUT_VENC;
-       out->output_type = OMAP_DISPLAY_TYPE_VENC;
+       out->type = OMAP_DISPLAY_TYPE_VENC;
        out->name = "venc.0";
        out->dispc_channel = OMAP_DSS_CHANNEL_DIGIT;
        out->ops = &venc_ops;
index ae399435346b46725b44f4d0c06002c0017e2db6..1353aec73611da907adc9de3504d134322104117 100644 (file)
@@ -128,7 +128,7 @@ static void omap_crtc_set_enabled(struct drm_crtc *crtc, bool enable)
        if (WARN_ON(omap_crtc->enabled == enable))
                return;
 
-       if (omap_crtc->pipe->output->output_type == OMAP_DISPLAY_TYPE_HDMI) {
+       if (omap_crtc->pipe->output->type == OMAP_DISPLAY_TYPE_HDMI) {
                priv->dispc_ops->mgr_enable(priv->dispc, channel, enable);
                omap_crtc->enabled = enable;
                return;
index 367234de5dc78dffa958f3cd29657ad8955c2c5f..42748479d3745803628708762509e624e1d2fc96 100644 (file)
@@ -138,7 +138,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
        }
 
        /* Set the HDMI mode and HDMI infoframe if applicable. */
-       if (omap_encoder->output->output_type == OMAP_DISPLAY_TYPE_HDMI)
+       if (omap_encoder->output->type == OMAP_DISPLAY_TYPE_HDMI)
                omap_encoder_hdmi_mode_set(encoder, adjusted_mode);
 }
 
@@ -161,7 +161,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder)
         * DSI is treated as an exception as DSI pipelines still use the legacy
         * flow where the pipeline output controls the encoder.
         */
-       if (dssdev->output_type != OMAP_DISPLAY_TYPE_DSI) {
+       if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
                dssdev->ops->disable(dssdev);
                dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
        }
@@ -189,7 +189,7 @@ static void omap_encoder_enable(struct drm_encoder *encoder)
         * DSI is treated as an exception as DSI pipelines still use the legacy
         * flow where the pipeline output controls the encoder.
         */
-       if (dssdev->output_type != OMAP_DISPLAY_TYPE_DSI) {
+       if (dssdev->type != OMAP_DISPLAY_TYPE_DSI) {
                dssdev->ops->enable(dssdev);
                dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
        }