[PATCH RFC 04/19] drm/exynos: Get rid of exynos_dsi->out_bridge

Boris Brezillon boris.brezillon at collabora.com
Thu Aug 8 15:11:35 UTC 2019


Now that we have an official way to request custom encoder/bridge
enable/disable sequences we can get rid of the extra ->out_bridge field
and use the encoder one.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 72726f2c7a9f..8593c87bdf96 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -255,7 +255,6 @@ struct exynos_dsi {
 	struct mipi_dsi_host dsi_host;
 	struct drm_connector connector;
 	struct drm_panel *panel;
-	struct drm_bridge *out_bridge;
 	struct device *dev;
 
 	void __iomem *reg_base;
@@ -1390,7 +1389,7 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 		if (ret < 0)
 			goto err_put_sync;
 	} else {
-		drm_bridge_pre_enable(dsi->out_bridge);
+		drm_bridge_pre_enable(encoder->bridge);
 	}
 
 	exynos_dsi_set_display_mode(dsi);
@@ -1401,7 +1400,7 @@ static void exynos_dsi_enable(struct drm_encoder *encoder)
 		if (ret < 0)
 			goto err_display_disable;
 	} else {
-		drm_bridge_enable(dsi->out_bridge);
+		drm_bridge_enable(encoder->bridge);
 	}
 
 	dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
@@ -1426,10 +1425,10 @@ static void exynos_dsi_disable(struct drm_encoder *encoder)
 	dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
 
 	drm_panel_disable(dsi->panel);
-	drm_bridge_disable(dsi->out_bridge);
+	drm_bridge_disable(encoder->bridge);
 	exynos_dsi_set_display_enable(dsi, false);
 	drm_panel_unprepare(dsi->panel);
-	drm_bridge_post_disable(dsi->out_bridge);
+	drm_bridge_post_disable(encoder->bridge);
 	dsi->state &= ~DSIM_STATE_ENABLED;
 	pm_runtime_put_sync(dsi->dev);
 }
@@ -1521,8 +1520,6 @@ static int exynos_dsi_host_attach(struct mipi_dsi_host *host,
 	out_bridge  = of_drm_find_bridge(device->dev.of_node);
 	if (out_bridge) {
 		drm_bridge_attach(encoder, out_bridge, NULL);
-		dsi->out_bridge = out_bridge;
-		encoder->bridge = NULL;
 	} else {
 		int ret = exynos_dsi_create_connector(encoder);
 
@@ -1584,10 +1581,6 @@ static int exynos_dsi_host_detach(struct mipi_dsi_host *host,
 		dsi->panel = NULL;
 		dsi->connector.status = connector_status_disconnected;
 		mutex_unlock(&drm->mode_config.mutex);
-	} else {
-		if (dsi->out_bridge->funcs->detach)
-			dsi->out_bridge->funcs->detach(dsi->out_bridge);
-		dsi->out_bridge = NULL;
 	}
 
 	if (drm->mode_config.poll_enabled)
@@ -1686,7 +1679,7 @@ static int exynos_dsi_bind(struct device *dev, struct device *master,
 
 	drm_encoder_init(drm_dev, encoder, &exynos_dsi_encoder_funcs,
 			 DRM_MODE_ENCODER_TMDS, NULL);
-
+	encoder->custom_bridge_enable_disable_seq = 1;
 	drm_encoder_helper_add(encoder, &exynos_dsi_encoder_helper_funcs);
 
 	ret = exynos_drm_set_possible_crtcs(encoder, EXYNOS_DISPLAY_TYPE_LCD);
-- 
2.21.0



More information about the dri-devel mailing list