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=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 CD4CEC433DB for ; Mon, 25 Jan 2021 09:09:38 +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 5534622DFB for ; Mon, 25 Jan 2021 09:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5534622DFB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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-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-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uN8qA4fVucs5hYSvBX3TiMqATm/3pPuGeoIyUkCzGPs=; b=2R91IhSr1yrg6VSevhDcjVbPM Rq0iY9figPIhPhDSWpUreHmwIok6YVqwKDORFQe7sqUAX7X8srGmMY2KRjB9ZpsiCqfe3m8g4LoTF SUXoR/swiGP1aGu8bLOfaZKb43I3D4aA4eNs3BJqDO0xIrmSfk+0Jj17Cl/92IdxwJ4tGAKutIbmZ v6vQBi/dCgQzmk986xH8P07GbS9QGM8CVH47qr/YSdVZYHkTAwxXhldDieaZXYblUbtgAGtZH8gGO xOx0aUzf/kLEWF+lSnvTFRsuNx/Wc6+6o0HSiGutb5hhW55afZPYIZEpVZpbLYJt7KntfJ0I+d/qm 0GHjCPeXQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3xqk-0007Q8-M3; Mon, 25 Jan 2021 09:07:54 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3xqi-0007P0-IR for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2021 09:07:53 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 8B7505806D9; Mon, 25 Jan 2021 04:07:48 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 25 Jan 2021 04:07:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=JiTUH6NbhECvc0BAfVIYFzk8Pbx ygiTICPCrQkvqTSs=; b=mOVG3LwoCHMVO1OCxS7SRLBDZp/kcDvrWYp20pQUxHF B3+oAHD93iFsZpiUnOmpqnFuOE8Ohm5oAKE9cx/mG91aqv+fVhcSC1k1YisgY3K8 oUdHU5oLeJzRQYIyYjOO7zzvhCrKmw+a8m+f+vbwHiShvuWElLlQ9HMz8lczZZYA SeTKM5Lq/7UhNYJD7hlCaf8niMZPAKeTVjj0UPqm6SckBaG1b+W8beTSDTPOBaU6 V9gVF/GdpSYKJmB7HHsl/A2FUtgu0bB0Gmf1bS5qXOmdGnJl1c1Oa8BOJmsHusB6 HIfyK4q/IJqUEjTnXDN7VTXsBR+coYCI6qhxjDMavpA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=JiTUH6 NbhECvc0BAfVIYFzk8PbxygiTICPCrQkvqTSs=; b=c7ArYP6TU8pLfNGg1E1pEc KabWCdPnPVNCeoYYhXkxhoIwypP234hG7gDRGdhHxy5WUwm3SyU5IWUKOPwdcz+K niWbcw4xhq84tCPwk9JZxGvryXu9PVMDthjKh0NKJs/oI21S7mPSVCY6v965Zotf BPTEJ3oDXMV0cg+V7oKf4YTHacsjdIbUdbr9INxEXDGgiiWSqyY0OZsqot32+DLL sdvFTdPoAWuYw0C9tvUB/HQiAnvfnab/5Ooe+qYUllJUritDNfiN9Qs6NXXn2fhq ZNV5wWAoLEzruIS1Cg19Q1FhYjkCYAS2PRoQsNuHKvyFcmVMZq/8E6L2d8ZHkzeA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvddvgdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddunecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepuddvudfhkeekhefgffetffelgffftdehffduffegveetffehueeivddvjedv gfevnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 552DE24005A; Mon, 25 Jan 2021 04:07:46 -0500 (EST) Date: Mon, 25 Jan 2021 10:07:44 +0100 From: Maxime Ripard To: Ville =?utf-8?B?U3lyasOkbMOk?= Subject: Re: [PATCH v2 06/11] drm: Use state helper instead of plane state pointer in atomic_check Message-ID: <20210125090744.txiofqzevcoturyl@gilmour> References: <20210121163537.1466118-1-maxime@cerno.tech> <20210121163537.1466118-6-maxime@cerno.tech> MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210125_040752_772320_3F927C52 X-CRM114-Status: GOOD ( 18.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pengutronix Kernel Team , Tomi Valkeinen , David Airlie , freedreno@lists.freedesktop.org, Sascha Hauer , Maarten Lankhorst , Jyri Sarha , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, NXP Linux Team , Thomas Zimmermann , linux-arm-msm@vger.kernel.org, Daniel Vetter , Sean Paul , Shawn Guo , linux-arm-kernel@lists.infradead.org Content-Type: multipart/mixed; boundary="===============6841861616967226054==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6841861616967226054== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vtqax52knlanow52" Content-Disposition: inline --vtqax52knlanow52 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Ville, On Fri, Jan 22, 2021 at 02:07:22PM +0200, Ville Syrj=E4l=E4 wrote: > On Thu, Jan 21, 2021 at 05:35:31PM +0100, Maxime Ripard wrote: > > Many drivers reference the plane->state pointer in order to get the > > current plane state in their atomic_check hook, which would be the old > > plane state in the global atomic state since _swap_state hasn't happened > > when atomic_check is run. > >=20 > > Use the drm_atomic_get_old_plane_state helper to get that state to make > > it more obvious. > >=20 > > This was made using the coccinelle script below: > >=20 > > @ plane_atomic_func @ > > identifier helpers; > > identifier func; > > @@ > >=20 > > static struct drm_plane_helper_funcs helpers =3D { > > ..., > > .atomic_check =3D func, > > ..., > > }; > >=20 > > @ replaces_old_state @ > > identifier plane_atomic_func.func; > > identifier plane, state, plane_state; > > @@ > >=20 > > func(struct drm_plane *plane, struct drm_atomic_state *state) { > > ... > > - struct drm_plane_state *plane_state =3D plane->state; > > + struct drm_plane_state *plane_state =3D drm_atomic_get_old_plane_stat= e(state, plane); > > ... > > } > >=20 > > @@ > > identifier plane_atomic_func.func; > > identifier plane, state, plane_state; > > @@ > >=20 > > func(struct drm_plane *plane, struct drm_atomic_state *state) { > > struct drm_plane_state *plane_state =3D drm_atomic_get_old_plane_stat= e(state, plane); > > ... > > - plane->state > > + plane_state > > ... >=20 > We don't need the <... ...> style here? It's been a while since > I did any serious cocci so I'm getting a bit rusty on the details... You're right, I've changed it and caught some more users (ingenic). I'll up= date it. > Otherwise looks great > Reviewed-by: Ville Syrj=E4l=E4 Thanks! Maxime --vtqax52knlanow52 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYA6KYAAKCRDj7w1vZxhR xV4jAP9wskueG1EvM6VdG/WWEqFcTANGURoA1xviblkDem9ahwD8DirdDfSOI4th FvH1xXFS9wLlQezjAobLpjrzR/4RLQc= =0SF+ -----END PGP SIGNATURE----- --vtqax52knlanow52-- --===============6841861616967226054== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6841861616967226054==--