drm/msm: Convert to use new iterator macros, v2.
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Wed, 19 Jul 2017 14:39:18 +0000 (16:39 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Tue, 1 Aug 2017 09:11:59 +0000 (11:11 +0200)
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
drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c
drivers/gpu/drm/msm/msm_atomic.c

index bcd1f5cac72c9a239d9c956ac05d3d0fd614dc0e..f7f087419ed8bc936df5d461f9d3e98a09a50ea0 100644 (file)
@@ -114,7 +114,7 @@ static void mdp4_prepare_commit(struct msm_kms *kms, struct drm_atomic_state *st
        mdp4_enable(mdp4_kms);
 
        /* see 119ecb7fd */
-       for_each_crtc_in_state(state, crtc, crtc_state, i)
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i)
                drm_crtc_vblank_get(crtc);
 }
 
@@ -126,7 +126,7 @@ static void mdp4_complete_commit(struct msm_kms *kms, struct drm_atomic_state *s
        struct drm_crtc_state *crtc_state;
 
        /* see 119ecb7fd */
-       for_each_crtc_in_state(state, crtc, crtc_state, i)
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i)
                drm_crtc_vblank_put(crtc);
 
        mdp4_disable(mdp4_kms);
index badfa87173170a257624686fc6b0e3fd7e26c623..025d454163b04ec659f8a42edea4c231e9065a3b 100644 (file)
@@ -84,13 +84,13 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev,
                struct drm_atomic_state *old_state)
 {
        struct drm_crtc *crtc;
-       struct drm_crtc_state *crtc_state;
+       struct drm_crtc_state *new_crtc_state;
        struct msm_drm_private *priv = old_state->dev->dev_private;
        struct msm_kms *kms = priv->kms;
        int i;
 
-       for_each_crtc_in_state(old_state, crtc, crtc_state, i) {
-               if (!crtc->state->enable)
+       for_each_new_crtc_in_state(old_state, crtc, new_crtc_state, i) {
+               if (!new_crtc_state->active)
                        continue;
 
                kms->funcs->wait_for_crtc_commit_done(kms, crtc);
@@ -195,7 +195,7 @@ int msm_atomic_commit(struct drm_device *dev,
        struct drm_crtc *crtc;
        struct drm_crtc_state *crtc_state;
        struct drm_plane *plane;
-       struct drm_plane_state *plane_state;
+       struct drm_plane_state *old_plane_state, *new_plane_state;
        int i, ret;
 
        ret = drm_atomic_helper_prepare_planes(dev, state);
@@ -211,19 +211,19 @@ int msm_atomic_commit(struct drm_device *dev,
        /*
         * Figure out what crtcs we have:
         */
-       for_each_crtc_in_state(state, crtc, crtc_state, i)
+       for_each_new_crtc_in_state(state, crtc, crtc_state, i)
                c->crtc_mask |= drm_crtc_mask(crtc);
 
        /*
         * Figure out what fence to wait for:
         */
-       for_each_plane_in_state(state, plane, plane_state, i) {
-               if ((plane->state->fb != plane_state->fb) && plane_state->fb) {
-                       struct drm_gem_object *obj = msm_framebuffer_bo(plane_state->fb, 0);
+       for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
+               if ((new_plane_state->fb != old_plane_state->fb) && new_plane_state->fb) {
+                       struct drm_gem_object *obj = msm_framebuffer_bo(new_plane_state->fb, 0);
                        struct msm_gem_object *msm_obj = to_msm_bo(obj);
                        struct dma_fence *fence = reservation_object_get_excl_rcu(msm_obj->resv);
 
-                       drm_atomic_set_fence_for_plane(plane_state, fence);
+                       drm_atomic_set_fence_for_plane(new_plane_state, fence);
                }
        }