From mboxrd@z Thu Jan 1 00:00:00 1970 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 9612ECD98F2 for ; Mon, 22 Jun 2026 11:33:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BAB4910E656; Mon, 22 Jun 2026 11:33:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="p9wHCH6x"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id B656A10E63F for ; Mon, 22 Jun 2026 11:33:19 +0000 (UTC) Received: from killaraus.ideasonboard.com (2001-14ba-70f3-e800--a06.rev.dnainternet.fi [IPv6:2001:14ba:70f3:e800::a06]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A550B19D9; Mon, 22 Jun 2026 13:32:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782127960; bh=RYyN8C5bZADJ5p20sx5i/Mawi9Hd/Jqpj2/ZXxTCuwU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=p9wHCH6xZdUq1oCv2jp/9wfsdLXyp36hZzH//oGogZzn1QKfC6xnqGPdOsFkBkq2I KTVijXk+b9QBYNjz3NYkrwyA3lBIXjQWcxGPPLIUl8quhVgNAiycIYi5EXwgJJy4KV pHULtlHbjjktpRIHo8TxgCFYss4uzHDZzUB3a3Hw= Date: Mon, 22 Jun 2026 14:33:17 +0300 From: Laurent Pinchart To: Maxime Ripard Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Simona Vetter , Jonas Karlman , Jernej Skrabec , Luca Ceresoli , dri-devel@lists.freedesktop.org Subject: Re: [PATCH 15/37] drm/bridge: of-display-mode-bridge: Switch to atomic bridge callbacks Message-ID: <20260622113317.GD3872967@killaraus.ideasonboard.com> References: <20260617-drm-all-atomic-bridges-v1-0-b63e6316166b@kernel.org> <20260617-drm-all-atomic-bridges-v1-15-b63e6316166b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260617-drm-all-atomic-bridges-v1-15-b63e6316166b@kernel.org> 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" On Wed, Jun 17, 2026 at 12:14:40PM +0200, Maxime Ripard wrote: > The of-display-mode-bridge bridge still uses the deprecated non-atomic bridge > callbacks. > > Switch to their atomic counterparts, adding the bridge state > handlers if not already present. The code looks fine, but the commit message could do with some improvements. I don't see the driver "switching" to atomic callbacks, and you can tailor the commit message to this specific patch to avoid the "if not already present". > 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 > --- > drivers/gpu/drm/bridge/of-display-mode-bridge.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/gpu/drm/bridge/of-display-mode-bridge.c b/drivers/gpu/drm/bridge/of-display-mode-bridge.c > index cb15713f3a79..fd651d05428a 100644 > --- a/drivers/gpu/drm/bridge/of-display-mode-bridge.c > +++ b/drivers/gpu/drm/bridge/of-display-mode-bridge.c > @@ -7,10 +7,11 @@ > * Author: Dmitry Baryshkov > */ > > #include > > +#include > #include > #include > #include > #include > > @@ -50,10 +51,13 @@ static int of_display_mode_bridge_get_modes(struct drm_bridge *bridge, > > return 0; > } > > struct drm_bridge_funcs of_display_mode_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 = of_display_mode_bridge_attach, > .get_modes = of_display_mode_bridge_get_modes, > }; > > struct drm_bridge *devm_drm_of_display_mode_bridge(struct device *dev, > -- Regards, Laurent Pinchart