Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F6B2C43458 for ; Tue, 7 Jul 2026 15:12:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B7C0F10EDE4; Tue, 7 Jul 2026 15:12:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="czeZDH+O"; dkim-atps=neutral Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7917910EDE3 for ; Tue, 7 Jul 2026 15:12:21 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id F136A61833; Tue, 7 Jul 2026 15:12:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 314971F000E9; Tue, 7 Jul 2026 15:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783437140; bh=UX7s47AzxbbkgkKVLw8MQiV2mC8krLVR4Yl8uNb3cGA=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=czeZDH+Oukm0YB/4XCv0QnED23DtuPz071OmMVklAWd6GGcS+DkIvq6TU08q31dpy LoW68WOyhNFsahADa8SVnf5hll8Jb2bQERkQIqMoAVKl5keDrJcm/mOdq6XnQ0RH9t USavZroc6Q1aNBKhCAFg5lYv0Pr06bzeMKFk2PV1snafaoWwJ41Gncj+Gihrsqjkgv JIaxJdHrXwjpSf11I7zjjexbl6JIZNowBuTUYnfdvqCTByptWQUcfAN2hSz+/np4vx b5F9ZdDFFbNGHZ8pL0GuXC6YD8uSodnNReZ5npOzYKlHUYjzMCJf/LNwrsHupY5lNy 1cBvWxG93aWrQ== From: Maxime Ripard Date: Tue, 07 Jul 2026 17:11:28 +0200 Subject: [PATCH v2 21/37] drm/bridge: tda998x: Switch to atomic bridge callbacks MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260707-drm-all-atomic-bridges-v2-21-21d03cbca446@kernel.org> References: <20260707-drm-all-atomic-bridges-v2-0-21d03cbca446@kernel.org> In-Reply-To: <20260707-drm-all-atomic-bridges-v2-0-21d03cbca446@kernel.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter Cc: Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , dri-devel@lists.freedesktop.org, Maxime Ripard , Russell King X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5033; i=mripard@kernel.org; h=from:subject:message-id; bh=l/5OXjQ/c2C8fPBpHjPBsoC5JokB5W1d7dhm8V1LFTQ=; b=owGbwMvMwCmsHn9OcpHtvjLG02pJDFm+4pKGy/w5ouXnxdTvc+3Yo18woSIuO1Nz+Y3qzL3bf rWHT1DpmMrCIMzJICumyPJEJuz08vbFVQ72K3/AzGFlAhnCwMUpABO5Yc9Yp1y9bPbjDcdnJSv5 K3OE8VhP/dnx7KHmowkNHLfulZZWLTPc9ezQcY2TXK13lNeG/GPvY6zPNmN9ZLzshkr8qeNL+nf P0dh+11BYwyC0cYV1GM8sad7DXs6+c5rvxaas8+Q3ufrd8SkA X-Developer-Key: i=mripard@kernel.org; a=openpgp; fpr=BE5675C37E818C8B5764241C254BCFC56BF6CE8D X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The tda998x bridge uses the legacy non-atomic enable and disable bridge callbacks. In order to remove the legacy bridge callback support from the DRM bridge core, switch to their atomic counterparts and add the bridge atomic state handlers. Generated by the following Coccinelle script: @ is_bridge @ identifier funcs; @@ struct drm_bridge_funcs funcs = { ..., }; @ has_create_state depends on is_bridge @ identifier funcs, f; @@ struct drm_bridge_funcs funcs = { ..., .atomic_create_state = f, ..., }; @ update_struct depends on (is_bridge && !has_create_state) @ identifier is_bridge.funcs; identifier f; @@ struct drm_bridge_funcs funcs = { + .atomic_create_state = drm_atomic_helper_bridge_create_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, ..., }; @ update_pre_enable_struct depends on (is_bridge && !has_create_state) @ identifier is_bridge.funcs; identifier f; @@ struct drm_bridge_funcs funcs = { ..., - .pre_enable = f, + .atomic_pre_enable = f, ..., }; @ update_pre_enable_impl depends on update_pre_enable_struct @ identifier update_pre_enable_struct.f; identifier b; @@ -void f(struct drm_bridge *b) +void f(struct drm_bridge *b, struct drm_atomic_commit *commit) { ... } @ update_enable_struct depends on (is_bridge && !has_create_state) @ identifier is_bridge.funcs; identifier f; @@ struct drm_bridge_funcs funcs = { ..., - .enable = f, + .atomic_enable = f, ..., }; @ update_enable_impl depends on update_enable_struct @ identifier update_enable_struct.f; identifier b; @@ -void f(struct drm_bridge *b) +void f(struct drm_bridge *b, struct drm_atomic_commit *commit) { ... } @ update_disable_struct depends on (is_bridge && !has_create_state) @ identifier is_bridge.funcs; identifier f; @@ struct drm_bridge_funcs funcs = { ..., - .disable = f, + .atomic_disable = f, ..., }; @ update_disable_impl depends on update_disable_struct @ identifier update_disable_struct.f; identifier b; @@ -void f(struct drm_bridge *b) +void f(struct drm_bridge *b, struct drm_atomic_commit *commit) { ... } @ update_post_disable_struct depends on (is_bridge && !has_create_state) @ identifier is_bridge.funcs; identifier f; @@ struct drm_bridge_funcs funcs = { ..., - .post_disable = f, + .atomic_post_disable = f, ..., }; @ update_post_disable_impl depends on update_post_disable_struct @ identifier update_post_disable_struct.f; identifier b; @@ -void f(struct drm_bridge *b) +void f(struct drm_bridge *b, struct drm_atomic_commit *commit) { ... } Signed-off-by: Maxime Ripard --- To: Russell King --- drivers/gpu/drm/bridge/tda998x_drv.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/tda998x_drv.c b/drivers/gpu/drm/bridge/tda998x_drv.c index 6c427bc75896..16c745591175 100644 --- a/drivers/gpu/drm/bridge/tda998x_drv.c +++ b/drivers/gpu/drm/bridge/tda998x_drv.c @@ -1408,11 +1408,12 @@ static enum drm_mode_status tda998x_bridge_mode_valid(struct drm_bridge *bridge, if (mode->vtotal >= BIT(11)) return MODE_BAD_VVALUE; return MODE_OK; } -static void tda998x_bridge_enable(struct drm_bridge *bridge) +static void tda998x_bridge_enable(struct drm_bridge *bridge, + struct drm_atomic_commit *commit) { struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge); if (!priv->is_on) { /* enable video ports, audio will be enabled later */ @@ -1426,11 +1427,12 @@ static void tda998x_bridge_enable(struct drm_bridge *bridge) priv->is_on = true; } } -static void tda998x_bridge_disable(struct drm_bridge *bridge) +static void tda998x_bridge_disable(struct drm_bridge *bridge, + struct drm_atomic_commit *commit) { struct tda998x_priv *priv = bridge_to_tda998x_priv(bridge); if (priv->is_on) { /* disable video ports */ @@ -1743,16 +1745,19 @@ static void tda998x_bridge_hpd_disable(struct drm_bridge *bridge) cec_write(priv, REG_CEC_RXSHPDINTENA, 0); } static const struct drm_bridge_funcs tda998x_bridge_funcs = { + .atomic_create_state = drm_atomic_helper_bridge_create_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .attach = tda998x_bridge_attach, .detach = tda998x_bridge_detach, .mode_valid = tda998x_bridge_mode_valid, - .disable = tda998x_bridge_disable, + .atomic_disable = tda998x_bridge_disable, .mode_set = tda998x_bridge_mode_set, - .enable = tda998x_bridge_enable, + .atomic_enable = tda998x_bridge_enable, .edid_read = tda998x_bridge_edid_read, .detect = tda998x_bridge_detect, .hpd_enable = tda998x_bridge_hpd_enable, .hpd_disable = tda998x_bridge_hpd_disable, }; -- 2.54.0