[PATCH v1 09/12] drm/rcar-du: lvds: Use drm_bridge_funcs.atomic_check

Sam Ravnborg sam at ravnborg.org
Sun Jul 17 17:57:58 UTC 2022


Replace the deprecated drm_bridge_funcs.mode_fixup() with
drm_bridge_funcs.atomic_check().
The driver implements the state operations, so no other changes
are required for the replacement.

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham+renesas at ideasonboard.com>
Cc: linux-renesas-soc at vger.kernel.org
---
 drivers/gpu/drm/rcar-du/rcar_lvds.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_lvds.c b/drivers/gpu/drm/rcar-du/rcar_lvds.c
index 830aac0a2cb4..c4adbcede090 100644
--- a/drivers/gpu/drm/rcar-du/rcar_lvds.c
+++ b/drivers/gpu/drm/rcar-du/rcar_lvds.c
@@ -554,10 +554,12 @@ static void rcar_lvds_atomic_disable(struct drm_bridge *bridge,
 	clk_disable_unprepare(lvds->clocks.mod);
 }
 
-static bool rcar_lvds_mode_fixup(struct drm_bridge *bridge,
-				 const struct drm_display_mode *mode,
-				 struct drm_display_mode *adjusted_mode)
+static int rcar_lvds_atomic_check(struct drm_bridge *bridge,
+				  struct drm_bridge_state *bridge_state,
+				  struct drm_crtc_state *crtc_state,
+				  struct drm_connector_state *conn_state)
 {
+	struct drm_display_mode *adjusted_mode = &crtc_state->adjusted_mode;
 	struct rcar_lvds *lvds = bridge_to_rcar_lvds(bridge);
 	int min_freq;
 
@@ -569,7 +571,7 @@ static bool rcar_lvds_mode_fixup(struct drm_bridge *bridge,
 	min_freq = lvds->info->quirks & RCAR_LVDS_QUIRK_EXT_PLL ? 5000 : 31000;
 	adjusted_mode->clock = clamp(adjusted_mode->clock, min_freq, 148500);
 
-	return true;
+	return 0;
 }
 
 static int rcar_lvds_attach(struct drm_bridge *bridge,
@@ -591,7 +593,7 @@ static const struct drm_bridge_funcs rcar_lvds_bridge_ops = {
 	.atomic_reset = drm_atomic_helper_bridge_reset,
 	.atomic_enable = rcar_lvds_atomic_enable,
 	.atomic_disable = rcar_lvds_atomic_disable,
-	.mode_fixup = rcar_lvds_mode_fixup,
+	.atomic_check = rcar_lvds_atomic_check,
 };
 
 bool rcar_lvds_dual_link(struct drm_bridge *bridge)
-- 
2.34.1



More information about the dri-devel mailing list