From patchwork Tue Mar 27 16:31:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10310723 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 1B340606AB for ; Tue, 27 Mar 2018 16:32:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E3DDB29BF6 for ; Tue, 27 Mar 2018 16:32:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6346B29C00; Tue, 27 Mar 2018 16:32:07 +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 4BA4A29BA1 for ; Tue, 27 Mar 2018 16:32:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9BFC26E657; Tue, 27 Mar 2018 16:32:03 +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 9A0CB89DBC for ; Tue, 27 Mar 2018 16:31:57 +0000 (UTC) Received: by mail-yb0-x241.google.com with SMTP id k8-v6so7859464ybd.6 for ; Tue, 27 Mar 2018 09:31:57 -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=qiee4zMW6Bfp+hGVGAWy02imMEBVZnMIy3lnv4W1EmA=; b=jhHv8UA8GT6RwV69eo5IEbnYCnj9wzGsf739gVdJNl29+U9vVTGLsc8wpl0pDDO4Ez rQ9121DNsoPXZzRVUlT7bjPfx3VtHN5k1mjl4Sf1q87Qedga4qD/z2UVoRy8uVPUUaez X41l1LUlalhzGrN0RYpiT1nfGp1qrzqJHC/II= 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=qiee4zMW6Bfp+hGVGAWy02imMEBVZnMIy3lnv4W1EmA=; b=MfVsWtPXro2q4Gf3+ckHp7UJvEUdzZ/M7r+4/QQYhOlXfvMlCmHbP0wSj4MHa8DD1o MlXL6KiZ2ssEY48P86kYBrRxC9nuAlMWHsfALvsmLTl5LULx7vhs/c8KpXjZNuUAKSK6 hBQtBaBx/kEq/OwgJ00clhR9oohZG/LqjF2v7hmWBykkRSBG/jRSAnNrZbVI1xZTpJCk pXkD/48t42yGvYas1UBOKFeVp19jm1kOp8OpYCcady4J8I4OTCcCTxs/BdOUzoCM0Cfv w//U+NH220WPzLx/7Pw8DjnXRJvG389VnnLlrOgVZw7cxQwkNDlKiBy9PgQRQi81egkC UxAw== X-Gm-Message-State: AElRT7Ht59gsEEiJ3I3eVbXXaDHxKA6JdRWLuZWDt4AguxNV0cdDNvxh AP5PuAcs6u4zYGKoimXpQvFpSgqp/CA= X-Google-Smtp-Source: AIpwx49ziE8hTzwDPnm0/3ts1HX4gkq0eZ7zUm7tYT16ZRPirZiDW8qdSv2cJFevwONmcIluBDVW4g== X-Received: by 2002:a25:26d1:: with SMTP id m200-v6mr19591ybm.510.1522168316873; Tue, 27 Mar 2018 09:31:56 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id f203sm563743ywa.39.2018.03.27.09.31.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Mar 2018 09:31:56 -0700 (PDT) From: Sean Paul To: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/4] drm/msm: Refactor complete_commit() to look more the helpers Date: Tue, 27 Mar 2018 12:31:51 -0400 Message-Id: <20180327163154.40374-2-seanpaul@chromium.org> X-Mailer: git-send-email 2.17.0.rc0.231.g781580f067-goog In-Reply-To: <20180327163154.40374-1-seanpaul@chromium.org> References: <20180327163154.40374-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. Cc: Jeykumar Sankaran Signed-off-by: Sean Paul --- drivers/gpu/drm/msm/msm_atomic.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index e792158676aa..9c6fa52a40b7 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,10 +129,21 @@ static void complete_commit(struct msm_commit *c, bool async) 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 commit_worker(struct work_struct *work)