From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Neil Armstrong <narmstrong@baylibre.com>,
David Airlie <airlied@linux.ie>,
Liviu Dudau <liviu.dudau@arm.com>,
dri-devel@lists.freedesktop.org,
Russell King <linux@armlinux.org.uk>,
Paul Cercueil <paul@crapouillou.net>,
Thierry Reding <thierry.reding@gmail.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Sam Ravnborg <sam@ravnborg.org>,
Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
linux-renesas-soc@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
Joonyoung Shim <jy0922.shim@samsung.com>,
linux-rockchip@lists.infradead.org,
Alexey Brodkin <abrodkin@synopsys.com>,
Michal Simek <michal.simek@xilinx.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Roland Scheidegger <sroland@vmware.com>,
Xinliang Liu <xinliang.liu@linaro.org>,
Chen-Yu Tsai <wens@csie.org>,
VMware Graphics <linux-graphics-maintainer@vmware.com>,
NXP Linux Team <linux-imx@nxp.com>,
Chen Feng <puck.chen@hisilicon.com>,
Dave Airlie <airlied@redhat.com>,
Xinwei Kong <kong.kongxinwei@hisilicon.com>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Alexandre Torgue <alexandre.torgue@st.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-arm-msm@vger.kernel.org,
Sascha Hauer <s.hauer@pengutronix.de>,
Alison Wang <alison.wang@nxp.com>,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
linux-mips@vger.kernel.org, Hans de Goede <hdegoede@redhat.com>,
linux-tegra@vger.kernel.org,
virtualization@lists.linux-foundation.org,
linux-mediatek@lists.infradead, Hyun Kwon <hyun.kwon@xilinx.com>,
Philippe Cornu <philippe.cornu@st.com>,
Sandy Huang <hjc@rock-chips.com>,
Yannick Fertre <yannick.fertre@st.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 10/11] drm: Use state helper instead of the plane state pointer
Date: Tue, 26 Jan 2021 15:24:35 +0200 [thread overview]
Message-ID: <YBAYE4YH4bgURmuf@intel.com> (raw)
In-Reply-To: <20210121163537.1466118-10-maxime@cerno.tech>
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 = {
> ...,
> .atomic_disable = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = 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 = plane->state;
> + struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
> ...
> }
>
> @ include depends on adds_new_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_new_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Looks great.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
--
Ville Syrjälä
Intel
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
prev parent reply other threads:[~2021-01-26 13:25 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-21 16:35 [PATCH v2 01/11] drm/atomic: Pass the full state to planes async atomic check and update Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 02/11] drm: Rename plane atomic_check state names Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 04/11] drm/atomic: Pass the full state to planes atomic_check Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 05/11] drm: Use the state pointer directly in " Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 07/11] drm: Store new plane state in a variable for atomic_update and disable Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 08/11] drm: Rename plane->state variables in atomic update " Maxime Ripard
2021-01-22 12:15 ` Ville Syrjälä
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 11:52 ` Ville Syrjälä
2021-01-21 16:35 ` [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update Maxime Ripard
2021-01-21 23:03 ` Laurent Pinchart
2021-01-21 16:35 ` [PATCH v2 10/11] drm: Use state helper instead of the plane state pointer Maxime Ripard
2021-01-26 13:24 ` Ville Syrjälä [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YBAYE4YH4bgURmuf@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=abrodkin@synopsys.com \
--cc=airlied@linux.ie \
--cc=airlied@redhat.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandre.torgue@st.com \
--cc=alison.wang@nxp.com \
--cc=anitha.chrisanthus@intel.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel.vetter@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=hdegoede@redhat.com \
--cc=hjc@rock-chips.com \
--cc=hyun.kwon@xilinx.com \
--cc=jbrunet@baylibre.com \
--cc=jonathanh@nvidia.com \
--cc=jy0922.shim@samsung.com \
--cc=kong.kongxinwei@hisilicon.com \
--cc=kraxel@redhat.com \
--cc=krzk@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-imx@nxp.com \
--cc=linux-mediatek@lists.infradead \
--cc=linux-mips@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liviu.dudau@arm.com \
--cc=ludovic.desroches@microchip.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marex@denx.de \
--cc=martin.blumenstingl@googlemail.com \
--cc=maxime@cerno.tech \
--cc=michal.simek@xilinx.com \
--cc=narmstrong@baylibre.com \
--cc=paul@crapouillou.net \
--cc=philippe.cornu@st.com \
--cc=puck.chen@hisilicon.com \
--cc=s.hauer@pengutronix.de \
--cc=sam@ravnborg.org \
--cc=sroland@vmware.com \
--cc=thierry.reding@gmail.com \
--cc=tzimmermann@suse.de \
--cc=virtualization@lists.linux-foundation.org \
--cc=wens@csie.org \
--cc=xinliang.liu@linaro.org \
--cc=yannick.fertre@st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).