mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
drm/omap: dss: don't create a panel_bridge
Now a panel_bridge is automatically created for every drm_panel and the panel-bridge API is just a deprecated wrapper to access it. Update and simplify the code by just getting a reference to the already-existing bridge using of_drm_get_bridge_by_endpoint(). Acked-by: Maxime Ripard <mripard@kernel.org> Link: https://patch.msgid.link/20260916-drm-bridge-every-panel-v3-17-83afb4f1a707@bootlin.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
parent
554d36acf5
commit
b7e9b93fc8
|
|
@ -204,7 +204,6 @@ struct omap_dss_device {
|
|||
struct dss_device *dss;
|
||||
struct drm_bridge *bridge;
|
||||
struct drm_bridge *next_bridge;
|
||||
struct drm_panel *panel;
|
||||
|
||||
struct list_head list;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
#include <linux/of_graph.h>
|
||||
|
||||
#include <drm/drm_bridge.h>
|
||||
#include <drm/drm_panel.h>
|
||||
|
||||
#include "dss.h"
|
||||
#include "omapdss.h"
|
||||
|
|
@ -20,40 +19,16 @@
|
|||
int omapdss_device_init_output(struct omap_dss_device *out,
|
||||
struct drm_bridge *local_bridge)
|
||||
{
|
||||
struct device_node *remote_node;
|
||||
struct drm_bridge *bridge;
|
||||
int ret;
|
||||
|
||||
remote_node = of_graph_get_remote_node(out->dev->of_node,
|
||||
out->of_port, 0);
|
||||
if (!remote_node) {
|
||||
bridge = of_drm_get_bridge_by_endpoint(out->dev->of_node, out->of_port, 0);
|
||||
if (IS_ERR(bridge)) {
|
||||
dev_dbg(out->dev, "failed to find video sink\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
out->panel = of_drm_find_panel(remote_node);
|
||||
if (IS_ERR(out->panel))
|
||||
out->panel = NULL;
|
||||
|
||||
if (!out->panel)
|
||||
out->bridge = of_drm_find_and_get_bridge(remote_node);
|
||||
|
||||
of_node_put(remote_node);
|
||||
|
||||
if (out->panel) {
|
||||
struct drm_bridge *bridge;
|
||||
|
||||
bridge = drm_panel_bridge_add(out->panel);
|
||||
drm_panel_put(out->panel);
|
||||
if (IS_ERR(bridge)) {
|
||||
dev_err(out->dev,
|
||||
"unable to create panel bridge (%ld)\n",
|
||||
PTR_ERR(bridge));
|
||||
ret = PTR_ERR(bridge);
|
||||
goto error;
|
||||
}
|
||||
|
||||
out->bridge = drm_bridge_get(bridge);
|
||||
}
|
||||
out->bridge = bridge;
|
||||
|
||||
if (local_bridge) {
|
||||
if (!out->bridge) {
|
||||
|
|
@ -65,11 +40,6 @@ int omapdss_device_init_output(struct omap_dss_device *out,
|
|||
out->bridge = drm_bridge_get(local_bridge);
|
||||
}
|
||||
|
||||
if (!out->bridge) {
|
||||
ret = -EPROBE_DEFER;
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
|
@ -79,10 +49,6 @@ int omapdss_device_init_output(struct omap_dss_device *out,
|
|||
|
||||
void omapdss_device_cleanup_output(struct omap_dss_device *out)
|
||||
{
|
||||
if (out->bridge && out->panel)
|
||||
drm_panel_bridge_remove(out->next_bridge ?
|
||||
out->next_bridge : out->bridge);
|
||||
|
||||
drm_bridge_put(out->next_bridge);
|
||||
drm_bridge_put(out->bridge);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user