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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6765DC433DB for ; Fri, 15 Jan 2021 20:29:22 +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 CFD6123A5A for ; Fri, 15 Jan 2021 20:29:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFD6123A5A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF9DB6E48E; Fri, 15 Jan 2021 20:29:20 +0000 (UTC) Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8240C6E48E for ; Fri, 15 Jan 2021 20:29:19 +0000 (UTC) Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 0E61358B; Fri, 15 Jan 2021 21:29:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1610742556; bh=8R5qOZgwIXX9QIBlCIV/R54viYQ+tS8st/8kK+PspT4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rXfe/Bd4sxDcopxrQyulKr6sWDtZgNWVEUmMmsnebMU4/0jVNn/8hLQVXHqwR4Iqy dmLamgDdsuehH2QKJU5DVGWdiVNzsC5Rqtv2JHOZ59k4V2CtY3G/tqo9iglvRf5/6q dndbBomFsfYf9WqlpJf3+ozL6ojiJBE1hiTgHRnI= Date: Fri, 15 Jan 2021 22:28:59 +0200 From: Laurent Pinchart To: Maxime Ripard Subject: Re: [PATCH 02/10] drm: Rename plane atomic_check state names Message-ID: References: <20210115125703.1315064-1-maxime@cerno.tech> <20210115125703.1315064-2-maxime@cerno.tech> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210115125703.1315064-2-maxime@cerno.tech> 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: Xinliang Liu , dri-devel@lists.freedesktop.org, Anitha Chrisanthus , linux-stm32@st-md-mailman.stormreply.com, Jerome Brunet , linux-samsung-soc@vger.kernel.org, Kevin Hilman , Michal Simek , NXP Linux Team , VMware Graphics , Leo Li , Sascha Hauer , Roland Scheidegger , Sean Paul , Hyun Kwon , Seung-Woo Kim , linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Alex Deucher , freedreno@lists.freedesktop.org, David Airlie , nouveau@lists.freedesktop.org, Edmund Dea , virtualization@lists.linux-foundation.org, Thierry Reding , Daniel Vetter , Mihail Atanassov , Krzysztof Kozlowski , Jonathan Hunter , linux-rockchip@lists.infradead.org, "James \(Qian\) Wang" , Ben Skeggs , Dave Airlie , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Rodrigo Siqueira , Sandy Huang , Yannick Fertre , Kyungmin Park , Maxime Coquelin , Haneen Mohammed , Neil Armstrong , Melissa Wen , linux-tegra@vger.kernel.org, Gerd Hoffmann , Xinwei Kong , amd-gfx@lists.freedesktop.org, Chen-Yu Tsai , Chun-Kuang Hu , Chen Feng , Alison Wang , spice-devel@lists.freedesktop.org, Tomi Valkeinen , Philippe Cornu , Vincent Abriou , Kieran Bingham , Tian Tao , Shawn Guo , Christian =?utf-8?B?S8O2bmln?= , Liviu Dudau , Paul Cercueil , linux-renesas-soc@vger.kernel.org, Joonyoung Shim , Russell King , Thomas Zimmermann , linux-mediatek@lists.infradead.org, Laurentiu Palcu , Matthias Brugger , Jernej Skrabec , Jyri Sarha Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi Maxime, Thank you for the patch. On Fri, Jan 15, 2021 at 01:56:54PM +0100, Maxime Ripard wrote: > Most drivers call the argument to the plane atomic_check hook simply > state, which is going to conflict with the global atomic state in a > later rework. Let's rename it to new_plane_state (or new_state depending > on the convention used in the driver). > > This was done using the coccinelle script below, and built tested: > > @ plane_atomic_func @ > identifier helpers; > identifier func; > @@ > > static const struct drm_plane_helper_funcs helpers = { > .atomic_check = func, > }; > > @ has_old_state @ > identifier plane_atomic_func.func; > identifier plane; > expression e; > symbol old_state; > symbol state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *state) > { > ... > struct drm_plane_state *old_state = e; > ... > } > > @ depends on has_old_state @ > identifier plane_atomic_func.func; > identifier plane; > symbol old_state; > @@ > > func(struct drm_plane *plane, > - struct drm_plane_state *state > + struct drm_plane_state *new_state > ) > { > <+... > - state > + new_state > ...+> > } > > @ has_state @ > identifier plane_atomic_func.func; > identifier plane; > symbol state; > @@ > > func(struct drm_plane *plane, struct drm_plane_state *state) > { > ... > } > > @ depends on has_state @ > identifier plane_atomic_func.func; > identifier plane; > symbol old_state; > @@ > > func(struct drm_plane *plane, > - struct drm_plane_state *state > + struct drm_plane_state *new_plane_state > ) > { > <+... > - state > + new_plane_state > ...+> > } > > Signed-off-by: Maxime Ripard > --- [...] > drivers/gpu/drm/omapdrm/omap_plane.c | 19 +++++---- > drivers/gpu/drm/rcar-du/rcar_du_plane.c | 7 ++-- > drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 7 ++-- > drivers/gpu/drm/xlnx/zynqmp_disp.c | 10 +++-- For these, with the comment below addressed, Reviewed-by: Laurent Pinchart > 41 files changed, 402 insertions(+), 357 deletions(-) [snip] > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c > index 51dc24acea73..78d0eb1fd69d 100644 > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > @@ -99,18 +99,19 @@ static void omap_plane_atomic_disable(struct drm_plane *plane, > } > > static int omap_plane_atomic_check(struct drm_plane *plane, > - struct drm_plane_state *state) > + struct drm_plane_state *new_plane_state) > { > struct drm_crtc_state *crtc_state; > > - if (!state->fb) > + if (!new_plane_state->fb) > return 0; > > /* crtc should only be NULL when disabling (i.e., !state->fb) */ s/state/new_plane_state/ here too ? > - if (WARN_ON(!state->crtc)) > + if (WARN_ON(!new_plane_state->crtc)) > return 0; > > - crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc); > + crtc_state = drm_atomic_get_existing_crtc_state(new_plane_state->state, > + new_plane_state->crtc); > /* we should have a crtc state if the plane is attached to a crtc */ > if (WARN_ON(!crtc_state)) > return 0; > @@ -118,17 +119,17 @@ static int omap_plane_atomic_check(struct drm_plane *plane, > if (!crtc_state->enable) > return 0; > > - if (state->crtc_x < 0 || state->crtc_y < 0) > + if (new_plane_state->crtc_x < 0 || new_plane_state->crtc_y < 0) > return -EINVAL; > > - if (state->crtc_x + state->crtc_w > crtc_state->adjusted_mode.hdisplay) > + if (new_plane_state->crtc_x + new_plane_state->crtc_w > crtc_state->adjusted_mode.hdisplay) I can't help thinking we're using too long variable names... :-( > return -EINVAL; > > - if (state->crtc_y + state->crtc_h > crtc_state->adjusted_mode.vdisplay) > + if (new_plane_state->crtc_y + new_plane_state->crtc_h > crtc_state->adjusted_mode.vdisplay) > return -EINVAL; > > - if (state->rotation != DRM_MODE_ROTATE_0 && > - !omap_framebuffer_supports_rotation(state->fb)) > + if (new_plane_state->rotation != DRM_MODE_ROTATE_0 && > + !omap_framebuffer_supports_rotation(new_plane_state->fb)) > return -EINVAL; > > return 0; [...] -- Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel