[PATCH 3/3] drm: Use the state pointer directly in atomic_check

Maxime Ripard maxime at cerno.tech
Tue Nov 3 10:07:59 UTC 2020


On Mon, Nov 02, 2020 at 06:06:04PM +0200, Ville Syrjälä wrote:
> On Mon, Nov 02, 2020 at 02:38:34PM +0100, Maxime Ripard wrote:
> > Now that atomic_check takes the global atomic state as a parameter, we
> > don't need to go through the pointer in the CRTC state.
> > 
> > This was done using the following coccinelle script:
> > 
> > @ crtc_atomic_func @
> > identifier helpers;
> > identifier func;
> > @@
> > 
> > static struct drm_crtc_helper_funcs helpers = {
> > 	...,
> > 	.atomic_check = func,
> > 	...,
> > };
> > 
> > @@
> > identifier crtc_atomic_func.func;
> > identifier crtc, state;
> > @@
> > 
> >   func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
> >   ...
> > - struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
> >   ... when != crtc_state
> > - crtc_state->state
> > + state
> >   ...
> >  }
> > 
> > @@
> > struct drm_crtc_state *crtc_state;
> > identifier crtc_atomic_func.func;
> > identifier crtc, state;
> > @@
> > 
> >   func(struct drm_crtc *crtc, struct drm_atomic_state *state) {
> >   ...
> > - crtc_state->state
> > + state
> >   ...
> >  }
> > 
> > Suggested-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > Signed-off-by: Maxime Ripard <maxime at cerno.tech>
> 
> lgtm
> Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Applied, thanks!
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20201103/57e028f8/attachment.sig>


More information about the dri-devel mailing list