From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: "Heiko Stübner" <heiko@sntech.de>,
"Xinliang Liu" <xinliang.liu@linaro.org>,
dri-devel@lists.freedesktop.org,
"Anitha Chrisanthus" <anitha.chrisanthus@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
"Jerome Brunet" <jbrunet@baylibre.com>,
linux-samsung-soc@vger.kernel.org,
"Vincent Abriou" <vincent.abriou@st.com>,
"Michal Simek" <michal.simek@xilinx.com>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"VMware Graphics" <linux-graphics-maintainer@vmware.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Roland Scheidegger" <sroland@vmware.com>,
"Inki Dae" <inki.dae@samsung.com>, "Sean Paul" <sean@poorly.run>,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
linux-kernel@vger.kernel.org,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
freedreno@lists.freedesktop.org, "Zack Rusin" <zackr@vmware.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"David Airlie" <airlied@linux.ie>,
"Edmund Dea" <edmund.j.dea@intel.com>,
virtualization@lists.linux-foundation.org,
"Eric Anholt" <eric@anholt.net>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"Mihail Atanassov" <mihail.atanassov@arm.com>,
"Fabio Estevam" <festevam@gmail.com>,
"Alexey Brodkin" <abrodkin@synopsys.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
linux-rockchip@lists.infradead.org,
"James (Qian) Wang" <james.qian.wang@arm.com>,
"Dave Airlie" <airlied@redhat.com>,
"Alexandre Torgue" <alexandre.torgue@st.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
linux-arm-msm@vger.kernel.org,
"Maxime Ripard" <mripard@kernel.org>,
"John Stultz" <john.stultz@linaro.org>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Boris Brezillon" <bbrezillon@kernel.org>,
"Sandy Huang" <hjc@rock-chips.com>,
"Yannick Fertre" <yannick.fertre@st.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Brian Starkey" <brian.starkey@arm.com>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Stefan Agner" <stefan@agner.ch>,
"Melissa Wen" <melissa.srw@gmail.com>,
linux-tegra@vger.kernel.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Xinwei Kong" <kong.kongxinwei@hisilicon.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Chen-Yu Tsai" <wens@csie.org>,
"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"Chen Feng" <puck.chen@hisilicon.com>,
"Alison Wang" <alison.wang@nxp.com>,
spice-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Tomi Valkeinen" <tomba@kernel.org>,
"Philippe Cornu" <philippe.cornu@st.com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Tian Tao" <tiantao6@hisilicon.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Paul Cercueil" <paul@crapouillou.net>,
"Marek Vasut" <marex@denx.de>,
linux-renesas-soc@vger.kernel.org,
"Joonyoung Shim" <jy0922.shim@samsung.com>,
"Russell King" <linux@armlinux.org.uk>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Hans de Goede" <hdegoede@redhat.com>,
linux-mediatek@lists.infradead.org,
"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Jernej Skrabec" <jernej.skrabec@siol.net>,
linux-mips@vger.kernel.org, "Rob Clark" <robdclark@gmail.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jyri Sarha" <jyri.sarha@iki.fi>,
"Lucas Stach" <l.stach@pengutronix.de>
Subject: Re: [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update
Date: Fri, 22 Jan 2021 01:03:42 +0200 [thread overview]
Message-ID: <YAoITqHbG1UeiAHV@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210121163537.1466118-9-maxime@cerno.tech>
Hi Maxime,
Thank you for the patch.
On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote:
> The current atomic helpers have either their object state being passed as
> an argument or the full atomic state.
>
> The former is the pattern that was done at first, before switching to the
> latter for new hooks or when it was needed.
>
> Let's convert the remaining helpers to provide a consistent interface,
> this time with the planes atomic_update and atomic_disable.
>
> The conversion was done using the coccinelle script below, built tested on
> all the drivers.
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_update)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_disable)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_disable = func,
> ...,
> };
> )
>
> @@
> struct drm_plane_helper_funcs *FUNCS;
> identifier f;
> identifier crtc_state;
> identifier plane, plane_state, state;
> expression e;
> @@
>
> f(struct drm_crtc_state *crtc_state)
> {
> ...
> struct drm_atomic_state *state = e;
> <+...
> (
> - FUNCS->atomic_disable(plane, plane_state)
> + FUNCS->atomic_disable(plane, state)
> |
> - FUNCS->atomic_update(plane, plane_state)
> + FUNCS->atomic_update(plane, state)
> )
> ...+>
> }
>
> @@
> identifier plane_atomic_func.func;
> identifier plane;
> symbol state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *old_plane_state)
> {
> <...
> - state
> + old_plane_state
> ...>
> }
>
> @ ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, old_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *old_state)
> {
> ... when != old_state
> }
>
> @ adds_old_state depends on plane_atomic_func && !ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *plane_state)
> {
> + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> ...
> }
>
> @ depends on plane_atomic_func @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *plane_state
> + struct drm_atomic_state *state
> )
> { ... }
>
> @ include depends on adds_old_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_old_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> @@
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_atomic_state *state) {
> ...
> struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> <+...
> - plane_state->state
> + state
> ...+>
> }
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> Changes from v1:
> - Reintroduce the old_plane_state check in zynqmp_disp_crtc_atomic_disable
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++-
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 ++++--
> drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++-
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +++-
> drivers/gpu/drm/tidss/tidss_plane.c | 4 ++--
> drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 15 ++++++++-------
> include/drm/drm_modeset_helper_vtables.h | 4 ++--
For these,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 58 files changed, 211 insertions(+), 123 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: "Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"David Airlie" <airlied@linux.ie>,
dri-devel@lists.freedesktop.org,
"Alexey Brodkin" <abrodkin@synopsys.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"James (Qian) Wang" <james.qian.wang@arm.com>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Mihail Atanassov" <mihail.atanassov@arm.com>,
"Brian Starkey" <brian.starkey@arm.com>,
"Russell King" <linux@armlinux.org.uk>,
"Dave Airlie" <airlied@redhat.com>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Boris Brezillon" <bbrezillon@kernel.org>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Inki Dae" <inki.dae@samsung.com>,
"Joonyoung Shim" <jy0922.shim@samsung.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Stefan Agner" <stefan@agner.ch>,
"Alison Wang" <alison.wang@nxp.com>,
"Xinliang Liu" <xinliang.liu@linaro.org>,
"Tian Tao" <tiantao6@hisilicon.com>,
"John Stultz" <john.stultz@linaro.org>,
"Xinwei Kong" <kong.kongxinwei@hisilicon.com>,
"Chen Feng" <puck.chen@hisilicon.com>,
"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
"Lucas Stach" <l.stach@pengutronix.de>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"Paul Cercueil" <paul@crapouillou.net>,
"Anitha Chrisanthus" <anitha.chrisanthus@intel.com>,
"Edmund Dea" <edmund.j.dea@intel.com>,
"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Rob Clark" <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
"Marek Vasut" <marex@denx.de>,
"Tomi Valkeinen" <tomba@kernel.org>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Sandy Huang" <hjc@rock-chips.com>,
"Heiko Stübner" <heiko@sntech.de>,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
"Vincent Abriou" <vincent.abriou@st.com>,
"Yannick Fertre" <yannick.fertre@st.com>,
"Philippe Cornu" <philippe.cornu@st.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@st.com>,
"Chen-Yu Tsai" <wens@csie.org>,
"Jernej Skrabec" <jernej.skrabec@siol.net>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
"Jyri Sarha" <jyri.sarha@iki.fi>,
"Hans de Goede" <hdegoede@redhat.com>,
"Eric Anholt" <eric@anholt.net>,
"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Melissa Wen" <melissa.srw@gmail.com>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"VMware Graphics" <linux-graphics-maintainer@vmware.com>,
"Roland Scheidegger" <sroland@vmware.com>,
"Zack Rusin" <zackr@vmware.com>,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Michal Simek" <michal.simek@xilinx.com>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-mips@vger.kernel.org,
linux-mediatek@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org,
virtualization@lists.linux-foundation.org,
spice-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org,
linux-rockchip@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update
Date: Fri, 22 Jan 2021 01:03:42 +0200 [thread overview]
Message-ID: <YAoITqHbG1UeiAHV@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210121163537.1466118-9-maxime@cerno.tech>
Hi Maxime,
Thank you for the patch.
On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote:
> The current atomic helpers have either their object state being passed as
> an argument or the full atomic state.
>
> The former is the pattern that was done at first, before switching to the
> latter for new hooks or when it was needed.
>
> Let's convert the remaining helpers to provide a consistent interface,
> this time with the planes atomic_update and atomic_disable.
>
> The conversion was done using the coccinelle script below, built tested on
> all the drivers.
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_update)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_disable)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_disable = func,
> ...,
> };
> )
>
> @@
> struct drm_plane_helper_funcs *FUNCS;
> identifier f;
> identifier crtc_state;
> identifier plane, plane_state, state;
> expression e;
> @@
>
> f(struct drm_crtc_state *crtc_state)
> {
> ...
> struct drm_atomic_state *state = e;
> <+...
> (
> - FUNCS->atomic_disable(plane, plane_state)
> + FUNCS->atomic_disable(plane, state)
> |
> - FUNCS->atomic_update(plane, plane_state)
> + FUNCS->atomic_update(plane, state)
> )
> ...+>
> }
>
> @@
> identifier plane_atomic_func.func;
> identifier plane;
> symbol state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *old_plane_state)
> {
> <...
> - state
> + old_plane_state
> ...>
> }
>
> @ ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, old_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *old_state)
> {
> ... when != old_state
> }
>
> @ adds_old_state depends on plane_atomic_func && !ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *plane_state)
> {
> + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> ...
> }
>
> @ depends on plane_atomic_func @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *plane_state
> + struct drm_atomic_state *state
> )
> { ... }
>
> @ include depends on adds_old_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_old_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> @@
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_atomic_state *state) {
> ...
> struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> <+...
> - plane_state->state
> + state
> ...+>
> }
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> Changes from v1:
> - Reintroduce the old_plane_state check in zynqmp_disp_crtc_atomic_disable
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++-
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 ++++--
> drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++-
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +++-
> drivers/gpu/drm/tidss/tidss_plane.c | 4 ++--
> drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 15 ++++++++-------
> include/drm/drm_modeset_helper_vtables.h | 4 ++--
For these,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 58 files changed, 211 insertions(+), 123 deletions(-)
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: "Heiko Stübner" <heiko@sntech.de>,
"Xinliang Liu" <xinliang.liu@linaro.org>,
dri-devel@lists.freedesktop.org,
"Anitha Chrisanthus" <anitha.chrisanthus@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
"Jerome Brunet" <jbrunet@baylibre.com>,
linux-samsung-soc@vger.kernel.org,
"Vincent Abriou" <vincent.abriou@st.com>,
"Michal Simek" <michal.simek@xilinx.com>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"VMware Graphics" <linux-graphics-maintainer@vmware.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Roland Scheidegger" <sroland@vmware.com>,
"Inki Dae" <inki.dae@samsung.com>, "Sean Paul" <sean@poorly.run>,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
linux-kernel@vger.kernel.org,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
freedreno@lists.freedesktop.org, "Zack Rusin" <zackr@vmware.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"David Airlie" <airlied@linux.ie>,
"Edmund Dea" <edmund.j.dea@intel.com>,
virtualization@lists.linux-foundation.org,
"Eric Anholt" <eric@anholt.net>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"Mihail Atanassov" <mihail.atanassov@arm.com>,
"Fabio Estevam" <festevam@gmail.com>,
"Alexey Brodkin" <abrodkin@synopsys.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
linux-rockchip@lists.infradead.org,
"James (Qian) Wang" <james.qian.wang@arm.com>,
"Dave Airlie" <airlied@redhat.com>,
"Alexandre Torgue" <alexandre.torgue@st.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
linux-arm-msm@vger.kernel.org,
"Maxime Ripard" <mripard@kernel.org>,
"John Stultz" <john.stultz@linaro.org>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Boris Brezillon" <bbrezillon@kernel.org>,
"Sandy Huang" <hjc@rock-chips.com>,
"Yannick Fertre" <yannick.fertre@st.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Brian Starkey" <brian.starkey@arm.com>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Stefan Agner" <stefan@agner.ch>,
"Melissa Wen" <melissa.srw@gmail.com>,
linux-tegra@vger.kernel.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Xinwei Kong" <kong.kongxinwei@hisilicon.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Chen-Yu Tsai" <wens@csie.org>,
"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"Chen Feng" <puck.chen@hisilicon.com>,
"Alison Wang" <alison.wang@nxp.com>,
spice-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Tomi Valkeinen" <tomba@kernel.org>,
"Philippe Cornu" <philippe.cornu@st.com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Tian Tao" <tiantao6@hisilicon.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Paul Cercueil" <paul@crapouillou.net>,
"Marek Vasut" <marex@denx.de>,
linux-renesas-soc@vger.kernel.org,
"Joonyoung Shim" <jy0922.shim@samsung.com>,
"Russell King" <linux@armlinux.org.uk>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Hans de Goede" <hdegoede@redhat.com>,
linux-mediatek@lists.infradead.org,
"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Jernej Skrabec" <jernej.skrabec@siol.net>,
linux-mips@vger.kernel.org, "Rob Clark" <robdclark@gmail.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jyri Sarha" <jyri.sarha@iki.fi>,
"Lucas Stach" <l.stach@pengutronix.de>
Subject: Re: [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update
Date: Fri, 22 Jan 2021 01:03:42 +0200 [thread overview]
Message-ID: <YAoITqHbG1UeiAHV@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210121163537.1466118-9-maxime@cerno.tech>
Hi Maxime,
Thank you for the patch.
On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote:
> The current atomic helpers have either their object state being passed as
> an argument or the full atomic state.
>
> The former is the pattern that was done at first, before switching to the
> latter for new hooks or when it was needed.
>
> Let's convert the remaining helpers to provide a consistent interface,
> this time with the planes atomic_update and atomic_disable.
>
> The conversion was done using the coccinelle script below, built tested on
> all the drivers.
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_update)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_disable)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_disable = func,
> ...,
> };
> )
>
> @@
> struct drm_plane_helper_funcs *FUNCS;
> identifier f;
> identifier crtc_state;
> identifier plane, plane_state, state;
> expression e;
> @@
>
> f(struct drm_crtc_state *crtc_state)
> {
> ...
> struct drm_atomic_state *state = e;
> <+...
> (
> - FUNCS->atomic_disable(plane, plane_state)
> + FUNCS->atomic_disable(plane, state)
> |
> - FUNCS->atomic_update(plane, plane_state)
> + FUNCS->atomic_update(plane, state)
> )
> ...+>
> }
>
> @@
> identifier plane_atomic_func.func;
> identifier plane;
> symbol state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *old_plane_state)
> {
> <...
> - state
> + old_plane_state
> ...>
> }
>
> @ ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, old_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *old_state)
> {
> ... when != old_state
> }
>
> @ adds_old_state depends on plane_atomic_func && !ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *plane_state)
> {
> + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> ...
> }
>
> @ depends on plane_atomic_func @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *plane_state
> + struct drm_atomic_state *state
> )
> { ... }
>
> @ include depends on adds_old_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_old_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> @@
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_atomic_state *state) {
> ...
> struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> <+...
> - plane_state->state
> + state
> ...+>
> }
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> Changes from v1:
> - Reintroduce the old_plane_state check in zynqmp_disp_crtc_atomic_disable
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++-
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 ++++--
> drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++-
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +++-
> drivers/gpu/drm/tidss/tidss_plane.c | 4 ++--
> drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 15 ++++++++-------
> include/drm/drm_modeset_helper_vtables.h | 4 ++--
For these,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 58 files changed, 211 insertions(+), 123 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: "Heiko Stübner" <heiko@sntech.de>,
"Xinliang Liu" <xinliang.liu@linaro.org>,
dri-devel@lists.freedesktop.org,
"Anitha Chrisanthus" <anitha.chrisanthus@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
"Jerome Brunet" <jbrunet@baylibre.com>,
linux-samsung-soc@vger.kernel.org,
"Vincent Abriou" <vincent.abriou@st.com>,
"Michal Simek" <michal.simek@xilinx.com>,
"Ludovic Desroches" <ludovic.desroches@microchip.com>,
"NXP Linux Team" <linux-imx@nxp.com>,
"VMware Graphics" <linux-graphics-maintainer@vmware.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Roland Scheidegger" <sroland@vmware.com>,
"Inki Dae" <inki.dae@samsung.com>, "Sean Paul" <sean@poorly.run>,
"Hyun Kwon" <hyun.kwon@xilinx.com>,
"Seung-Woo Kim" <sw0312.kim@samsung.com>,
linux-kernel@vger.kernel.org,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
freedreno@lists.freedesktop.org, "Zack Rusin" <zackr@vmware.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"David Airlie" <airlied@linux.ie>,
"Edmund Dea" <edmund.j.dea@intel.com>,
virtualization@lists.linux-foundation.org,
"Eric Anholt" <eric@anholt.net>,
"Thierry Reding" <thierry.reding@gmail.com>,
"Daniel Vetter" <daniel.vetter@intel.com>,
"Mihail Atanassov" <mihail.atanassov@arm.com>,
"Fabio Estevam" <festevam@gmail.com>,
"Alexey Brodkin" <abrodkin@synopsys.com>,
"Jonathan Hunter" <jonathanh@nvidia.com>,
linux-rockchip@lists.infradead.org,
"James (Qian) Wang" <james.qian.wang@arm.com>,
"Dave Airlie" <airlied@redhat.com>,
"Alexandre Torgue" <alexandre.torgue@st.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
linux-arm-msm@vger.kernel.org,
"Maxime Ripard" <mripard@kernel.org>,
"John Stultz" <john.stultz@linaro.org>,
linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
"Rodrigo Siqueira" <rodrigosiqueiramelo@gmail.com>,
"Boris Brezillon" <bbrezillon@kernel.org>,
"Sandy Huang" <hjc@rock-chips.com>,
"Yannick Fertre" <yannick.fertre@st.com>,
"Kyungmin Park" <kyungmin.park@samsung.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Kevin Hilman" <khilman@baylibre.com>,
"Brian Starkey" <brian.starkey@arm.com>,
"Haneen Mohammed" <hamohammed.sa@gmail.com>,
"Neil Armstrong" <narmstrong@baylibre.com>,
"Stefan Agner" <stefan@agner.ch>,
"Melissa Wen" <melissa.srw@gmail.com>,
linux-tegra@vger.kernel.org,
"Benjamin Gaignard" <benjamin.gaignard@linaro.org>,
"Sam Ravnborg" <sam@ravnborg.org>,
"Xinwei Kong" <kong.kongxinwei@hisilicon.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Chen-Yu Tsai" <wens@csie.org>,
"Chun-Kuang Hu" <chunkuang.hu@kernel.org>,
"Chen Feng" <puck.chen@hisilicon.com>,
"Alison Wang" <alison.wang@nxp.com>,
spice-devel@lists.freedesktop.org,
"Daniel Vetter" <daniel@ffwll.ch>,
"Tomi Valkeinen" <tomba@kernel.org>,
"Philippe Cornu" <philippe.cornu@st.com>,
"Kieran Bingham" <kieran.bingham+renesas@ideasonboard.com>,
"Tian Tao" <tiantao6@hisilicon.com>,
"Shawn Guo" <shawnguo@kernel.org>,
"Liviu Dudau" <liviu.dudau@arm.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Paul Cercueil" <paul@crapouillou.net>,
"Marek Vasut" <marex@denx.de>,
linux-renesas-soc@vger.kernel.org,
"Joonyoung Shim" <jy0922.shim@samsung.com>,
"Russell King" <linux@armlinux.org.uk>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Hans de Goede" <hdegoede@redhat.com>,
linux-mediatek@lists.infradead.org,
"Laurentiu Palcu" <laurentiu.palcu@oss.nxp.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Jernej Skrabec" <jernej.skrabec@siol.net>,
linux-mips@vger.kernel.org, "Rob Clark" <robdclark@gmail.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Jyri Sarha" <jyri.sarha@iki.fi>,
"Lucas Stach" <l.stach@pengutronix.de>
Subject: Re: [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update
Date: Fri, 22 Jan 2021 01:03:42 +0200 [thread overview]
Message-ID: <YAoITqHbG1UeiAHV@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210121163537.1466118-9-maxime@cerno.tech>
Hi Maxime,
Thank you for the patch.
On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote:
> The current atomic helpers have either their object state being passed as
> an argument or the full atomic state.
>
> The former is the pattern that was done at first, before switching to the
> latter for new hooks or when it was needed.
>
> Let's convert the remaining helpers to provide a consistent interface,
> this time with the planes atomic_update and atomic_disable.
>
> The conversion was done using the coccinelle script below, built tested on
> all the drivers.
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_update)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_disable)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_disable = func,
> ...,
> };
> )
>
> @@
> struct drm_plane_helper_funcs *FUNCS;
> identifier f;
> identifier crtc_state;
> identifier plane, plane_state, state;
> expression e;
> @@
>
> f(struct drm_crtc_state *crtc_state)
> {
> ...
> struct drm_atomic_state *state = e;
> <+...
> (
> - FUNCS->atomic_disable(plane, plane_state)
> + FUNCS->atomic_disable(plane, state)
> |
> - FUNCS->atomic_update(plane, plane_state)
> + FUNCS->atomic_update(plane, state)
> )
> ...+>
> }
>
> @@
> identifier plane_atomic_func.func;
> identifier plane;
> symbol state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *old_plane_state)
> {
> <...
> - state
> + old_plane_state
> ...>
> }
>
> @ ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, old_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *old_state)
> {
> ... when != old_state
> }
>
> @ adds_old_state depends on plane_atomic_func && !ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *plane_state)
> {
> + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> ...
> }
>
> @ depends on plane_atomic_func @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *plane_state
> + struct drm_atomic_state *state
> )
> { ... }
>
> @ include depends on adds_old_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_old_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> @@
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_atomic_state *state) {
> ...
> struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> <+...
> - plane_state->state
> + state
> ...+>
> }
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> Changes from v1:
> - Reintroduce the old_plane_state check in zynqmp_disp_crtc_atomic_disable
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++-
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 ++++--
> drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++-
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +++-
> drivers/gpu/drm/tidss/tidss_plane.c | 4 ++--
> drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 15 ++++++++-------
> include/drm/drm_modeset_helper_vtables.h | 4 ++--
For these,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 58 files changed, 211 insertions(+), 123 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <maxime@cerno.tech>
Cc: Xinliang Liu <xinliang.liu@linaro.org>,
dri-devel@lists.freedesktop.org,
Anitha Chrisanthus <anitha.chrisanthus@intel.com>,
linux-stm32@st-md-mailman.stormreply.com,
Jerome Brunet <jbrunet@baylibre.com>,
linux-samsung-soc@vger.kernel.org,
Vincent Abriou <vincent.abriou@st.com>,
Michal Simek <michal.simek@xilinx.com>,
Ludovic Desroches <ludovic.desroches@microchip.com>,
NXP Linux Team <linux-imx@nxp.com>,
VMware Graphics <linux-graphics-maintainer@vmware.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Roland Scheidegger <sroland@vmware.com>,
Sean Paul <sean@poorly.run>, Hyun Kwon <hyun.kwon@xilinx.com>,
Seung-Woo Kim <sw0312.kim@samsung.com>,
linux-kernel@vger.kernel.org,
Pengutronix Kernel Team <kernel@pengutronix.de>,
freedreno@lists.freedesktop.org,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
David Airlie <airlied@linux.ie>,
Edmund Dea <edmund.j.dea@intel.com>,
virtualization@lists.linux-foundation.org,
Thierry Reding <thierry.reding@gmail.com>,
Daniel Vetter <daniel.vetter@intel.com>,
Mihail Atanassov <mihail.atanassov@arm.com>,
Alexey Brodkin <abrodkin@synopsys.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-rockchip@lists.infradead.org,
"James \(Qian\) Wang" <james.qian.wang@arm.com>,
Dave Airlie <airlied@redhat.com>,
Alexandre Torgue <alexandre.torgue@st.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-arm-msm@vger.kernel.org, linux-amlogic@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
Boris Brezillon <bbrezillon@kernel.org>,
Sandy Huang <hjc@rock-chips.com>,
Yannick Fertre <yannick.fertre@st.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Kevin Hilman <khilman@baylibre.com>,
Haneen Mohammed <hamohammed.sa@gmail.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Melissa Wen <melissa.srw@gmail.com>,
linux-tegra@vger.kernel.org, Gerd Hoffmann <kraxel@redhat.com>,
Sam Ravnborg <sam@ravnborg.org>,
Xinwei Kong <kong.kongxinwei@hisilicon.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Chen-Yu Tsai <wens@csie.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Chen Feng <puck.chen@hisilicon.com>,
Alison Wang <alison.wang@nxp.com>,
spice-devel@lists.freedesktop.org,
Tomi Valkeinen <tomba@kernel.org>,
Philippe Cornu <philippe.cornu@st.com>,
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Tian Tao <tiantao6@hisilicon.com>,
Shawn Guo <shawnguo@kernel.org>,
Liviu Dudau <liviu.dudau@arm.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Paul Cercueil <paul@crapouillou.net>, Marek Vasut <marex@denx.de>,
linux-renesas-soc@vger.kernel.org,
Joonyoung Shim <jy0922.shim@samsung.com>,
Russell King <linux@armlinux.org.uk>,
Thomas Zimmermann <tzimmermann@suse.de>,
Hans de Goede <hdegoede@redhat.com>,
linux-mediatek@lists.infradead.org,
Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
Matthias Brugger <matthias.bgg@gmail.com>,
Jernej Skrabec <jernej.skrabec@siol.net>,
linux-mips@vger.kernel.org, Jyri Sarha <jyri.sarha@iki.fi>
Subject: Re: [PATCH v2 09/11] drm/atomic: Pass the full state to planes atomic disable and update
Date: Fri, 22 Jan 2021 01:03:42 +0200 [thread overview]
Message-ID: <YAoITqHbG1UeiAHV@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210121163537.1466118-9-maxime@cerno.tech>
Hi Maxime,
Thank you for the patch.
On Thu, Jan 21, 2021 at 05:35:34PM +0100, Maxime Ripard wrote:
> The current atomic helpers have either their object state being passed as
> an argument or the full atomic state.
>
> The former is the pattern that was done at first, before switching to the
> latter for new hooks or when it was needed.
>
> Let's convert the remaining helpers to provide a consistent interface,
> this time with the planes atomic_update and atomic_disable.
>
> The conversion was done using the coccinelle script below, built tested on
> all the drivers.
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_update)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @@
> identifier plane, plane_state;
> symbol state;
> @@
>
> struct drm_plane_helper_funcs {
> ...
> void (*atomic_disable)(struct drm_plane *plane,
> - struct drm_plane_state *plane_state);
> + struct drm_atomic_state *state);
> ...
> }
>
> @ plane_atomic_func @
> identifier helpers;
> identifier func;
> @@
>
> (
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_update = func,
> ...,
> };
> |
> static const struct drm_plane_helper_funcs helpers = {
> ...,
> .atomic_disable = func,
> ...,
> };
> )
>
> @@
> struct drm_plane_helper_funcs *FUNCS;
> identifier f;
> identifier crtc_state;
> identifier plane, plane_state, state;
> expression e;
> @@
>
> f(struct drm_crtc_state *crtc_state)
> {
> ...
> struct drm_atomic_state *state = e;
> <+...
> (
> - FUNCS->atomic_disable(plane, plane_state)
> + FUNCS->atomic_disable(plane, state)
> |
> - FUNCS->atomic_update(plane, plane_state)
> + FUNCS->atomic_update(plane, state)
> )
> ...+>
> }
>
> @@
> identifier plane_atomic_func.func;
> identifier plane;
> symbol state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *state)
> + struct drm_plane_state *old_plane_state)
> {
> <...
> - state
> + old_plane_state
> ...>
> }
>
> @ ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, old_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *old_state)
> {
> ... when != old_state
> }
>
> @ adds_old_state depends on plane_atomic_func && !ignores_old_state @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_plane_state *plane_state)
> {
> + struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> ...
> }
>
> @ depends on plane_atomic_func @
> identifier plane_atomic_func.func;
> identifier plane, plane_state;
> @@
>
> func(struct drm_plane *plane,
> - struct drm_plane_state *plane_state
> + struct drm_atomic_state *state
> )
> { ... }
>
> @ include depends on adds_old_state @
> @@
>
> #include <drm/drm_atomic.h>
>
> @ no_include depends on !include && adds_old_state @
> @@
>
> + #include <drm/drm_atomic.h>
> #include <drm/...>
>
> @@
> identifier plane_atomic_func.func;
> identifier plane, state;
> identifier plane_state;
> @@
>
> func(struct drm_plane *plane, struct drm_atomic_state *state) {
> ...
> struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> <+...
> - plane_state->state
> + state
> ...+>
> }
>
> Signed-off-by: Maxime Ripard <maxime@cerno.tech>
>
> ---
>
> Changes from v1:
> - Reintroduce the old_plane_state check in zynqmp_disp_crtc_atomic_disable
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++----
> drivers/gpu/drm/drm_simple_kms_helper.c | 4 +++-
> drivers/gpu/drm/mxsfb/mxsfb_kms.c | 6 ++++--
> drivers/gpu/drm/omapdrm/omap_plane.c | 4 ++--
> drivers/gpu/drm/rcar-du/rcar_du_plane.c | 4 +++-
> drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 4 +++-
> drivers/gpu/drm/tidss/tidss_plane.c | 4 ++--
> drivers/gpu/drm/tilcdc/tilcdc_plane.c | 2 +-
> drivers/gpu/drm/xlnx/zynqmp_disp.c | 15 ++++++++-------
> include/drm/drm_modeset_helper_vtables.h | 4 ++--
For these,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 58 files changed, 211 insertions(+), 123 deletions(-)
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2021-01-21 23:04 UTC|newest]
Thread overview: 81+ 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 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` 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 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 03/11] drm/atmel-hlcdc: Rename custom plane state variable Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` 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 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` 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 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 06/11] drm: Use state helper instead of plane state pointer in atomic_check Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-22 12:07 ` Ville Syrjälä
2021-01-22 12:07 ` Ville Syrjälä
2021-01-22 12:07 ` Ville Syrjälä
2021-01-25 9:07 ` Maxime Ripard
2021-01-25 9:07 ` Maxime Ripard
2021-01-25 9:07 ` 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 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` [PATCH v2 08/11] drm: Rename plane->state variables in atomic update " Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-22 12:15 ` Ville Syrjälä
2021-01-22 12:15 ` Ville Syrjälä
2021-01-22 12:15 ` Ville Syrjälä
2021-01-22 12:15 ` Ville Syrjälä
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 10:52 ` Maxime Ripard
2021-01-25 11:52 ` Ville Syrjälä
2021-01-25 11:52 ` Ville Syrjälä
2021-01-25 11:52 ` Ville Syrjälä
2021-01-25 11:52 ` Ville Syrjälä
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 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 23:03 ` Laurent Pinchart [this message]
2021-01-21 23:03 ` Laurent Pinchart
2021-01-21 23:03 ` Laurent Pinchart
2021-01-21 23:03 ` Laurent Pinchart
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-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-26 13:24 ` Ville Syrjälä
2021-01-26 13:24 ` Ville Syrjälä
2021-01-26 13:24 ` Ville Syrjälä
2021-01-26 13:24 ` Ville Syrjälä
2021-01-26 13:24 ` Ville Syrjälä
2021-01-26 13:24 ` Ville Syrjälä
2021-01-21 16:35 ` [PATCH v2 11/11] drm/todo: Remove the drm_atomic_state todo item Maxime Ripard
2021-01-21 16:35 ` Maxime Ripard
2021-01-21 18:27 ` Daniel Vetter
2021-01-21 18:27 ` Daniel Vetter
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=YAoITqHbG1UeiAHV@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.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=bbrezillon@kernel.org \
--cc=benjamin.gaignard@linaro.org \
--cc=brian.starkey@arm.com \
--cc=chunkuang.hu@kernel.org \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=edmund.j.dea@intel.com \
--cc=eric@anholt.net \
--cc=festevam@gmail.com \
--cc=freedreno@lists.freedesktop.org \
--cc=hamohammed.sa@gmail.com \
--cc=hdegoede@redhat.com \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=hyun.kwon@xilinx.com \
--cc=inki.dae@samsung.com \
--cc=james.qian.wang@arm.com \
--cc=jbrunet@baylibre.com \
--cc=jernej.skrabec@siol.net \
--cc=john.stultz@linaro.org \
--cc=jonathanh@nvidia.com \
--cc=jy0922.shim@samsung.com \
--cc=jyri.sarha@iki.fi \
--cc=kernel@pengutronix.de \
--cc=khilman@baylibre.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=kong.kongxinwei@hisilicon.com \
--cc=kraxel@redhat.com \
--cc=krzk@kernel.org \
--cc=kyungmin.park@samsung.com \
--cc=l.stach@pengutronix.de \
--cc=laurentiu.palcu@oss.nxp.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-graphics-maintainer@vmware.com \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--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-stm32@st-md-mailman.stormreply.com \
--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=matthias.bgg@gmail.com \
--cc=maxime@cerno.tech \
--cc=mcoquelin.stm32@gmail.com \
--cc=melissa.srw@gmail.com \
--cc=michal.simek@xilinx.com \
--cc=mihail.atanassov@arm.com \
--cc=mripard@kernel.org \
--cc=narmstrong@baylibre.com \
--cc=nicolas.ferre@microchip.com \
--cc=p.zabel@pengutronix.de \
--cc=paul@crapouillou.net \
--cc=philippe.cornu@st.com \
--cc=puck.chen@hisilicon.com \
--cc=robdclark@gmail.com \
--cc=rodrigosiqueiramelo@gmail.com \
--cc=s.hauer@pengutronix.de \
--cc=sam@ravnborg.org \
--cc=sean@poorly.run \
--cc=shawnguo@kernel.org \
--cc=spice-devel@lists.freedesktop.org \
--cc=sroland@vmware.com \
--cc=stefan@agner.ch \
--cc=sw0312.kim@samsung.com \
--cc=thierry.reding@gmail.com \
--cc=tiantao6@hisilicon.com \
--cc=tomba@kernel.org \
--cc=tzimmermann@suse.de \
--cc=vincent.abriou@st.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=wens@csie.org \
--cc=xinliang.liu@linaro.org \
--cc=yannick.fertre@st.com \
--cc=zackr@vmware.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.