dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime@cerno.tech>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>,
	Tomi Valkeinen <tomba@kernel.org>,
	David Airlie <airlied@linux.ie>,
	freedreno@lists.freedesktop.org,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Jyri Sarha <jyri.sarha@iki.fi>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	NXP Linux Team <linux-imx@nxp.com>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	linux-arm-msm@vger.kernel.org,
	Daniel Vetter <daniel.vetter@intel.com>,
	Sean Paul <sean@poorly.run>, Shawn Guo <shawnguo@kernel.org>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 06/11] drm: Use state helper instead of plane state pointer in atomic_check
Date: Mon, 25 Jan 2021 10:07:44 +0100	[thread overview]
Message-ID: <20210125090744.txiofqzevcoturyl@gilmour> (raw)
In-Reply-To: <YAq/+udQfTwdamQ0@intel.com>


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

Hi Ville,

On Fri, Jan 22, 2021 at 02:07:22PM +0200, Ville Syrjälä wrote:
> On Thu, Jan 21, 2021 at 05:35:31PM +0100, Maxime Ripard wrote:
> > Many drivers reference the plane->state pointer in order to get the
> > current plane state in their atomic_check hook, which would be the old
> > plane state in the global atomic state since _swap_state hasn't happened
> > when atomic_check is run.
> > 
> > Use the drm_atomic_get_old_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 struct drm_plane_helper_funcs helpers = {
> > 	...,
> > 	.atomic_check = func,
> > 	...,
> > };
> > 
> > @ replaces_old_state @
> > identifier plane_atomic_func.func;
> > identifier plane, state, plane_state;
> > @@
> > 
> >  func(struct drm_plane *plane, struct drm_atomic_state *state) {
> >  	...
> > -	struct drm_plane_state *plane_state = plane->state;
> > +	struct drm_plane_state *plane_state = drm_atomic_get_old_plane_state(state, plane);
> >  	...
> >  }
> > 
> > @@
> > identifier plane_atomic_func.func;
> > identifier plane, state, 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
> > +	plane_state
> >  	...
> 
> We don't need the <... ...> style here? It's been a while since
> I did any serious cocci so I'm getting a bit rusty on the details...

You're right, I've changed it and caught some more users (ingenic). I'll update it.

> Otherwise looks great
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Thanks!
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

  reply	other threads:[~2021-01-26  8:38 UTC|newest]

Thread overview: 19+ 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 03/11] drm/atmel-hlcdc: Rename custom plane state variable 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 06/11] drm: Use state helper instead of plane state pointer in atomic_check Maxime Ripard
2021-01-22 12:07   ` Ville Syrjälä
2021-01-25  9:07     ` Maxime Ripard [this message]
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ä
2021-01-21 16:35 ` [PATCH v2 11/11] drm/todo: Remove the drm_atomic_state todo item Maxime Ripard
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=20210125090744.txiofqzevcoturyl@gilmour \
    --to=maxime@cerno.tech \
    --cc=airlied@linux.ie \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jyri.sarha@iki.fi \
    --cc=kernel@pengutronix.de \
    --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=s.hauer@pengutronix.de \
    --cc=sean@poorly.run \
    --cc=shawnguo@kernel.org \
    --cc=tomba@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=ville.syrjala@linux.intel.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).