diff mbox series

[v2,4/4] drm: exynos: dsi: Switch to atomic funcs

Message ID 20211210191922.2367979-5-jagan@amarulasolutions.com (mailing list archive)
State New, archived
Headers show
Series drm: exynos: dsi: Convert drm bridge | expand

Commit Message

Jagan Teki Dec. 10, 2021, 7:19 p.m. UTC
The new support drm bridges are moving towards atomic functions.

Replace atomic version of functions to continue the transition
to the atomic API.

Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- new patch 

 drivers/gpu/drm/exynos/exynos_drm_dsi.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/exynos/exynos_drm_dsi.c b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
index 37ad94b563c4..f2c12a356952 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_dsi.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_dsi.c
@@ -1372,7 +1372,8 @@  static void exynos_dsi_unregister_te_irq(struct exynos_dsi *dsi)
 	}
 }
 
-static void exynos_dsi_enable(struct drm_bridge *bridge)
+static void exynos_dsi_atomic_enable(struct drm_bridge *bridge,
+				     struct drm_bridge_state *old_bridge_state)
 {
 	struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 	const struct drm_bridge_funcs *funcs = dsi->out_bridge->funcs;
@@ -1390,19 +1391,20 @@  static void exynos_dsi_enable(struct drm_bridge *bridge)
 	dsi->state |= DSIM_STATE_ENABLED;
 
 	if (dsi->out_bridge)
-		funcs->pre_enable(dsi->out_bridge);
+		funcs->atomic_pre_enable(dsi->out_bridge, old_bridge_state);
 
 	exynos_dsi_set_display_mode(bridge);
 	exynos_dsi_set_display_enable(dsi, true);
 
 	if (dsi->out_bridge)
-		funcs->enable(dsi->out_bridge);
+		funcs->atomic_enable(dsi->out_bridge, old_bridge_state);
 
 	dsi->state |= DSIM_STATE_VIDOUT_AVAILABLE;
 	return;
 }
 
-static void exynos_dsi_disable(struct drm_bridge *bridge)
+static void exynos_dsi_atomic_disable(struct drm_bridge *bridge,
+				      struct drm_bridge_state *old_bridge_state)
 {
 	struct exynos_dsi *dsi = bridge_to_dsi(bridge);
 	const struct drm_bridge_funcs *funcs = dsi->out_bridge->funcs;
@@ -1413,12 +1415,12 @@  static void exynos_dsi_disable(struct drm_bridge *bridge)
 	dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE;
 
 	if (dsi->out_bridge)
-		funcs->disable(dsi->out_bridge);
+		funcs->atomic_disable(dsi->out_bridge, old_bridge_state);
 
 	exynos_dsi_set_display_enable(dsi, false);
 
 	if (dsi->out_bridge)
-		funcs->post_disable(dsi->out_bridge);
+		funcs->atomic_post_disable(dsi->out_bridge, old_bridge_state);
 
 	dsi->state &= ~DSIM_STATE_ENABLED;
 	pm_runtime_put_sync(dsi->dev);
@@ -1433,8 +1435,11 @@  static int exynos_dsi_attach(struct drm_bridge *bridge,
 }
 
 static const struct drm_bridge_funcs exynos_dsi_bridge_funcs = {
-	.enable			= exynos_dsi_enable,
-	.disable		= exynos_dsi_disable,
+	.atomic_duplicate_state	= drm_atomic_helper_bridge_duplicate_state,
+	.atomic_destroy_state	= drm_atomic_helper_bridge_destroy_state,
+	.atomic_reset		= drm_atomic_helper_bridge_reset,
+	.atomic_enable		= exynos_dsi_atomic_enable,
+	.atomic_disable		= exynos_dsi_atomic_disable,
 	.attach			= exynos_dsi_attach,
 };
 
@@ -1605,7 +1610,7 @@  static void exynos_dsi_unbind(struct device *dev, struct device *master,
 {
 	struct exynos_dsi *dsi = dev_get_drvdata(dev);
 
-	exynos_dsi_disable(&dsi->bridge);
+	exynos_dsi_atomic_disable(&dsi->bridge, NULL);
 
 	mipi_dsi_host_unregister(&dsi->dsi_host);
 }