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=-8.8 required=3.0 tests=BAYES_00, 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 3F47FC433E0 for ; Tue, 26 Jan 2021 13:24:58 +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 DF05B207A0 for ; Tue, 26 Jan 2021 13:24:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DF05B207A0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.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 5FE576E441; Tue, 26 Jan 2021 13:24:57 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id D1FA46E42C; Tue, 26 Jan 2021 13:24:55 +0000 (UTC) IronPort-SDR: 3jggMRwRq58De0zrwRXO2+p1J/gxR3HUv8ddGx7J9uK/TaapUeUqTkTVwMLHlfrvzn21orOzYi dSSXMw8PRgHw== X-IronPort-AV: E=McAfee;i="6000,8403,9875"; a="243979561" X-IronPort-AV: E=Sophos;i="5.79,375,1602572400"; d="scan'208";a="243979561" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2021 05:24:53 -0800 IronPort-SDR: g4Zswe3qz4zMid/EyEG5xz4WWhFPriWd/t2t5KrG0ShP0j9WNEEJayXNCJQTEkRkM2/IHRNzgx zk+bb8SSGplQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,375,1602572400"; d="scan'208";a="369103591" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 26 Jan 2021 05:24:36 -0800 Received: by stinkbox (sSMTP sendmail emulation); Tue, 26 Jan 2021 15:24:35 +0200 Date: Tue, 26 Jan 2021 15:24:35 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Maxime Ripard Subject: Re: [PATCH v2 10/11] drm: Use state helper instead of the plane state pointer Message-ID: References: <20210121163537.1466118-1-maxime@cerno.tech> <20210121163537.1466118-10-maxime@cerno.tech> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210121163537.1466118-10-maxime@cerno.tech> X-Patchwork-Hint: comment 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: Haneen Mohammed , Alexandre Belloni , Neil Armstrong , David Airlie , Liviu Dudau , dri-devel@lists.freedesktop.org, Russell King , Paul Cercueil , Thierry Reding , Gerd Hoffmann , Anitha Chrisanthus , Daniel Vetter , Sam Ravnborg , Jerome Brunet , Marek Vasut , linux-renesas-soc@vger.kernel.org, linux-samsung-soc@vger.kernel.org, Joonyoung Shim , linux-rockchip@lists.infradead.org, Alexey Brodkin , Michal Simek , Krzysztof Kozlowski , Jonathan Hunter , Roland Scheidegger , Xinliang Liu , Chen-Yu Tsai , VMware Graphics , NXP Linux Team , Chen Feng , Dave Airlie , Xinwei Kong , Chun-Kuang Hu , Alexandre Torgue , Martin Blumenstingl , linux-arm-msm@vger.kernel.org, Sascha Hauer , Alison Wang , linux-mips@vger.kernel.org, Hans de Goede , linux-tegra@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-mediatek@lists.infradead, Hyun Kwon , Philippe Cornu , Sandy Huang , Yannick Fertre , Ludovic Desroches , Thomas Zimmermann , freedreno@lists.freedesktop.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jan 21, 2021 at 05:35:35PM +0100, Maxime Ripard wrote: > Many drivers reference the plane->state pointer in order to get the > current plane state in their atomic_update or atomic_disable hooks, > which would be the new plane state in the global atomic state since > _swap_state happened when those hooks are run. > = > Use the drm_atomic_get_new_plane_state helper to get that state to make it > more obvious. > = > This was made using the coccinelle script below: > = > @ plane_atomic_func @ > identifier helpers; > identifier func; > @@ > = > ( > static const struct drm_plane_helper_funcs helpers =3D { > ..., > .atomic_disable =3D func, > ..., > }; > | > static const struct drm_plane_helper_funcs helpers =3D { > ..., > .atomic_update =3D func, > ..., > }; > ) > = > @ adds_new_state @ > identifier plane_atomic_func.func; > identifier plane, state; > identifier new_state; > @@ > = > func(struct drm_plane *plane, struct drm_atomic_state *state) > { > ... > - struct drm_plane_state *new_state =3D plane->state; > + struct drm_plane_state *new_state =3D drm_atomic_get_new_plane_state(st= ate, plane); > ... > } > = > @ include depends on adds_new_state @ > @@ > = > #include > = > @ no_include depends on !include && adds_new_state @ > @@ > = > + #include > #include > = > Signed-off-by: Maxime Ripard Looks great. Reviewed-by: Ville Syrj=E4l=E4 -- = Ville Syrj=E4l=E4 Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel