Re: [Intel-gfx] [PATCH 19/19] drm/atomic: Rename atomic oldnew iterator
On Mon, Oct 17, 2016 at 02:37:18PM +0200, Maarten Lankhorst wrote: > With the old users of for_each_obj_in_state gone, we can rename > for_each_oldnew_obj_in_state back to that name. It's slightly less > ugly. > > Signed-off-by: Maarten Lankhorst Simple sed/coccinelle job I presume. Assuming the tool works Reviewed-by: Ville Syrjälä > --- > drivers/gpu/drm/drm_atomic_helper.c | 34 > ++--- > drivers/gpu/drm/drm_blend.c | 4 ++-- > drivers/gpu/drm/i915/intel_display.c| 16 +++--- > drivers/gpu/drm/imx/imx-drm-core.c | 2 +- > drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 2 +- > drivers/gpu/drm/msm/msm_atomic.c| 2 +- > drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- > drivers/gpu/drm/vc4/vc4_kms.c | 2 +- > include/drm/drm_atomic.h| 30 +++-- > 9 files changed, 35 insertions(+), 59 deletions(-) > > diff --git a/drivers/gpu/drm/drm_atomic_helper.c > b/drivers/gpu/drm/drm_atomic_helper.c > index c8aba493fc17..8fb955181641 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -241,7 +241,7 @@ steal_encoder(struct drm_atomic_state *state, > struct drm_connector_state *old_connector_state, *new_connector_state; > int i; > > - for_each_oldnew_connector_in_state(state, connector, > old_connector_state, new_connector_state, i) { > + for_each_connector_in_state(state, connector, old_connector_state, > new_connector_state, i) { > struct drm_crtc *encoder_crtc; > > if (new_connector_state->best_encoder != encoder) > @@ -482,7 +482,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, > struct drm_connector_state *old_connector_state, *new_connector_state; > int i, ret; > > - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, > new_crtc_state, i) { > + for_each_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { > if (!drm_mode_equal(&old_crtc_state->mode, > &new_crtc_state->mode)) { > DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n", >crtc->base.id, crtc->name); > @@ -510,7 +510,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, > if (ret) > return ret; > > - for_each_oldnew_connector_in_state(state, connector, > old_connector_state, new_connector_state, i) { > + for_each_connector_in_state(state, connector, old_connector_state, > new_connector_state, i) { > /* >* This only sets crtc->connectors_changed for routing changes, >* drivers must set crtc->connectors_changed themselves when > @@ -529,7 +529,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, >* configuration. This must be done before calling mode_fixup in case a >* crtc only changed its mode but has the same set of connectors. >*/ > - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, > new_crtc_state, i) { > + for_each_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { > bool has_connectors = > !!new_crtc_state->connector_mask; > > @@ -685,7 +685,7 @@ disable_outputs(struct drm_device *dev, struct > drm_atomic_state *old_state) > struct drm_crtc_state *old_crtc_state, *new_crtc_state; > int i; > > - for_each_oldnew_connector_in_state(old_state, connector, > old_conn_state, new_conn_state, i) { > + for_each_connector_in_state(old_state, connector, old_conn_state, > new_conn_state, i) { > const struct drm_encoder_helper_funcs *funcs; > struct drm_encoder *encoder; > > @@ -733,7 +733,7 @@ disable_outputs(struct drm_device *dev, struct > drm_atomic_state *old_state) > drm_bridge_post_disable(encoder->bridge); > } > > - for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, > new_crtc_state, i) { > + for_each_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, > i) { > const struct drm_crtc_helper_funcs *funcs; > > /* Shut down everything that needs a full modeset. */ > @@ -785,7 +785,7 @@ drm_atomic_helper_update_legacy_modeset_state(struct > drm_device *dev, > int i; > > /* clear out existing links and update dpms */ > - for_each_oldnew_connector_in_state(old_state, connector, > old_conn_state, new_conn_state, i) { > + for_each_connector_in_state(old_state, connector, old_conn_state, > new_conn_state, i) { > if (connector->encoder) { > WARN_ON(!connector->encoder->crtc); > > @@ -1074,7 +1074,7 @@ bool drm_atomic_helper_framebuffer_changed(struct > drm_device *dev, > struct drm_plane_state *old_plane_state, *new_plane_state; > int i; > > - for_each_oldnew_plane_in_state(old_state, pla
[Intel-gfx] [PATCH 19/19] drm/atomic: Rename atomic oldnew iterator
With the old users of for_each_obj_in_state gone, we can rename for_each_oldnew_obj_in_state back to that name. It's slightly less ugly. Signed-off-by: Maarten Lankhorst --- drivers/gpu/drm/drm_atomic_helper.c | 34 ++--- drivers/gpu/drm/drm_blend.c | 4 ++-- drivers/gpu/drm/i915/intel_display.c| 16 +++--- drivers/gpu/drm/imx/imx-drm-core.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_kms.c | 2 +- drivers/gpu/drm/msm/msm_atomic.c| 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/vc4/vc4_kms.c | 2 +- include/drm/drm_atomic.h| 30 +++-- 9 files changed, 35 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index c8aba493fc17..8fb955181641 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c @@ -241,7 +241,7 @@ steal_encoder(struct drm_atomic_state *state, struct drm_connector_state *old_connector_state, *new_connector_state; int i; - for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i) { + for_each_connector_in_state(state, connector, old_connector_state, new_connector_state, i) { struct drm_crtc *encoder_crtc; if (new_connector_state->best_encoder != encoder) @@ -482,7 +482,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_connector_state *old_connector_state, *new_connector_state; int i, ret; - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + for_each_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { if (!drm_mode_equal(&old_crtc_state->mode, &new_crtc_state->mode)) { DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n", crtc->base.id, crtc->name); @@ -510,7 +510,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, if (ret) return ret; - for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i) { + for_each_connector_in_state(state, connector, old_connector_state, new_connector_state, i) { /* * This only sets crtc->connectors_changed for routing changes, * drivers must set crtc->connectors_changed themselves when @@ -529,7 +529,7 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, * configuration. This must be done before calling mode_fixup in case a * crtc only changed its mode but has the same set of connectors. */ - for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { + for_each_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) { bool has_connectors = !!new_crtc_state->connector_mask; @@ -685,7 +685,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) struct drm_crtc_state *old_crtc_state, *new_crtc_state; int i; - for_each_oldnew_connector_in_state(old_state, connector, old_conn_state, new_conn_state, i) { + for_each_connector_in_state(old_state, connector, old_conn_state, new_conn_state, i) { const struct drm_encoder_helper_funcs *funcs; struct drm_encoder *encoder; @@ -733,7 +733,7 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) drm_bridge_post_disable(encoder->bridge); } - for_each_oldnew_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { + for_each_crtc_in_state(old_state, crtc, old_crtc_state, new_crtc_state, i) { const struct drm_crtc_helper_funcs *funcs; /* Shut down everything that needs a full modeset. */ @@ -785,7 +785,7 @@ drm_atomic_helper_update_legacy_modeset_state(struct drm_device *dev, int i; /* clear out existing links and update dpms */ - for_each_oldnew_connector_in_state(old_state, connector, old_conn_state, new_conn_state, i) { + for_each_connector_in_state(old_state, connector, old_conn_state, new_conn_state, i) { if (connector->encoder) { WARN_ON(!connector->encoder->crtc); @@ -1074,7 +1074,7 @@ bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev, struct drm_plane_state *old_plane_state, *new_plane_state; int i; - for_each_oldnew_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) { + for_each_plane_in_state(old_state, plane, old_plane_state, new_plane_state, i) { if (new_plane_state->crtc != crtc && old_plane_state->crtc != crtc) continue; @@ -111