From patchwork Wed Apr 4 16:40:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10322909 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 B5B236032A for ; Wed, 4 Apr 2018 16:41:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A62F928791 for ; Wed, 4 Apr 2018 16:41:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AE8C28F7F; Wed, 4 Apr 2018 16:41:22 +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 28AA028791 for ; Wed, 4 Apr 2018 16:41:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 361616E4AE; Wed, 4 Apr 2018 16:40:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-x241.google.com (mail-yb0-x241.google.com [IPv6:2607:f8b0:4002:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 34E866E489 for ; Wed, 4 Apr 2018 16:40:55 +0000 (UTC) Received: by mail-yb0-x241.google.com with SMTP id f13-v6so1244704ybp.3 for ; Wed, 04 Apr 2018 09:40:55 -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=GqXPIQ5TeNPmnQm0/UEQsRyZHr+e1FJAQPT7JdL2sjg=; b=UDmoJTRn8Ax/2bae95XqEY1oE/AiUeVbJkoSIl7ExGKobiIGIp7V6o8otzHd4xiPBx 2y3D/Czkt79D+YMtk1tv1bE1a0aT6JjOkr+j0uIxjRw5bfkCYSVsUOPyxuqVzd1ny9PX d/kS8p5yvdeEFoo06+Dep1t/tJDZdkcNojE3o= 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=GqXPIQ5TeNPmnQm0/UEQsRyZHr+e1FJAQPT7JdL2sjg=; b=mMAWJRZ+WrnBYIY7BvE9/V8PipW5dJOCKhTcgl0oQNFy87p+X5O30VW6QOqNR02E8c HEKwsQKc2iSYx9l9/xEy1R2HjcpJpuv/fbIVB/PFOiExLyTaolsBx5p/W6msX/h6tDyH iVN1sOyWBUUsHqYwtHw93SAnbV3Gv2H69unVIiISQxgB3FLNX71ko4c3a4+RX7Xg3W9y Uuht1iugRKpPewjGOeP0S3SQxmxa9u6HTvDVU6EIG/9hVcGn1MrO7WVW+e/arkeK4Gq6 iS2ip6Iux8jrnMj7qrczukjUvly9Q/og9ylNKAOO4kMNRen5Su7cta5XahXHafES/dps MHhg== X-Gm-Message-State: ALQs6tAAxvTmFUAVAeSsSfwECPGc2ZFr7TnjTHhDc+gecj853BA5QcxZ ovK5uL42iD28v+L8mWbWwk0GGyPQPPU= X-Google-Smtp-Source: AIpwx48+qsfpYW99rPppndAn4zl4dLZXRm9c4k1Gb0ajRdIoaMNM8U/n/QgndDfD+qToP67v4XiCBA== X-Received: by 10.129.30.210 with SMTP id e201mr2600629ywe.396.1522860053994; Wed, 04 Apr 2018 09:40:53 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id p124sm2221027ywf.20.2018.04.04.09.40.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Apr 2018 09:40:53 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v4 4/9] drm/msm: Refactor complete_commit() to look more the helpers Date: Wed, 4 Apr 2018 12:40:43 -0400 Message-Id: <20180404164048.42126-5-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.484.g0c8726318c-goog In-Reply-To: <20180404164048.42126-1-seanpaul@chromium.org> References: <20180404164048.42126-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 Changes in v4: - None 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;