From patchwork Mon Apr 2 15:11:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10319975 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 E3886602C8 for ; Mon, 2 Apr 2018 15:12:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D449828B4B for ; Mon, 2 Apr 2018 15:12:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C706328B50; Mon, 2 Apr 2018 15:12:53 +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 7F78328B4B for ; Mon, 2 Apr 2018 15:12:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 597106E1A1; Mon, 2 Apr 2018 15:12:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x241.google.com (mail-yw0-x241.google.com [IPv6:2607:f8b0:4002:c05::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 212E46E1B0 for ; Mon, 2 Apr 2018 15:12:50 +0000 (UTC) Received: by mail-yw0-x241.google.com with SMTP id v130so5085749ywa.0 for ; Mon, 02 Apr 2018 08:12:50 -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=ZVM2LmVm9jQBUu0+xfjph4NEy/hTKuZbJTqRVJgCLic=; b=UeNA8ns2w//qwR69elpxL9ryE2e3lGJciv34efQPqg+PCd3Wg/jD4LMfrB4VpxE7PW L9767xN7YbtXR0NX6Y7M0XOQGQk6QIuAo+XjEyvRksIncCGvHU4gh29Bj1BfITAUmdrQ hPQ+oRDff7L9WyayFHjfSvL3nn+6Nf+GTUuQs= 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=ZVM2LmVm9jQBUu0+xfjph4NEy/hTKuZbJTqRVJgCLic=; b=hln3ZQZSovUy5lC5YXT2DmA9jg7dohM455FjQ+Q1lQuaOM5d1GMLX1+kXQDobwY6wZ zBkUIuop2ZpxioYUWW9PmO3L2lj6nYev0lSGZMwALzHcfEd8UoMabCsM+g1uMePMsRoH 0W14LNT1SbsAdclQMeT2hNXDYXFpFT8KHoizCqsBHLvAnLiN1aKqFZyhX7EepdkMYhGB PH5j8E2QMNiSuhuv8FD7zYwSNR4u1NeQLfJlpcFhz301vu0rx8f1GsL/tfV+TxwZy/Ij QPuLVD0yVJEg36ANEMlTH2NYFzXC03MpGc9UDbdZuLaGcSmKBJNiFeGy3RpXBxr+pOBB wECg== X-Gm-Message-State: AElRT7H45HPYmgYse/GO8mhwX9JNFRgBv9bR6OadhZzHGMEmtzfRA38U id772OxLEw5ulvII37mcdCudtwhsEzc= X-Google-Smtp-Source: AIpwx49QpX9NlPF2c5ip4xMLJenl+n/jbrlHgZWKog9Yg5z6Zo8VV0MXnHW1rvJ+P6VdR5s8Kr6DZA== X-Received: by 10.129.129.69 with SMTP id r66mr5494323ywf.270.1522681970220; Mon, 02 Apr 2018 08:12:50 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id n26sm226983ywh.16.2018.04.02.08.12.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Apr 2018 08:12:49 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v3 4/8] drm/msm: Refactor complete_commit() to look more the helpers Date: Mon, 2 Apr 2018 11:11:28 -0400 Message-Id: <20180402151136.192869-5-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.rc1.321.gba9d0f2565-goog In-Reply-To: <20180402151136.192869-1-seanpaul@chromium.org> References: <20180402151136.192869-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: 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 Changes in v3: - Rebased on Archit's private_obj set Cc: Jeykumar Sankaran Reviewed-by: Archit Taneja Signed-off-by: Sean Paul --- 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 9d0a0ca1f0cb..c18f0bee20d4 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)); } /** @@ -248,7 +255,7 @@ int msm_atomic_commit(struct drm_device *dev, return 0; } - complete_commit(c, false); + complete_commit(c); return 0;