From patchwork Wed Feb 28 19:18:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10249393 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 BD0BC60211 for ; Wed, 28 Feb 2018 19:19:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A70BF28DD0 for ; Wed, 28 Feb 2018 19:19:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BF4928E49; Wed, 28 Feb 2018 19:19: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 AA7AB28DD0 for ; Wed, 28 Feb 2018 19:19:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3712F6EB38; Wed, 28 Feb 2018 19:19:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CA326EB32 for ; Wed, 28 Feb 2018 19:19:11 +0000 (UTC) Received: by mail-yw0-x243.google.com with SMTP id q184so1194014ywh.13 for ; Wed, 28 Feb 2018 11:19:11 -0800 (PST) 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=odZ+max+ieZi5UIO0xVXXisKRqxAiCXbcR+wwMbXBfc=; b=nmbZPKFA72krz2uX7L+DFsgqJuimkpCiZHm/OF5weS+hlrWjqsSmt5vx+zlN5xXpZe NJG0ri5Aqxou5SO2pwiEdB8oQPAmH684KKsFqD4xyeNnMUKyaQhsjYG5aWfio3MwKl7r fsdDDzfuzPFwC+A+t2iQUZI+JWRY3aZfL7bDY= 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=odZ+max+ieZi5UIO0xVXXisKRqxAiCXbcR+wwMbXBfc=; b=PSuUvQNnoFruyD5OC7miefmhy4N3LYI2DsEg7hZppTigutbSx1oT6iokbBPwO634OO 1miVBA/vujWGfcOnNtTTDhdYXEOINgTT+06kSWcJqXW1xasrTedvzMzFVS+p9Ro19SK3 UvcQQSxdvUdPot0nO3QjEaB/NyLDs08Udwt1F6l+DucbFvaLsjjQyn6wTXw58+zfJFV2 rK5auJVqVSUDQLqvZrRZkyXL+WBuwCGh+8ux3WE/Au/VO3s6lYdOm9lSBJ4bdtX1FGDR CfUsDJzLqziGooJNqw+Sqrmk78Fk6j1Wqbk8SKFQbA1s3v6xVJ/Pd5ROedGCrupwoUOz Agew== X-Gm-Message-State: APf1xPBfHvTQk9jFtpyU6StUn0yFX8PqffoUGhmEiFkEqGW9t7Bswjit d58lwO8GYxra2qsMTVn4UvgdgQ== X-Google-Smtp-Source: AH8x226q07ESxlQQhcS4JDF7I+KzK4Hdf6JAoiH8zVgnHrE+y/QbyPGV2vf4zbjJfc1Oyd1yhtNBuA== X-Received: by 10.13.238.66 with SMTP id x63mr12401862ywe.375.1519845550778; Wed, 28 Feb 2018 11:19:10 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id u62sm884594ywa.19.2018.02.28.11.19.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 11:19:09 -0800 (PST) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [DPU PATCH 03/11] drm/msm: Refactor complete_commit() to look more the helpers Date: Wed, 28 Feb 2018 14:18:58 -0500 Message-Id: <20180228191906.185417-4-seanpaul@chromium.org> X-Mailer: git-send-email 2.16.2.395.g2e18187dfd-goog In-Reply-To: <20180228191906.185417-1-seanpaul@chromium.org> References: <20180228191906.185417-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: hoegsberg@chromium.org, abhinavk@codeaurora.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. Change-Id: I4b858ad9fe356b31ed0ed9eecdb394a61048e39c Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran --- 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 f5794dce25dd..eb2ccda5da0f 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -84,18 +84,12 @@ static void msm_atomic_wait_for_commit_done( } } -/* The (potentially) asynchronous part of the commit. At this point - * nothing can fail short of armageddon. - */ -static void complete_commit(struct msm_commit *c) +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); @@ -127,10 +121,21 @@ static void complete_commit(struct msm_commit *c) drm_atomic_helper_cleanup_planes(dev, state); kms->funcs->complete_commit(kms, state); +} - drm_atomic_state_put(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; - commit_destroy(c); + drm_atomic_helper_wait_for_fences(dev, state, false); + + msm_atomic_commit_tail(state); + + drm_atomic_state_put(state); } static void _msm_drm_commit_work_cb(struct kthread_work *work) @@ -145,6 +150,8 @@ static void _msm_drm_commit_work_cb(struct kthread_work *work) commit = container_of(work, struct msm_commit, commit_work); complete_commit(commit); + + commit_destroy(commit); } static struct msm_commit *commit_init(struct drm_atomic_state *state,