Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 511afb44 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen
Browse files

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 2ee76792
Loading
Loading
Loading
Loading
+4 −23
Original line number Diff line number Diff line
@@ -41,33 +41,15 @@ static const struct videomode tvc_pal_vm = {

#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)

static int tvc_connect(struct omap_dss_device *dssdev)
static int tvc_connect(struct omap_dss_device *src,
		       struct omap_dss_device *dst)
{
	struct omap_dss_device *src;
	int r;

	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR_OR_NULL(src)) {
		dev_err(dssdev->dev, "failed to find video source\n");
		return src ? PTR_ERR(src) : -EINVAL;
	}

	r = omapdss_device_connect(dssdev->dss, src, dssdev);
	if (r) {
		omapdss_device_put(src);
		return r;
	}

	return 0;
}

static void tvc_disconnect(struct omap_dss_device *dssdev)
static void tvc_disconnect(struct omap_dss_device *src,
			   struct omap_dss_device *dst)
{
	struct omap_dss_device *src = dssdev->src;

	omapdss_device_disconnect(src, dssdev);

	omapdss_device_put(src);
}

static int tvc_enable(struct omap_dss_device *dssdev)
@@ -184,7 +166,6 @@ static int __exit tvc_remove(struct platform_device *pdev)
	omapdss_device_unregister(&ddata->dssdev);

	tvc_disable(dssdev);
	omapdss_device_disconnect(dssdev, NULL);

	return 0;
}
+4 −23
Original line number Diff line number Diff line
@@ -56,33 +56,15 @@ struct panel_drv_data {

#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)

static int dvic_connect(struct omap_dss_device *dssdev)
static int dvic_connect(struct omap_dss_device *src,
			struct omap_dss_device *dst)
{
	struct omap_dss_device *src;
	int r;

	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR_OR_NULL(src)) {
		dev_err(dssdev->dev, "failed to find video source\n");
		return src ? PTR_ERR(src) : -EINVAL;
	}

	r = omapdss_device_connect(dssdev->dss, src, dssdev);
	if (r) {
		omapdss_device_put(src);
		return r;
	}

	return 0;
}

static void dvic_disconnect(struct omap_dss_device *dssdev)
static void dvic_disconnect(struct omap_dss_device *src,
			    struct omap_dss_device *dst)
{
	struct omap_dss_device *src = dssdev->src;

	omapdss_device_disconnect(src, dssdev);

	omapdss_device_put(src);
}

static int dvic_enable(struct omap_dss_device *dssdev)
@@ -405,7 +387,6 @@ static int __exit dvic_remove(struct platform_device *pdev)
	omapdss_device_unregister(&ddata->dssdev);

	dvic_disable(dssdev);
	omapdss_device_disconnect(dssdev, NULL);

	i2c_put_adapter(ddata->i2c_adapter);

+4 −23
Original line number Diff line number Diff line
@@ -51,33 +51,15 @@ struct panel_drv_data {

#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)

static int hdmic_connect(struct omap_dss_device *dssdev)
static int hdmic_connect(struct omap_dss_device *src,
			 struct omap_dss_device *dst)
{
	struct omap_dss_device *src;
	int r;

	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR_OR_NULL(src)) {
		dev_err(dssdev->dev, "failed to find video source\n");
		return src ? PTR_ERR(src) : -EINVAL;
	}

	r = omapdss_device_connect(dssdev->dss, src, dssdev);
	if (r) {
		omapdss_device_put(src);
		return r;
	}

	return 0;
}

static void hdmic_disconnect(struct omap_dss_device *dssdev)
static void hdmic_disconnect(struct omap_dss_device *src,
			     struct omap_dss_device *dst)
{
	struct omap_dss_device *src = dssdev->src;

	omapdss_device_disconnect(src, dssdev);

	omapdss_device_put(src);
}

static int hdmic_enable(struct omap_dss_device *dssdev)
@@ -364,7 +346,6 @@ static int __exit hdmic_remove(struct platform_device *pdev)
	omapdss_device_unregister(&ddata->dssdev);

	hdmic_disable(dssdev);
	omapdss_device_disconnect(dssdev, NULL);

	return 0;
}
+7 −27
Original line number Diff line number Diff line
@@ -31,36 +31,16 @@ struct panel_drv_data {

#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)

static int opa362_connect(struct omap_dss_device *dssdev,
static int opa362_connect(struct omap_dss_device *src,
			  struct omap_dss_device *dst)
{
	struct omap_dss_device *src;
	int r;

	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR(src)) {
		dev_err(dssdev->dev, "failed to find video source\n");
		return PTR_ERR(src);
	}

	r = omapdss_device_connect(dssdev->dss, src, dssdev);
	if (r) {
		omapdss_device_put(src);
		return r;
	}

	return 0;
	return omapdss_device_connect(dst->dss, dst, dst->next);
}

static void opa362_disconnect(struct omap_dss_device *dssdev,
static void opa362_disconnect(struct omap_dss_device *src,
			      struct omap_dss_device *dst)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *src = dssdev->src;

	omapdss_device_disconnect(src, &ddata->dssdev);

	omapdss_device_put(src);
	omapdss_device_disconnect(dst, dst->next);
}

static int opa362_enable(struct omap_dss_device *dssdev)
@@ -196,7 +176,7 @@ static int __exit opa362_remove(struct platform_device *pdev)

	WARN_ON(omapdss_device_is_connected(dssdev));
	if (omapdss_device_is_connected(dssdev))
		omapdss_device_disconnect(dssdev, dssdev->dst);
		omapdss_device_disconnect(NULL, dssdev);

	return 0;
}
+7 −27
Original line number Diff line number Diff line
@@ -27,36 +27,16 @@ struct panel_drv_data {

#define to_panel_data(x) container_of(x, struct panel_drv_data, dssdev)

static int tfp410_connect(struct omap_dss_device *dssdev,
static int tfp410_connect(struct omap_dss_device *src,
			  struct omap_dss_device *dst)
{
	struct omap_dss_device *src;
	int r;

	src = omapdss_of_find_connected_device(dssdev->dev->of_node, 0);
	if (IS_ERR(src)) {
		dev_err(dssdev->dev, "failed to find video source\n");
		return PTR_ERR(src);
	return omapdss_device_connect(dst->dss, dst, dst->next);
}

	r = omapdss_device_connect(dssdev->dss, src, dssdev);
	if (r) {
		omapdss_device_put(src);
		return r;
	}

	return 0;
}

static void tfp410_disconnect(struct omap_dss_device *dssdev,
static void tfp410_disconnect(struct omap_dss_device *src,
			      struct omap_dss_device *dst)
{
	struct panel_drv_data *ddata = to_panel_data(dssdev);
	struct omap_dss_device *src = dssdev->src;

	omapdss_device_disconnect(src, &ddata->dssdev);

	omapdss_device_put(src);
	omapdss_device_disconnect(dst, dst->next);
}

static int tfp410_enable(struct omap_dss_device *dssdev)
@@ -219,7 +199,7 @@ static int __exit tfp410_remove(struct platform_device *pdev)

	WARN_ON(omapdss_device_is_connected(dssdev));
	if (omapdss_device_is_connected(dssdev))
		omapdss_device_disconnect(dssdev, dssdev->dst);
		omapdss_device_disconnect(NULL, dssdev);

	return 0;
}
Loading