]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/omap: dss: Merge two disconnection helpers
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 5 Mar 2018 23:51:31 +0000 (01:51 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Sep 2018 13:13:28 +0000 (16:13 +0300)
To simplify the pipeline disconnection handling merge the
omapdss_device_disconnect() and omapdss_output_unset_device() functions.
The device state check is now called for every device in the pipeline,
extending this sanity check coverage.

There is no need to return an error from omapdss_device_disconnect()
when the check fails, as omapdss_output_unset_device() used to do, given
that we can't prevent disconnection due to device unbinding (the return
value of omapdss_output_unset_device() is never checked in the current
code for that reason).

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
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

index 02c6ed97d63238bcaf3542064272f73913f5055a..89472715ee8f04a8ec8ad09eddcdf321d4a5203e 100644 (file)
@@ -235,6 +235,8 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
                src->dst = NULL;
        }
 
+       WARN_ON(dst->state != OMAP_DSS_DISPLAY_DISABLED);
+
        if (dst->driver)
                dst->driver->disconnect(src, dst);
        else
index eeeea936f889c0ebb46128719f979685c6857b27..178b463c2d60dadf556c72801ea576935fc545f4 100644 (file)
@@ -633,7 +633,6 @@ static void dpi_disconnect(struct omap_dss_device *src,
                           struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }
index 9c617e35efd1f7fdfb43edf6308a415c754ef83a..948e3b8735234104080c8f78a9e3343963bffcc0 100644 (file)
@@ -4903,7 +4903,6 @@ static void dsi_disconnect(struct omap_dss_device *src,
                           struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }
index 22f8b74f5bf5dd86f77985d9085810d339e4101c..6616530d5fe685bf1238ec79fcc1f9fa20d53547 100644 (file)
@@ -450,7 +450,6 @@ static void hdmi_disconnect(struct omap_dss_device *src,
                            struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }
index d8592d02a58d4f317115676e1c0330d7f6627642..f7e15edc05fc8c9b254f7575dce3ce515e3a7f3f 100644 (file)
@@ -455,7 +455,6 @@ static void hdmi_disconnect(struct omap_dss_device *src,
                            struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }
index 600ac7c2572442b1ffe931546f36f10ec0cde5e8..8f9538e17ea40ecb4b4ddbc375d5cd43b18e56db 100644 (file)
@@ -522,7 +522,6 @@ int omap_dss_get_num_overlays(void);
 #define for_each_dss_output(d) \
        while ((d = omapdss_device_get_next(d, OMAP_DSS_DEVICE_TYPE_OUTPUT)) != NULL)
 int omapdss_output_validate(struct omap_dss_device *out);
-int omapdss_output_unset_device(struct omap_dss_device *out);
 
 typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
 int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
index be544dd48bf4c9fc031a65ee4c8c5de65305afa6..2da480be918d311126ff28bb649dbc03a73735c8 100644 (file)
@@ -24,8 +24,6 @@
 #include "dss.h"
 #include "omapdss.h"
 
-static DEFINE_MUTEX(output_lock);
-
 int omapdss_output_validate(struct omap_dss_device *out)
 {
        if (out->next && out->output_type != out->next->type) {
@@ -37,25 +35,6 @@ int omapdss_output_validate(struct omap_dss_device *out)
 }
 EXPORT_SYMBOL(omapdss_output_validate);
 
-int omapdss_output_unset_device(struct omap_dss_device *out)
-{
-       int r = 0;
-
-       mutex_lock(&output_lock);
-
-       if (out->dst->state != OMAP_DSS_DISPLAY_DISABLED) {
-               dev_err(out->dev,
-                       "device %s is not disabled, cannot unset device\n",
-                       out->dst->name);
-               r = -EINVAL;
-       }
-
-       mutex_unlock(&output_lock);
-
-       return r;
-}
-EXPORT_SYMBOL(omapdss_output_unset_device);
-
 int dss_install_mgr_ops(struct dss_device *dss,
                        const struct dss_mgr_ops *mgr_ops,
                        struct omap_drm_private *priv)
index 2101a697a08ad12c618ab46c02b6a8da79d80f20..764299cafbe2d7d42a5d9c7b911d8b38fd116acd 100644 (file)
@@ -274,7 +274,6 @@ static void sdi_disconnect(struct omap_dss_device *src,
                           struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }
index e673f3e78c6910c85a86b53fb03db78a70db7099..c2811c42519533046885a96606e9be1735aa209b 100644 (file)
@@ -713,7 +713,6 @@ static void venc_disconnect(struct omap_dss_device *src,
                            struct omap_dss_device *dst)
 {
        omapdss_device_disconnect(dst, dst->next);
-       omapdss_output_unset_device(dst);
 
        dss_mgr_disconnect(dst);
 }