aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-05 18:51:31 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 09:13:28 -0400
commit3be0f15bd6e94aa17a571020704bde413342e8eb (patch)
treed27d8aa2349085f57af46620dda266f386dba2f6
parent713165561b7e372cd21f34bfeb82188361569f74 (diff)
drm/omap: dss: Merge two disconnection helpers
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>
-rw-r--r--drivers/gpu/drm/omapdrm/dss/base.c2
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dpi.c1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi4.c1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi5.c1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/omapdss.h1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/output.c21
-rw-r--r--drivers/gpu/drm/omapdrm/dss/sdi.c1
-rw-r--r--drivers/gpu/drm/omapdrm/dss/venc.c1
9 files changed, 2 insertions, 28 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 02c6ed97d632..89472715ee8f 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -235,6 +235,8 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
235 src->dst = NULL; 235 src->dst = NULL;
236 } 236 }
237 237
238 WARN_ON(dst->state != OMAP_DSS_DISPLAY_DISABLED);
239
238 if (dst->driver) 240 if (dst->driver)
239 dst->driver->disconnect(src, dst); 241 dst->driver->disconnect(src, dst);
240 else 242 else
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index eeeea936f889..178b463c2d60 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -633,7 +633,6 @@ static void dpi_disconnect(struct omap_dss_device *src,
633 struct omap_dss_device *dst) 633 struct omap_dss_device *dst)
634{ 634{
635 omapdss_device_disconnect(dst, dst->next); 635 omapdss_device_disconnect(dst, dst->next);
636 omapdss_output_unset_device(dst);
637 636
638 dss_mgr_disconnect(dst); 637 dss_mgr_disconnect(dst);
639} 638}
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 9c617e35efd1..948e3b873523 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4903,7 +4903,6 @@ static void dsi_disconnect(struct omap_dss_device *src,
4903 struct omap_dss_device *dst) 4903 struct omap_dss_device *dst)
4904{ 4904{
4905 omapdss_device_disconnect(dst, dst->next); 4905 omapdss_device_disconnect(dst, dst->next);
4906 omapdss_output_unset_device(dst);
4907 4906
4908 dss_mgr_disconnect(dst); 4907 dss_mgr_disconnect(dst);
4909} 4908}
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 22f8b74f5bf5..6616530d5fe6 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -450,7 +450,6 @@ static void hdmi_disconnect(struct omap_dss_device *src,
450 struct omap_dss_device *dst) 450 struct omap_dss_device *dst)
451{ 451{
452 omapdss_device_disconnect(dst, dst->next); 452 omapdss_device_disconnect(dst, dst->next);
453 omapdss_output_unset_device(dst);
454 453
455 dss_mgr_disconnect(dst); 454 dss_mgr_disconnect(dst);
456} 455}
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index d8592d02a58d..f7e15edc05fc 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -455,7 +455,6 @@ static void hdmi_disconnect(struct omap_dss_device *src,
455 struct omap_dss_device *dst) 455 struct omap_dss_device *dst)
456{ 456{
457 omapdss_device_disconnect(dst, dst->next); 457 omapdss_device_disconnect(dst, dst->next);
458 omapdss_output_unset_device(dst);
459 458
460 dss_mgr_disconnect(dst); 459 dss_mgr_disconnect(dst);
461} 460}
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 600ac7c25724..8f9538e17ea4 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -522,7 +522,6 @@ int omap_dss_get_num_overlays(void);
522#define for_each_dss_output(d) \ 522#define for_each_dss_output(d) \
523 while ((d = omapdss_device_get_next(d, OMAP_DSS_DEVICE_TYPE_OUTPUT)) != NULL) 523 while ((d = omapdss_device_get_next(d, OMAP_DSS_DEVICE_TYPE_OUTPUT)) != NULL)
524int omapdss_output_validate(struct omap_dss_device *out); 524int omapdss_output_validate(struct omap_dss_device *out);
525int omapdss_output_unset_device(struct omap_dss_device *out);
526 525
527typedef void (*omap_dispc_isr_t) (void *arg, u32 mask); 526typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
528int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask); 527int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
diff --git a/drivers/gpu/drm/omapdrm/dss/output.c b/drivers/gpu/drm/omapdrm/dss/output.c
index be544dd48bf4..2da480be918d 100644
--- a/drivers/gpu/drm/omapdrm/dss/output.c
+++ b/drivers/gpu/drm/omapdrm/dss/output.c
@@ -24,8 +24,6 @@
24#include "dss.h" 24#include "dss.h"
25#include "omapdss.h" 25#include "omapdss.h"
26 26
27static DEFINE_MUTEX(output_lock);
28
29int omapdss_output_validate(struct omap_dss_device *out) 27int omapdss_output_validate(struct omap_dss_device *out)
30{ 28{
31 if (out->next && out->output_type != out->next->type) { 29 if (out->next && out->output_type != out->next->type) {
@@ -37,25 +35,6 @@ int omapdss_output_validate(struct omap_dss_device *out)
37} 35}
38EXPORT_SYMBOL(omapdss_output_validate); 36EXPORT_SYMBOL(omapdss_output_validate);
39 37
40int omapdss_output_unset_device(struct omap_dss_device *out)
41{
42 int r = 0;
43
44 mutex_lock(&output_lock);
45
46 if (out->dst->state != OMAP_DSS_DISPLAY_DISABLED) {
47 dev_err(out->dev,
48 "device %s is not disabled, cannot unset device\n",
49 out->dst->name);
50 r = -EINVAL;
51 }
52
53 mutex_unlock(&output_lock);
54
55 return r;
56}
57EXPORT_SYMBOL(omapdss_output_unset_device);
58
59int dss_install_mgr_ops(struct dss_device *dss, 38int dss_install_mgr_ops(struct dss_device *dss,
60 const struct dss_mgr_ops *mgr_ops, 39 const struct dss_mgr_ops *mgr_ops,
61 struct omap_drm_private *priv) 40 struct omap_drm_private *priv)
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 2101a697a08a..764299cafbe2 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -274,7 +274,6 @@ static void sdi_disconnect(struct omap_dss_device *src,
274 struct omap_dss_device *dst) 274 struct omap_dss_device *dst)
275{ 275{
276 omapdss_device_disconnect(dst, dst->next); 276 omapdss_device_disconnect(dst, dst->next);
277 omapdss_output_unset_device(dst);
278 277
279 dss_mgr_disconnect(dst); 278 dss_mgr_disconnect(dst);
280} 279}
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index e673f3e78c69..c2811c425195 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -713,7 +713,6 @@ static void venc_disconnect(struct omap_dss_device *src,
713 struct omap_dss_device *dst) 713 struct omap_dss_device *dst)
714{ 714{
715 omapdss_device_disconnect(dst, dst->next); 715 omapdss_device_disconnect(dst, dst->next);
716 omapdss_output_unset_device(dst);
717 716
718 dss_mgr_disconnect(dst); 717 dss_mgr_disconnect(dst);
719} 718}