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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 15D43C433E0 for ; Fri, 15 Jan 2021 20:29:34 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 711CA23A5A for ; Fri, 15 Jan 2021 20:29:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 711CA23A5A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bjfK2gCpmx3aqCf/gUMyUhjiaiR9R1MlqTi4lq5GW8U=; b=isxfCMH6k68z7QrKNTOE+FFrA n5ObgnSudgp+1kpdrk3GCfuvnyrxJath0dchC22e4A8tsYmMjt+NYp6sSSex4XbEgoZ27SIMua2BY ypfOahV1nede/03/GRolFweOxPntLD1C2Qe8zEOteXzfJJpwHhnNd2KvndC4u7317Hg2wdbzSDn9r 6SpXSyCrmpJKpAd+INkyIFW6rWNpSTLH0PTndNZhQvG4kiYoBBWLjHMv08cXlc+x9VwqeUOIkVXLj dH4hjeAwf8NPkgCYHa0G2ix2eBcTm/coGbECitZ21fXow82iq04cd0BKBzIVrl3t4dROtC1VsG9A+ uoNHCE4+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Vik-0007iu-SR; Fri, 15 Jan 2021 20:29:22 +0000 Received: from perceval.ideasonboard.com ([2001:4b98:dc2:55:216:3eff:fef7:d647]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l0Vih-0007iQ-Gj; Fri, 15 Jan 2021 20:29:20 +0000 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210115_152919_686978_986593BC X-CRM114-Status: GOOD ( 23.74 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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, Gerd Hoffmann , 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-amlogic mailing list linux-amlogic@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-amlogic