summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/dss
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2018-03-04 23:42:36 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2018-09-03 16:13:27 +0300
commit511afb44d72aa7b6b871fa71f829afaaa27e84f0 (patch)
treee5c3c1fced5108a88c1bd06e0f3b98a6aa082e94 /drivers/gpu/drm/omapdrm/dss
parent2ee767922e1bc7ede9ceb7aed9a14141480836a7 (diff)
drm/omap: Reverse direction of DSS device (dis)connect operations
The omapdrm and omapdss drivers are architectured based on display pipelines made of multiple components handled from sink (display) to source (DSS output). This is incompatible with the DRM bridge and panel APIs that handle components from source to sink. To reconcile the omapdrm and omapdss drivers with the DRM bridge and panel model, we need to reverse the direction of the DSS device operations. Start with the connect and disconnect operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/dss')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/base.c32
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dpi.c32
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dsi.c32
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi4.c30
-rw-r--r--drivers/gpu/drm/omapdrm/dss/hdmi5.c30
-rw-r--r--drivers/gpu/drm/omapdrm/dss/omapdss.h6
-rw-r--r--drivers/gpu/drm/omapdrm/dss/sdi.c30
-rw-r--r--drivers/gpu/drm/omapdrm/dss/venc.c30
8 files changed, 142 insertions, 80 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index 1dbd08e6e029..c3e451440d4b 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -190,24 +190,24 @@ int omapdss_device_connect(struct dss_device *dss,
{
int ret;
- dev_dbg(src->dev, "connect\n");
+ dev_dbg(dst->dev, "connect\n");
- if (omapdss_device_is_connected(src))
+ if (omapdss_device_is_connected(dst))
return -EBUSY;
- src->dss = dss;
+ dst->dss = dss;
- if (src->driver)
- ret = src->driver->connect(src);
+ if (dst->driver)
+ ret = dst->driver->connect(src, dst);
else
- ret = src->ops->connect(src, dst);
+ ret = dst->ops->connect(src, dst);
if (ret < 0) {
- src->dss = NULL;
+ dst->dss = NULL;
return ret;
}
- if (dst) {
+ if (src) {
dst->src = src;
src->dst = dst;
}
@@ -219,14 +219,14 @@ EXPORT_SYMBOL_GPL(omapdss_device_connect);
void omapdss_device_disconnect(struct omap_dss_device *src,
struct omap_dss_device *dst)
{
- dev_dbg(src->dev, "disconnect\n");
+ dev_dbg(dst->dev, "disconnect\n");
- if (!src->id && !omapdss_device_is_connected(src)) {
- WARN_ON(!src->driver);
+ if (!dst->id && !omapdss_device_is_connected(dst)) {
+ WARN_ON(!dst->driver);
return;
}
- if (dst) {
+ if (src) {
if (WARN_ON(dst != src->dst))
return;
@@ -234,12 +234,12 @@ void omapdss_device_disconnect(struct omap_dss_device *src,
src->dst = NULL;
}
- if (src->driver)
- src->driver->disconnect(src);
+ if (dst->driver)
+ dst->driver->disconnect(src, dst);
else
- src->ops->disconnect(src, dst);
+ dst->ops->disconnect(src, dst);
- src->dss = NULL;
+ dst->dss = NULL;
}
EXPORT_SYMBOL_GPL(omapdss_device_disconnect);
diff --git a/drivers/gpu/drm/omapdrm/dss/dpi.c b/drivers/gpu/drm/omapdrm/dss/dpi.c
index 35d63c686393..6bd0fd12883e 100644
--- a/drivers/gpu/drm/omapdrm/dss/dpi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dpi.c
@@ -608,35 +608,45 @@ static enum omap_channel dpi_get_channel(struct dpi_data *dpi)
}
}
-static int dpi_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int dpi_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- struct dpi_data *dpi = dpi_get_data_from_dssdev(dssdev);
+ struct dpi_data *dpi = dpi_get_data_from_dssdev(dst);
int r;
dpi_init_pll(dpi);
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst->next);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ goto err_mgr_disconnect;
}
+ 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 *dssdev,
- struct omap_dss_device *dst)
+static void dpi_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static const struct omap_dss_device_ops dpi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index 41a98021d5bf..0e88ae1178f7 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -4881,32 +4881,42 @@ static int dsi_get_clocks(struct dsi_data *dsi)
return 0;
}
-static int dsi_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int dsi_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
int r;
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst->next);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
- dssdev->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ dst->name);
+ goto err_mgr_disconnect;
}
+ 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 dsi_disconnect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static void dsi_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static const struct omap_dss_device_ops dsi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index 6edb85898a7d..9f883669e71b 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -428,32 +428,42 @@ void hdmi4_core_disable(struct hdmi_core_data *core)
mutex_unlock(&hdmi->lock);
}
-static int hdmi_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int hdmi_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
int r;
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst->next);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ goto err_mgr_disconnect;
}
+ 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 hdmi_disconnect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static void hdmi_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index db20a578091b..beb70b1fab94 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -433,32 +433,42 @@ static void hdmi_core_disable(struct omap_hdmi *hdmi)
mutex_unlock(&hdmi->lock);
}
-static int hdmi_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int hdmi_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
int r;
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst->next);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ goto err_mgr_disconnect;
}
+ 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 hdmi_disconnect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static void hdmi_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static int hdmi_read_edid(struct omap_dss_device *dssdev,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 5d03e9066a33..80c4c2ae306a 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -437,8 +437,10 @@ struct omap_dss_driver {
int (*probe)(struct omap_dss_device *);
void (*remove)(struct omap_dss_device *);
- int (*connect)(struct omap_dss_device *dssdev);
- void (*disconnect)(struct omap_dss_device *dssdev);
+ int (*connect)(struct omap_dss_device *src,
+ struct omap_dss_device *dst);
+ void (*disconnect)(struct omap_dss_device *src,
+ struct omap_dss_device *dst);
int (*enable)(struct omap_dss_device *display);
void (*disable)(struct omap_dss_device *display);
diff --git a/drivers/gpu/drm/omapdrm/dss/sdi.c b/drivers/gpu/drm/omapdrm/dss/sdi.c
index 1fb25e2c5f87..c32e8ed2a96f 100644
--- a/drivers/gpu/drm/omapdrm/dss/sdi.c
+++ b/drivers/gpu/drm/omapdrm/dss/sdi.c
@@ -252,32 +252,42 @@ static int sdi_check_timings(struct omap_dss_device *dssdev,
return 0;
}
-static int sdi_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int sdi_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
int r;
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ goto err_mgr_disconnect;
}
+ 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 sdi_disconnect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static void sdi_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static const struct omap_dss_device_ops sdi_ops = {
diff --git a/drivers/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 7aa06b796481..db0aa8f1ff7c 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -691,32 +691,42 @@ static int venc_get_clocks(struct venc_device *venc)
return 0;
}
-static int venc_connect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static int venc_connect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
int r;
- r = dss_mgr_connect(dssdev);
+ r = dss_mgr_connect(dst);
if (r)
return r;
- r = omapdss_output_set_device(dssdev, dst);
+ r = omapdss_output_set_device(dst, dst->next);
if (r) {
DSSERR("failed to connect output to new device: %s\n",
dst->name);
- dss_mgr_disconnect(dssdev);
- return r;
+ goto err_mgr_disconnect;
}
+ 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 venc_disconnect(struct omap_dss_device *dssdev,
- struct omap_dss_device *dst)
+static void venc_disconnect(struct omap_dss_device *src,
+ struct omap_dss_device *dst)
{
- omapdss_output_unset_device(dssdev);
+ omapdss_device_disconnect(dst, dst->next);
+ omapdss_output_unset_device(dst);
- dss_mgr_disconnect(dssdev);
+ dss_mgr_disconnect(dst);
}
static const struct omap_dss_device_ops venc_ops = {