All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Daniel Vetter <daniel.vetter@intel.com>,
	David Airlie <airlied@linux.ie>,
	Neil Armstrong <narmstrong@baylibre.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Liviu Dudau <liviu.dudau@arm.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	Paul Cercueil <paul@crapouillou.net>,
	linux-tegra@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
	Yannick Fertre <yannick.fertre@st.com>,
	linux-samsung-soc@vger.kernel.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	Kevin Hilman <khilman@baylibre.com>,
	linux-mediatek@lists.infradead.org,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-rockchip@lists.infradead.org,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	linux-arm-msm@vger.kernel.org, Dave Airlie <airlied@redhat.com>,
	linux-mips@vger.kernel.org,
	Chun-Kuang Hu <chunkuang.hu@kernel.org>,
	Alexandre Torgue <alexandre.torgue@st.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Alison Wang <alison.wang@nxp.com>,
	dri-devel@lists.freedesktop.org,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-amlogic@lists.infradead.org,
	freedreno@lists.freedesktop.org, Sean Paul <sean@poorly.run>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Sandy Huang <hjc@rock-chips.com>,
	linux-kernel@vger.kernel.org,
	Vincent Abriou <vincent.abriou@st.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Tian Tao <tiantao6@hisilicon.com>
Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable
Date: Mon, 25 Jan 2021 11:52:18 +0100	[thread overview]
Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> (raw)
In-Reply-To: <YArBy2DKdCct5cYW@intel.com>

[-- Attachment #1: Type: text/plain, Size: 2247 bytes --]

Hi Ville,

On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote:
> > Some drivers are storing the plane->state pointer in atomic_update and
> > atomic_disable in a variable simply called state, while the state passed
> > as an argument is called old_state.
> > 
> > In order to ease subsequent reworks and to avoid confusing or
> > inconsistent names, let's rename those variables to new_state.
> > 
> > This was done using the following coccinelle script, plus some manual
> > changes for mtk and tegra.
> > 
> > @ 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,
> > 	...,
> >  };
> > )
> > 
> > @ moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > symbol old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	...
> > -	struct drm_plane_state *state = plane->state;
> > +	struct drm_plane_state *new_state = plane->state;
> > 	...
> >  }
> > 
> > @ depends on moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > identifier old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	<...
> > -	state
> > +	new_state
> > 	...>
> 
> Was going to say that this migh eat something else, but I guess
> the dependency prevents that?

Yeah, the dependency takes care of this

> Another way to avoid that I suppose would be to declare 'state'
> as
> symbol moves_new_state_old_state.state;
> 
> That would probably make the intent a bit more obvious, even with
> the dependency. Or does a dependency somehow automagically imply
> that?

I'm not sure if it does, but it's a symbol here not an identifier or an
expression, so here moves_new_state_old_state.state would always resolve
to state (and only state) anyway

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
	linux-samsung-soc@vger.kernel.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	linux-rockchip@lists.infradead.org,
	Kevin Hilman <khilman@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sandy Huang <hjc@rock-chips.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	Dave Airlie <airlied@redhat.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-mediatek@lists.infradead.org,
	Vincent Abriou <vincent.abriou@st.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Sean Paul <sean@poorly.run>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	linux-kernel@vger.kernel.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Tian Tao <tiantao6@hisilicon.com>,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable
Date: Mon, 25 Jan 2021 11:52:18 +0100	[thread overview]
Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> (raw)
In-Reply-To: <YArBy2DKdCct5cYW@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]

Hi Ville,

On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote:
> > Some drivers are storing the plane->state pointer in atomic_update and
> > atomic_disable in a variable simply called state, while the state passed
> > as an argument is called old_state.
> > 
> > In order to ease subsequent reworks and to avoid confusing or
> > inconsistent names, let's rename those variables to new_state.
> > 
> > This was done using the following coccinelle script, plus some manual
> > changes for mtk and tegra.
> > 
> > @ 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,
> > 	...,
> >  };
> > )
> > 
> > @ moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > symbol old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	...
> > -	struct drm_plane_state *state = plane->state;
> > +	struct drm_plane_state *new_state = plane->state;
> > 	...
> >  }
> > 
> > @ depends on moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > identifier old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	<...
> > -	state
> > +	new_state
> > 	...>
> 
> Was going to say that this migh eat something else, but I guess
> the dependency prevents that?

Yeah, the dependency takes care of this

> Another way to avoid that I suppose would be to declare 'state'
> as
> symbol moves_new_state_old_state.state;
> 
> That would probably make the intent a bit more obvious, even with
> the dependency. Or does a dependency somehow automagically imply
> that?

I'm not sure if it does, but it's a symbol here not an identifier or an
expression, so here moves_new_state_old_state.state would always resolve
to state (and only state) anyway

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
	linux-samsung-soc@vger.kernel.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	linux-rockchip@lists.infradead.org,
	Kevin Hilman <khilman@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sandy Huang <hjc@rock-chips.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	Dave Airlie <airlied@redhat.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-mediatek@lists.infradead.org,
	Vincent Abriou <vincent.abriou@st.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Sean Paul <sean@poorly.run>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	linux-kernel@vger.kernel.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Tian Tao <tiantao6@hisilicon.com>,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable
Date: Mon, 25 Jan 2021 11:52:18 +0100	[thread overview]
Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> (raw)
In-Reply-To: <YArBy2DKdCct5cYW@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]

Hi Ville,

On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote:
> > Some drivers are storing the plane->state pointer in atomic_update and
> > atomic_disable in a variable simply called state, while the state passed
> > as an argument is called old_state.
> > 
> > In order to ease subsequent reworks and to avoid confusing or
> > inconsistent names, let's rename those variables to new_state.
> > 
> > This was done using the following coccinelle script, plus some manual
> > changes for mtk and tegra.
> > 
> > @ 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,
> > 	...,
> >  };
> > )
> > 
> > @ moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > symbol old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	...
> > -	struct drm_plane_state *state = plane->state;
> > +	struct drm_plane_state *new_state = plane->state;
> > 	...
> >  }
> > 
> > @ depends on moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > identifier old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	<...
> > -	state
> > +	new_state
> > 	...>
> 
> Was going to say that this migh eat something else, but I guess
> the dependency prevents that?

Yeah, the dependency takes care of this

> Another way to avoid that I suppose would be to declare 'state'
> as
> symbol moves_new_state_old_state.state;
> 
> That would probably make the intent a bit more obvious, even with
> the dependency. Or does a dependency somehow automagically imply
> that?

I'm not sure if it does, but it's a symbol here not an identifier or an
expression, so here moves_new_state_old_state.state would always resolve
to state (and only state) anyway

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
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: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
	linux-samsung-soc@vger.kernel.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	linux-rockchip@lists.infradead.org,
	Kevin Hilman <khilman@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sandy Huang <hjc@rock-chips.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	Dave Airlie <airlied@redhat.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>,
	linux-mediatek@lists.infradead.org,
	Vincent Abriou <vincent.abriou@st.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Sean Paul <sean@poorly.run>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	linux-kernel@vger.kernel.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Tian Tao <tiantao6@hisilicon.com>,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable
Date: Mon, 25 Jan 2021 11:52:18 +0100	[thread overview]
Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> (raw)
In-Reply-To: <YArBy2DKdCct5cYW@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]

Hi Ville,

On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote:
> > Some drivers are storing the plane->state pointer in atomic_update and
> > atomic_disable in a variable simply called state, while the state passed
> > as an argument is called old_state.
> > 
> > In order to ease subsequent reworks and to avoid confusing or
> > inconsistent names, let's rename those variables to new_state.
> > 
> > This was done using the following coccinelle script, plus some manual
> > changes for mtk and tegra.
> > 
> > @ 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,
> > 	...,
> >  };
> > )
> > 
> > @ moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > symbol old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	...
> > -	struct drm_plane_state *state = plane->state;
> > +	struct drm_plane_state *new_state = plane->state;
> > 	...
> >  }
> > 
> > @ depends on moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > identifier old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	<...
> > -	state
> > +	new_state
> > 	...>
> 
> Was going to say that this migh eat something else, but I guess
> the dependency prevents that?

Yeah, the dependency takes care of this

> Another way to avoid that I suppose would be to declare 'state'
> as
> symbol moves_new_state_old_state.state;
> 
> That would probably make the intent a bit more obvious, even with
> the dependency. Or does a dependency somehow automagically imply
> that?

I'm not sure if it does, but it's a symbol here not an identifier or an
expression, so here moves_new_state_old_state.state would always resolve
to state (and only state) anyway

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	David Airlie <airlied@linux.ie>,
	Liviu Dudau <liviu.dudau@arm.com>,
	dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Thierry Reding <thierry.reding@gmail.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	linux-stm32@st-md-mailman.stormreply.com,
	Jerome Brunet <jbrunet@baylibre.com>, Marek Vasut <marex@denx.de>,
	linux-samsung-soc@vger.kernel.org,
	Joonyoung Shim <jy0922.shim@samsung.com>,
	linux-rockchip@lists.infradead.org,
	Kevin Hilman <khilman@baylibre.com>,
	Russell King <linux@armlinux.org.uk>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Sandy Huang <hjc@rock-chips.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	Dave Airlie <airlied@redhat.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-mediatek@lists.infradead.org,
	Vincent Abriou <vincent.abriou@st.com>,
	Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>,
	linux-tegra@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Sean Paul <sean@poorly.run>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	linux-arm-kernel@lists.infradead.org,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Tomi Valkeinen <tomba@kernel.org>, Jyri Sarha <jyri.sarha@iki.fi>,
	Seung-Woo Kim <sw0312.kim@samsung.com>,
	Philippe Cornu <philippe.cornu@st.com>,
	linux-kernel@vger.kernel.org,
	Yannick Fertre <yannick.fertre@st.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Tian Tao <tiantao6@hisilicon.com>,
	freedreno@lists.freedesktop.org
Subject: Re: [PATCH v2 08/11] drm: Rename plane->state variables in atomic update and disable
Date: Mon, 25 Jan 2021 11:52:18 +0100	[thread overview]
Message-ID: <20210125105218.kv63vjbxz5b35hdo@gilmour> (raw)
In-Reply-To: <YArBy2DKdCct5cYW@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 2247 bytes --]

Hi Ville,

On Fri, Jan 22, 2021 at 02:15:07PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:33PM +0100, Maxime Ripard wrote:
> > Some drivers are storing the plane->state pointer in atomic_update and
> > atomic_disable in a variable simply called state, while the state passed
> > as an argument is called old_state.
> > 
> > In order to ease subsequent reworks and to avoid confusing or
> > inconsistent names, let's rename those variables to new_state.
> > 
> > This was done using the following coccinelle script, plus some manual
> > changes for mtk and tegra.
> > 
> > @ 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,
> > 	...,
> >  };
> > )
> > 
> > @ moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > symbol old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	...
> > -	struct drm_plane_state *state = plane->state;
> > +	struct drm_plane_state *new_state = plane->state;
> > 	...
> >  }
> > 
> > @ depends on moves_new_state_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane;
> > identifier old_state;
> > symbol state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_plane_state *old_state)
> >  {
> >  	<...
> > -	state
> > +	new_state
> > 	...>
> 
> Was going to say that this migh eat something else, but I guess
> the dependency prevents that?

Yeah, the dependency takes care of this

> Another way to avoid that I suppose would be to declare 'state'
> as
> symbol moves_new_state_old_state.state;
> 
> That would probably make the intent a bit more obvious, even with
> the dependency. Or does a dependency somehow automagically imply
> that?

I'm not sure if it does, but it's a symbol here not an identifier or an
expression, so here moves_new_state_old_state.state would always resolve
to state (and only state) anyway

Maxime

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 167 bytes --]

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2021-01-26 19:22 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 [this message]
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
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=20210125105218.kv63vjbxz5b35hdo@gilmour \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=alexandre.torgue@st.com \
    --cc=alison.wang@nxp.com \
    --cc=chunkuang.hu@kernel.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=hjc@rock-chips.com \
    --cc=jbrunet@baylibre.com \
    --cc=jonathanh@nvidia.com \
    --cc=jy0922.shim@samsung.com \
    --cc=jyri.sarha@iki.fi \
    --cc=kernel@pengutronix.de \
    --cc=khilman@baylibre.com \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --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-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@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=maarten.lankhorst@linux.intel.com \
    --cc=marex@denx.de \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mcoquelin.stm32@gmail.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=sean@poorly.run \
    --cc=sw0312.kim@samsung.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiantao6@hisilicon.com \
    --cc=tomba@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    --cc=vincent.abriou@st.com \
    --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 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.