summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss/dpi.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-06 01:25:13 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:28 +0300
commit713165561b7e372cd21f34bfeb82188361569f74 (patch)
treeb510b0ae1fa4976198088e5d8e6228c41b968724 /drivers/gpu/drm/omapdrm/dss/dpi.c
parent79ddb2f0c348e991edca106a0e5ab414a822ccfc (diff)
downloadlinux-713165561b7e372cd21f34bfeb82188361569f74.tar.gz
drm/omap: dss: Move display type validation to initialization time
The display type is validated when the display is connected to the DSS output. We already have all the information we need for validation when initializing the outputs. Move validation to output initialization to simplify pipeline connection handling. 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>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss/dpi.c')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dpi.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 6bd0fd12883e..eeeea936f889 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -620,24 +620,13 @@ static int dpi_connect(struct omap_dss_device *src,
if (r)
return r;
- r = omapdss_output_set_device(dst, dst->next);
+ r = omapdss_device_connect(dst->dss, dst, dst->next);
if (r) {
- DSSERR("failed to connect output to new device: %s\n",
- dst->name);
- goto err_mgr_disconnect;
+ dss_mgr_disconnect(dst);
+ return r;
}
- r = omapdss_device_connect(dst->dss, dst, dst->next);
- if (r)
- goto err_output_unset;
-
return 0;
-
-err_output_unset:
- omapdss_output_unset_device(dst);
-err_mgr_disconnect:
- dss_mgr_disconnect(dst);
- return r;
}
static void dpi_disconnect(struct omap_dss_device *src,
@@ -664,6 +653,7 @@ static int dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
{
struct omap_dss_device *out = &dpi->output;
u32 port_num = 0;
+ int r;
of_property_read_u32(port, "reg", &port_num);
dpi->id = port_num <= 2 ? port_num : 0;
@@ -696,6 +686,13 @@ static int dpi_init_output_port(struct dpi_data *dpi, struct device_node *port)
return PTR_ERR(out->next);
}
+ r = omapdss_output_validate(out);
+ if (r) {
+ omapdss_device_put(out->next);
+ out->next = NULL;
+ return r;
+ }
+
omapdss_device_register(out);
return 0;