From patchwork Wed Jul 12 10:45:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maarten Lankhorst X-Patchwork-Id: 9836489 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9B392602D8 for ; Wed, 12 Jul 2017 10:45:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8735028567 for ; Wed, 12 Jul 2017 10:45:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 77E63285EC; Wed, 12 Jul 2017 10:45:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A987B28567 for ; Wed, 12 Jul 2017 10:45:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756068AbdGLKph (ORCPT ); Wed, 12 Jul 2017 06:45:37 -0400 Received: from mga04.intel.com ([192.55.52.120]:24125 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbdGLKpg (ORCPT ); Wed, 12 Jul 2017 06:45:36 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2017 03:45:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,349,1496127600"; d="scan'208";a="285917462" Received: from fbrandid-mobl.ger.corp.intel.com (HELO patser.lan) ([10.252.51.215]) by fmsmga004.fm.intel.com with ESMTP; 12 Jul 2017 03:45:33 -0700 Subject: [PATCH 14/16] drm/msm: Convert to use new iterator macros, v2. To: Daniel Vetter Cc: dri-devel@lists.freedesktop.org, Rob Herring , Archit Taneja , linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org, Sushmita Susheelendra , Russell King , freedreno@lists.freedesktop.org, Vincent Abriou , Markus Elfring References: <20170712081344.25495-1-maarten.lankhorst@linux.intel.com> <20170712081344.25495-15-maarten.lankhorst@linux.intel.com> <20170712094823.2akjrev3v7ckxb7b@phenom.ffwll.local> From: Maarten Lankhorst Message-ID: Date: Wed, 12 Jul 2017 12:45:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170712094823.2akjrev3v7ckxb7b@phenom.ffwll.local> Content-Language: en-US Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Op 12-07-17 om 11:48 schreef Daniel Vetter: > On Wed, Jul 12, 2017 at 10:13:42AM +0200, Maarten Lankhorst wrote: >> 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. >> >> Signed-off-by: Maarten Lankhorst >> Cc: Rob Clark >> Cc: Archit Taneja >> Cc: Vincent Abriou >> Cc: Maarten Lankhorst >> Cc: Russell King >> Cc: Rob Herring >> Cc: Markus Elfring >> Cc: Sushmita Susheelendra >> Cc: linux-arm-msm@vger.kernel.org >> Cc: freedreno@lists.freedesktop.org >> --- >> drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- >> drivers/gpu/drm/msm/msm_atomic.c | 16 ++++++++-------- >> 2 files changed, 10 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c >> index bcd1f5cac72c..f7f087419ed8 100644 >> --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c >> +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c >> @@ -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); >> diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c >> index 9633a68b14d7..9d3cc1f5e31a 100644 >> --- a/drivers/gpu/drm/msm/msm_atomic.c >> +++ b/drivers/gpu/drm/msm/msm_atomic.c >> @@ -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,15 +211,15 @@ 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); > Pretty sure this fails to compile, you've forgotten to do one more > s/plane_state/new_plane_state/. > > With that fixed: > > Reviewed-by: Daniel Vetter --->8--- 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 Cc: Rob Clark Cc: Archit Taneja Cc: Vincent Abriou Cc: Maarten Lankhorst Cc: Russell King Cc: Rob Herring Cc: Markus Elfring Cc: Sushmita Susheelendra Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Reviewed-by: Daniel Vetter Tested-by: Archit Taneja --- drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c | 4 ++-- drivers/gpu/drm/msm/msm_atomic.c | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c index bcd1f5cac72c..f7f087419ed8 100644 --- a/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c +++ b/drivers/gpu/drm/msm/mdp/mdp4/mdp4_kms.c @@ -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); diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 9633a68b14d7..2728794a7142 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -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); } }