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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B286FC433EF for ; Fri, 22 Oct 2021 19:33:44 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 7225A610A1 for ; Fri, 22 Oct 2021 19:33:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7225A610A1 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ravnborg.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AC49A6EDB4; Fri, 22 Oct 2021 19:33:43 +0000 (UTC) Received: from mx1.smtp.larsendata.com (mx1.smtp.larsendata.com [91.221.196.215]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56EF16EDB4 for ; Fri, 22 Oct 2021 19:33:42 +0000 (UTC) Received: from mail01.mxhotel.dk (mail01.mxhotel.dk [91.221.196.236]) by mx1.smtp.larsendata.com (Halon) with ESMTPS id f90b2a83-336e-11ec-9c3f-0050568c148b; Fri, 22 Oct 2021 19:33:45 +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 65D59194B23; Fri, 22 Oct 2021 21:33:39 +0200 (CEST) Date: Fri, 22 Oct 2021 21:33:38 +0200 X-Report-Abuse-To: abuse@mxhotel.dk From: Sam Ravnborg To: Maxime Ripard Cc: dri-devel@lists.freedesktop.org, Andrzej Hajda , Chun-Kuang Hu , Dafna Hirschfeld , Daniel Vetter , David Airlie , Enric Balletbo i Serra , Jernej Skrabec , Jitao Shi , Jonas Karlman , Laurent Pinchart , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Maarten Lankhorst , Matthias Brugger , Neil Armstrong , Philip Chen , Philipp Zabel , Robert Foss , Thomas Zimmermann , Andrzej Hajda Subject: Re: [PATCH v2 3/7] drm/bridge: Add drm_atomic_get_new_crtc_for_bridge() helper Message-ID: References: <20211020181901.2114645-1-sam@ravnborg.org> <20211020181901.2114645-4-sam@ravnborg.org> <20211022110355.3q2yhlaygz4lgzhe@gilmour> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211022110355.3q2yhlaygz4lgzhe@gilmour> 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" Hi Maxime, On Fri, Oct 22, 2021 at 01:03:55PM +0200, Maxime Ripard wrote: > Hi, > > On Wed, Oct 20, 2021 at 08:18:57PM +0200, Sam Ravnborg wrote: > > drm_atomic_get_new_crtc_for_bridge() will be used by bridge > > drivers to provide easy access to the mode from the > > drm_bridge_funcs operations. > > > > The helper will be useful in the conversion to the atomic > > operations of struct drm_bridge_funcs. > > > > v2: > > - Renamed to drm_atomic_get_new_crtc_for_bridge (Maxime) > > - Use atomic_state, not bridge_State (Maxime) > > - Drop WARN on crtc_state as it is a valid case (Maxime) > > - Added small code snip to help readers > > - Updated description, fixed kernel-doc and exported the symbol > > > > Signed-off-by: Sam Ravnborg > > Suggested-by: Laurent Pinchart > > Cc: Laurent Pinchart > > Cc: Maarten Lankhorst > > Cc: Maxime Ripard > > Cc: Thomas Zimmermann > > Cc: Andrzej Hajda > > Cc: Neil Armstrong > > Cc: Robert Foss > > Cc: Daniel Vetter > > --- > > drivers/gpu/drm/drm_atomic.c | 42 ++++++++++++++++++++++++++++++++++++ > > include/drm/drm_atomic.h | 3 +++ > > 2 files changed, 45 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > > index ff1416cd609a..8b107194b157 100644 > > --- a/drivers/gpu/drm/drm_atomic.c > > +++ b/drivers/gpu/drm/drm_atomic.c > > @@ -1134,6 +1134,48 @@ drm_atomic_get_new_bridge_state(struct drm_atomic_state *state, > > } > > EXPORT_SYMBOL(drm_atomic_get_new_bridge_state); > > > > +/** > > + * drm_atomic_get_new_crtc_for_bridge - get new crtc_state for the bridge > > + * @state: state of the bridge > > + * @bridge: bridge object > > I appreciate that the function name is fairly long already, but given > its name I'd expect it to return a drm_crtc, not drm_crtc_state. > > All the other state related functions are named using the pattern > drm_atomic_get_(old|new)_$object_state. > > Moreover, we already have a drm_atomic_get_new_connector_for_encoder > function that does return a drm_connector, so I think we should make it > consistent there and call it drm_atomic_get_new_crtc_state_for_bridge That's a better name - thanks! I will fix it in v3. Sam