Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm: Convert to use new iterator macros, v2.

for_each_obj_in_state is about to be removed, so convert
to the new iterator macros.

Just like in omap, use crtc_state->active instead of
crtc_state->enable when waiting for completion.

Changes since v1:
- Fix compilation.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Rob Herring <robh@kernel.org>
Cc: Markus Elfring <elfring@users.sourceforge.net>
Cc: Sushmita Susheelendra <ssusheel@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org
Cc: freedreno@lists.freedesktop.org
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170719143920.25685-6-maarten.lankhorst@linux.intel.com

+11 -11
+2 -2
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
··· 114 114 mdp4_enable(mdp4_kms); 115 115 116 116 /* see 119ecb7fd */ 117 - for_each_crtc_in_state(state, crtc, crtc_state, i) 117 + for_each_new_crtc_in_state(state, crtc, crtc_state, i) 118 118 drm_crtc_vblank_get(crtc); 119 119 } 120 120 ··· 126 126 struct drm_crtc_state *crtc_state; 127 127 128 128 /* see 119ecb7fd */ 129 - for_each_crtc_in_state(state, crtc, crtc_state, i) 129 + for_each_new_crtc_in_state(state, crtc, crtc_state, i) 130 130 drm_crtc_vblank_put(crtc); 131 131 132 132 mdp4_disable(mdp4_kms);
+9 -9
drivers/gpu/drm/msm/msm_atomic.c
··· 84 84 struct drm_atomic_state *old_state) 85 85 { 86 86 struct drm_crtc *crtc; 87 - struct drm_crtc_state *crtc_state; 87 + struct drm_crtc_state *new_crtc_state; 88 88 struct msm_drm_private *priv = old_state->dev->dev_private; 89 89 struct msm_kms *kms = priv->kms; 90 90 int i; 91 91 92 - for_each_crtc_in_state(old_state, crtc, crtc_state, i) { 93 - if (!crtc->state->enable) 92 + for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) { 93 + if (!new_crtc_state->active) 94 94 continue; 95 95 96 96 kms->funcs->wait_for_crtc_commit_done(kms, crtc); ··· 195 195 struct drm_crtc *crtc; 196 196 struct drm_crtc_state *crtc_state; 197 197 struct drm_plane *plane; 198 - struct drm_plane_state *plane_state; 198 + struct drm_plane_state *old_plane_state, *new_plane_state; 199 199 int i, ret; 200 200 201 201 ret = drm_atomic_helper_prepare_planes(dev, state); ··· 211 211 /* 212 212 * Figure out what crtcs we have: 213 213 */ 214 - for_each_crtc_in_state(state, crtc, crtc_state, i) 214 + for_each_new_crtc_in_state(state, crtc, crtc_state, i) 215 215 c->crtc_mask |= drm_crtc_mask(crtc); 216 216 217 217 /* 218 218 * Figure out what fence to wait for: 219 219 */ 220 - for_each_plane_in_state(state, plane, plane_state, i) { 221 - if ((plane->state->fb != plane_state->fb) && plane_state->fb) { 222 - struct drm_gem_object *obj = msm_framebuffer_bo(plane_state->fb, 0); 220 + for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) { 221 + if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) { 222 + struct drm_gem_object *obj = msm_framebuffer_bo(new_plane_state->fb, 0); 223 223 struct msm_gem_object *msm_obj = to_msm_bo(obj); 224 224 struct dma_fence *fence = reservation_object_get_excl_rcu(msm_obj->resv); 225 225 226 - drm_atomic_set_fence_for_plane(plane_state, fence); 226 + drm_atomic_set_fence_for_plane(new_plane_state, fence); 227 227 } 228 228 } 229 229