From patchwork Wed Mar 28 19:06:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10313901 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 CB21360467 for ; Wed, 28 Mar 2018 19:08:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA9D628D1D for ; Wed, 28 Mar 2018 19:08:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF01128D3A; Wed, 28 Mar 2018 19:08:19 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5BEC828D1D for ; Wed, 28 Mar 2018 19:08:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3C3086E6A8; Wed, 28 Mar 2018 19:08:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-x243.google.com (mail-yb0-x243.google.com [IPv6:2607:f8b0:4002:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id BBB786E69D for ; Wed, 28 Mar 2018 19:08:15 +0000 (UTC) Received: by mail-yb0-x243.google.com with SMTP id x72-v6so1169602ybe.8 for ; Wed, 28 Mar 2018 12:08:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ibuqIJr+lXf1Ays9xsOKWeknpSWfGbM+Tbd2y41f2OI=; b=lmOw9s5uJ2IM6ELO+nmm3SduUSCCfKGNZP1j4k7I0lMKzlgu8HK1PoWBGbP4j+pb5U Yy7Mg3sDNuwCb59Fa3OerxiuUUKRAgKPgsYDO4qoULtcoP5h+SfhU9Bu+0HoB+9+qBAm q7b62C4nyD7Vt10t5fgWY13hZ/c3MperFsc9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ibuqIJr+lXf1Ays9xsOKWeknpSWfGbM+Tbd2y41f2OI=; b=PTqb+DeAc8ohq4VrrNGErvHU99kIsqeUnJinXQrYzkvgsm5U3iSHR8Ih4q8QYXx+9k lFpJdyRFMG8EidmaAJlwpDDkIRjw6+0nhRPi+zAojgfX0SajzHjE88BOywLPNnc/kvGT 5TD4bvJX03jropagCH/AhztuUodgIyZzbCaglIgYEoHgCXswoaKyl37BEpu1IjSCZ3r9 5Xol+Q2tnJqVGuHLW8zWBhnw3lB3WYkZtUZrMFOI7ByXE3UzB77Z7U8jNQMq3lvM+z/Z R/XBnZKI1mrctHJOgpkEJonfBReylmN+ap09Y4K4+hCGkwKPl9MRPZPO8LZandjeSzxB lGiA== X-Gm-Message-State: AElRT7EbQSLpII7k9Hj0lD+53rcFHU/4L58GdYI6BfoXpqvaJJMT+icW uygrmLHqu1Iyxo92u/25wBAGlA== X-Google-Smtp-Source: AIpwx49TcJRV1DpL2dQXTxWGL0y/GOPjz5+/ZlmpSC56tMK7xbqEaR2tJv/6YRnx49GGV9cZPMoVCg== X-Received: by 2002:a25:4188:: with SMTP id o130-v6mr3031461yba.159.1522264094705; Wed, 28 Mar 2018 12:08:14 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id z6sm1621054ywb.95.2018.03.28.12.08.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Mar 2018 12:08:14 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/6] drm/msm: Refactor complete_commit() to look more the helpers Date: Wed, 28 Mar 2018 15:06:48 -0400 Message-Id: <20180328190657.218661-3-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.rc1.321.gba9d0f2565-goog In-Reply-To: <20180328190657.218661-1-seanpaul@chromium.org> References: <20180328190657.218661-1-seanpaul@chromium.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, abhinavk@codeaurora.org, hoegsberg@chromium.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Factor out the commit_tail() portions of complete_commit() into a separate function to facilitate moving to the atomic helpers in future patches. Changes in v2: - None Cc: Jeykumar Sankaran Signed-off-by: Sean Paul Reviewed-by: Archit Taneja --- drivers/gpu/drm/msm/msm_atomic.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index e792158676aa..671a18ee977d 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -97,18 +97,12 @@ static void msm_atomic_wait_for_commit_done(struct drm_device *dev, } } -/* The (potentially) asynchronous part of the commit. At this point - * nothing can fail short of armageddon. - */ -static void complete_commit(struct msm_commit *c, bool async) +static void msm_atomic_commit_tail(struct drm_atomic_state *state) { - struct drm_atomic_state *state = c->state; struct drm_device *dev = state->dev; struct msm_drm_private *priv = dev->dev_private; struct msm_kms *kms = priv->kms; - drm_atomic_helper_wait_for_fences(dev, state, false); - kms->funcs->prepare_commit(kms, state); drm_atomic_helper_commit_modeset_disables(dev, state); @@ -135,6 +129,19 @@ static void complete_commit(struct msm_commit *c, bool async) drm_atomic_helper_cleanup_planes(dev, state); kms->funcs->complete_commit(kms, state); +} + +/* The (potentially) asynchronous part of the commit. At this point + * nothing can fail short of armageddon. + */ +static void complete_commit(struct msm_commit *c) +{ + struct drm_atomic_state *state = c->state; + struct drm_device *dev = state->dev; + + drm_atomic_helper_wait_for_fences(dev, state, false); + + msm_atomic_commit_tail(state); drm_atomic_state_put(state); @@ -143,7 +150,7 @@ static void complete_commit(struct msm_commit *c, bool async) static void commit_worker(struct work_struct *work) { - complete_commit(container_of(work, struct msm_commit, work), true); + complete_commit(container_of(work, struct msm_commit, work)); } /** @@ -242,7 +249,7 @@ int msm_atomic_commit(struct drm_device *dev, return 0; } - complete_commit(c, false); + complete_commit(c); return 0;