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=unavailable 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 900DCC433DB for ; Fri, 15 Jan 2021 20:29:26 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 1E1A923A9C for ; Fri, 15 Jan 2021 20:29:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1E1A923A9C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5C97686C1B; Fri, 15 Jan 2021 20:29:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id atNApbxeaJhA; Fri, 15 Jan 2021 20:29:24 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5E2D386B46; Fri, 15 Jan 2021 20:29:24 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3DDE3C0893; Fri, 15 Jan 2021 20:29:24 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 4E593C013A for ; Fri, 15 Jan 2021 20:29:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 352B686822 for ; Fri, 15 Jan 2021 20:29:22 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lcQfmE2BL50C for ; Fri, 15 Jan 2021 20:29:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by whitealder.osuosl.org (Postfix) with ESMTPS id E119386819 for ; Fri, 15 Jan 2021 20:29:20 +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> Cc: Heiko =?utf-8?Q?St=C3=BCbner?= , 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 , Inki Dae , 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, Eric Anholt , 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, Maxime Ripard , John Stultz , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Rodrigo Siqueira , Sandy Huang , Yannick Fertre , Kyungmin Park , Maxime Coquelin , Brian Starkey , Haneen Mohammed , Neil Armstrong , Stefan Agner , Melissa Wen , linux-tegra@vger.kernel.org, Benjamin Gaignard , Fabio Estevam , Xinwei Kong , amd-gfx@lists.freedesktop.org, Chen-Yu Tsai , Harry Wentland , Chun-Kuang Hu , Chen Feng , Alison Wang , spice-devel@lists.freedesktop.org, Daniel Vetter , 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 , Maarten Lankhorst , linux-mediatek@lists.infradead.org, Laurentiu Palcu , Matthias Brugger , Jernej Skrabec , Rob Clark , Philipp Zabel , Jyri Sarha , Lucas Stach X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" 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 _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization