1. 09 Mar, 2021 1 commit
  2. 08 Mar, 2021 4 commits
  3. 07 Mar, 2021 1 commit
  4. 04 Mar, 2021 1 commit
  5. 02 Mar, 2021 2 commits
  6. 01 Mar, 2021 1 commit
  7. 26 Feb, 2021 3 commits
  8. 25 Feb, 2021 25 commits
  9. 24 Feb, 2021 2 commits
    • Maxime Ripard's avatar
      drm: Rename plane->state variables in atomic update and disable · 41016fe1
      Maxime Ripard authored
      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
      	...>
       }
      
      @ moves_new_state_oldstate @
      identifier plane_atomic_func.func;
      identifier plane;
      symbol oldstate;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *oldstate)
       {
       	...
      -	struct drm_plane_state *state = plane->state;
      +	struct drm_plane_state *newstate = plane->state;
      	...
       }
      
      @ depends on moves_new_state_oldstate @
      identifier plane_atomic_func.func;
      identifier plane;
      identifier old_state;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_state)
       {
       	<...
      -	state
      +	newstate
      	...>
       }
      
      @ moves_new_state_old_pstate @
      identifier plane_atomic_func.func;
      identifier plane;
      symbol old_pstate;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_pstate)
       {
       	...
      -	struct drm_plane_state *state = plane->state;
      +	struct drm_plane_state *new_pstate = plane->state;
      	...
       }
      
      @ depends on moves_new_state_old_pstate @
      identifier plane_atomic_func.func;
      identifier plane;
      identifier old_pstate;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_pstate)
       {
       	<...
      -	state
      +	new_pstate
      	...>
       }
      Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/20210219120032.260676-8-maxime@cerno.tech
      41016fe1
    • Maxime Ripard's avatar
      drm: Store new plane state in a variable for atomic_update and disable · e05162c0
      Maxime Ripard authored
      In order to store the new plane state in a subsequent helper, let's move
      the plane->state dereferences into a variable.
      
      This was done using the following coccinelle script, plus some hand
      changes for vmwgfx:
      
      @ 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,
      	...,
       };
      )
      
      @ has_new_state_old_state @
      identifier plane_atomic_func.func;
      identifier plane;
      identifier new_state;
      symbol old_state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_state)
       {
       	...
       	struct drm_plane_state *new_state = plane->state;
      	...
       }
      
      @ depends on !has_new_state_old_state @
      identifier plane_atomic_func.func;
      identifier plane;
      symbol old_state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_state)
       {
      +	struct drm_plane_state *new_state = plane->state;
       	<+...
      -	plane->state
      +	new_state
      	...+>
       }
      
      @ has_new_state_state @
      identifier plane_atomic_func.func;
      identifier plane;
      identifier new_state;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *state)
       {
       	...
       	struct drm_plane_state *new_state = plane->state;
      	...
       }
      
      @ depends on !has_new_state_state @
      identifier plane_atomic_func.func;
      identifier plane;
      symbol state;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *state)
       {
      +	struct drm_plane_state *new_plane_state = plane->state;
       	<+...
      -	plane->state
      +	new_plane_state
      	...+>
       }
      
      @ has_new_state_old_s @
      identifier plane_atomic_func.func;
      identifier plane;
      identifier new_state;
      symbol old_s;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_s)
       {
       	...
       	struct drm_plane_state *new_state = plane->state;
      	...
       }
      
      @ depends on !has_new_state_old_s @
      identifier plane_atomic_func.func;
      identifier plane;
      symbol old_s;
      @@
      
       func(struct drm_plane *plane, struct drm_plane_state *old_s)
       {
      +	struct drm_plane_state *new_s = plane->state;
       	<+...
      -	plane->state
      +	new_s
      	...+>
       }
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
      Signed-off-by: default avatarMaxime Ripard <maxime@cerno.tech>
      Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
      Link: https://lore.kernel.org/r/20210219120032.260676-1-maxime@cerno.tech
      e05162c0