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 3A6D2CDB471 for ; Mon, 22 Jun 2026 11:31:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CFFB10E642; Mon, 22 Jun 2026 11:31:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="i9X3Xwpo"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id E7AAF10E648 for ; Mon, 22 Jun 2026 11:31:04 +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 6BFB09CE; Mon, 22 Jun 2026 13:30:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1782127825; bh=n/pS9BA4SvoCZTEfTtGpzFrpLGX6VgSgxN10VwkkIp8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i9X3XwpovkppIh4umviaadbax+Z3hP8BNGTELwiQK2pFsuzsesyNG2YRQ+B6ROQvl 2aHy6kPwOAEGE6L8Ctn9k336ioDMiHHg4r9G9JatSmKV23HdLu+1ubQc/Pt8Hu/XfY kJFwmCh+lv1psFoTlKRmLpHDyaGeATi9Zl0N68Bg= Date: Mon, 22 Jun 2026 14:31:02 +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 11/37] drm/bridge: lvds-codec: Switch to atomic bridge callbacks Message-ID: <20260622113102.GC3872967@killaraus.ideasonboard.com> References: <20260617-drm-all-atomic-bridges-v1-0-b63e6316166b@kernel.org> <20260617-drm-all-atomic-bridges-v1-11-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-11-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:36PM +0200, Maxime Ripard wrote: > The lvds-codec bridge still uses the deprecated non-atomic bridge > callbacks. > > Switch to their atomic counterparts. > > 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 @ > 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 @ > 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 @ > 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 @ > 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 Reviewed-by: Laurent Pinchart > --- > drivers/gpu/drm/bridge/lvds-codec.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/lvds-codec.c b/drivers/gpu/drm/bridge/lvds-codec.c > index d1135dc3b99f..a82ea0c944eb 100644 > --- a/drivers/gpu/drm/bridge/lvds-codec.c > +++ b/drivers/gpu/drm/bridge/lvds-codec.c > @@ -41,11 +41,12 @@ static int lvds_codec_attach(struct drm_bridge *bridge, > > return drm_bridge_attach(encoder, lvds_codec->panel_bridge, > bridge, flags); > } > > -static void lvds_codec_enable(struct drm_bridge *bridge) > +static void lvds_codec_enable(struct drm_bridge *bridge, > + struct drm_atomic_commit *commit) > { > struct lvds_codec *lvds_codec = to_lvds_codec(bridge); > int ret; > > ret = regulator_enable(lvds_codec->vcc); > @@ -57,11 +58,12 @@ static void lvds_codec_enable(struct drm_bridge *bridge) > > if (lvds_codec->powerdown_gpio) > gpiod_set_value_cansleep(lvds_codec->powerdown_gpio, 0); > } > > -static void lvds_codec_disable(struct drm_bridge *bridge) > +static void lvds_codec_disable(struct drm_bridge *bridge, > + struct drm_atomic_commit *commit) > { > struct lvds_codec *lvds_codec = to_lvds_codec(bridge); > int ret; > > if (lvds_codec->powerdown_gpio) > @@ -98,12 +100,12 @@ lvds_codec_atomic_get_input_bus_fmts(struct drm_bridge *bridge, > return input_fmts; > } > > static const struct drm_bridge_funcs funcs = { > .attach = lvds_codec_attach, > - .enable = lvds_codec_enable, > - .disable = lvds_codec_disable, > + .atomic_enable = lvds_codec_enable, > + .atomic_disable = lvds_codec_disable, > .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, > .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, > .atomic_create_state = drm_atomic_helper_bridge_create_state, > .atomic_get_input_bus_fmts = lvds_codec_atomic_get_input_bus_fmts, > }; -- Regards, Laurent Pinchart