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 651DEC433EF for ; Sat, 12 Feb 2022 21:15:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6AC4910E33E; Sat, 12 Feb 2022 21:15:39 +0000 (UTC) Received: from mx2.smtp.larsendata.com (mx2.smtp.larsendata.com [91.221.196.228]) by gabe.freedesktop.org (Postfix) with ESMTPS id 26CF210E33E for ; Sat, 12 Feb 2022 21:15:37 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx2.smtp.larsendata.com (Halon) with ESMTPS id f4f3cc90-8c48-11ec-b2df-0050568cd888; Sat, 12 Feb 2022 21:15:51 +0000 (UTC) Received: from ravnborg.org (80-162-45-141-cable.dk.customer.tdc.net [80.162.45.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: sam@ravnborg.org) by mail01.mxhotel.dk (Postfix) with ESMTPSA id B8055194B37; Sat, 12 Feb 2022 22:15:35 +0100 (CET) Date: Sat, 12 Feb 2022 22:15:32 +0100 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Laurent Pinchart Subject: Re: [PATCH v1 1/9] drm/bridge: add DRM_BRIDGE_STATE_OPS macro Message-ID: References: <20220206154405.1243333-1-sam@ravnborg.org> <20220206154405.1243333-2-sam@ravnborg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: , Cc: Rob Clark , Philip Chen , Jitao Shi , Thomas Zimmermann , Jonas Karlman , Robert Foss , Neil Armstrong , Douglas Anderson , Jernej Skrabec , Andrzej Hajda , dri-devel@lists.freedesktop.org, Enric Balletbo i Serra Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Laurent, On Tue, Feb 08, 2022 at 02:30:42AM +0200, Laurent Pinchart wrote: > Hi Sam, > > Thank you for the patch. > > On Sun, Feb 06, 2022 at 04:43:57PM +0100, Sam Ravnborg wrote: > > The DRM_BRIDGE_STATE_OPS can be used as shortcut for bridge drivers that > > do not subclass drm_bridge_state to assign the default operations for > > reset, duplicate and destroy of the state. > > > > Signed-off-by: Sam Ravnborg > > Cc: Douglas Anderson > > Cc: Andrzej Hajda > > Cc: Neil Armstrong > > Cc: Robert Foss > > Cc: Laurent Pinchart > > Cc: Jonas Karlman > > Cc: Jernej Skrabec > > Cc: Maxime Ripard > > Cc: Thomas Zimmermann > > --- > > include/drm/drm_bridge.h | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h > > index 061d87313fac..fc00304be643 100644 > > --- a/include/drm/drm_bridge.h > > +++ b/include/drm/drm_bridge.h > > @@ -935,4 +935,16 @@ static inline struct drm_bridge *devm_drm_of_get_bridge(struct device *dev, > > } > > #endif > > > > +/** > > + * DRM_BRIDGE_STATE_OPS - Default drm_bridge state funcs > > I'd name the macro DRM_BRIDGE_STATE_DEFAULT_OPS. OK, done. > > > + * > > + * Bridge driver that do not subclass &drm_bridge_state can use the helpers > > + * for reset, duplicate, and destroy. This macro provides a shortcut for > > + * setting the helpers in the &drm_bridge_funcs structure. > > + */ > > +#define DRM_BRIDGE_STATE_OPS \ > > + .atomic_reset = drm_atomic_helper_bridge_reset, \ > > + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, \ > > + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state > > I'm not a big fan of such macros for a small number of operations, as I > find that it obfuscates the code a bit, but that could change once I get > used to the new macro :-) The use of the macro is a nice signal that all the relevant default operations are specified - no need to look up if all are included. I have on my TODO to update all relevant bridge drivers to use it. > > Reviewed-by: Laurent Pinchart > > > + > > #endif > > -- > Regards, > > Laurent Pinchart