drm/omap: Add support for drm_bridge

Hook up drm_bridge support in the omapdrm driver. Despite the recent
extensive preparation work, this is a rather intrusive change, as the
management of outputs needs to be adapted through the driver to handle
both omap_dss_device and drm_bridge.

Connector creation is skipped when using a drm_bridge, as the bridge
creates the connector internally. This creates issues with systems that
split connector operations (such as modes retrieval and hot-plug
detection) across different bridges. These systems can't be supported
using drm_bridge for now (their support through the omap_dss_device
infrastructure is not affected), this will be fixed in subsequent
changes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
This commit is contained in:
Laurent Pinchart
2018-09-23 12:58:15 +03:00
committed by Tomi Valkeinen
parent 163f7a3578
commit 79107f274b
9 changed files with 144 additions and 61 deletions

View File

@@ -20,25 +20,34 @@
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include "dss.h"
#include "omapdss.h"
int omapdss_device_init_output(struct omap_dss_device *out)
{
out->next = omapdss_of_find_connected_device(out->dev->of_node, 0);
if (IS_ERR(out->next)) {
if (PTR_ERR(out->next) != -EPROBE_DEFER)
dev_err(out->dev, "failed to find video sink\n");
return PTR_ERR(out->next);
struct device_node *remote_node;
remote_node = of_graph_get_remote_node(out->dev->of_node, 0, 0);
if (!remote_node) {
dev_dbg(out->dev, "failed to find video sink\n");
return 0;
}
out->next = omapdss_find_device_by_node(remote_node);
out->bridge = of_drm_find_bridge(remote_node);
of_node_put(remote_node);
if (out->next && out->type != out->next->type) {
dev_err(out->dev, "output type and display type don't match\n");
omapdss_device_put(out->next);
out->next = NULL;
return -EINVAL;
}
return 0;
return out->next || out->bridge ? 0 : -EPROBE_DEFER;
}
EXPORT_SYMBOL(omapdss_device_init_output);