From patchwork Tue Nov 21 00:38:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 167446 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp315344vqb; Mon, 20 Nov 2023 16:42:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoB7eSnR2fGt/lAge/96zJcrFWL6fdRpSMCevaTJoIgQj8XYd5gftufOXu4COsYtephqgt X-Received: by 2002:a05:6808:11c3:b0:3b2:f54b:8b3a with SMTP id p3-20020a05680811c300b003b2f54b8b3amr12792067oiv.27.1700527371221; Mon, 20 Nov 2023 16:42:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700527371; cv=none; d=google.com; s=arc-20160816; b=Ddw0a7CiOSkmbouwgHgBqY8hhj8Q3O8oyNa4pc4xZeSw+8+HH280assmmJzqqJAnDL AWc5rixKOx9r8Ski0pJROzxRB9wjpLivCafwW1zYXe7lfcSMh58uB1swNVlUY4QzXc9w hIOPnn4WSRYEn/DWbb7gyS4rWAMC4xCgbo8Dntr568YohWa/l5EKu3RvuD33ts/rLa5p 4Jm6NB0/RxOhvhn9g2852GhyGtlc7SaXPvu1N1xKRCEW0tNrx8IGjID9xwTnf1DwIaJi RPj1BWvFSh2PZo7VDAlVqFcVby3AqGyI097Ueku3I7jIERuQ2sZqb86GISUarZU1YBo7 LBIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=o0h8yAS+G8YHpuqagMyaQ9goLsE9tJyhmBTQ25AFj0s=; fh=D+EPs4f1tbcirM+xOcOZ25ESgeHsz4zHs+gyKhf0s0I=; b=sE2+MqEyMcgb8w/HvQJ8K5mJohs2403g9K7+TwLHCMyw03QU4VR+aXn6e20XrtghVf TfO1hfnnuIMIZdHLEp/xyq44Ebs1yrSnwZLtcyRQ6NWsJ62z9zntagFrWYWCe0S7tiqO dRuYfc+nmc41kIlkY+NebALneMetwgf/3Wf2aAuyNqRi2UFJ6jAcWEt9/YAhopvPyNby ww/L3Z+2uo/y6Mb9It+UnyE+Ktn1NggmWkP3zRguaaikNpFV3LRdGuAIFhZ0evejVPHP w3wjNKhMJUszjyFdpK03grV+TrErBUbcalAhZZTs8zMIBeUrg+IaCMBFD2jTX8ohV/Dq MQFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XFl80V1O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id d13-20020a056a0010cd00b0068e3f550763si9572131pfu.101.2023.11.20.16.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 16:42:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=XFl80V1O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F230A807C561; Mon, 20 Nov 2023 16:40:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233014AbjKUAkZ (ORCPT + 27 others); Mon, 20 Nov 2023 19:40:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232896AbjKUAkT (ORCPT ); Mon, 20 Nov 2023 19:40:19 -0500 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1629114; Mon, 20 Nov 2023 16:40:13 -0800 (PST) Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-1cc0e78ec92so31414955ad.3; Mon, 20 Nov 2023 16:40:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700527213; x=1701132013; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o0h8yAS+G8YHpuqagMyaQ9goLsE9tJyhmBTQ25AFj0s=; b=XFl80V1Og099vz55KWPDjiTyP9/em07jGeREaCjtjfkjMvA5QE6a/ZoNkWZcw9a0jb ngHgPouSgzkvgMdtHeIQD++1Ez72yp0PRUXivbOcebtdhSPLFf1O+mGu1ZOiMUrXLYga SHAvzkoSiYqZGoq/TaZCBITVE7lSyxRbL+UZsm+/r7dhiaJhfo0MbJHuNBcOOeCyZEWt L/4qLfP5wJHRRPzKKjxc1gWNMVC9N/KMJra2B3koQfS6AG701wx3Mm2noipzE/T2YjAU wkaho+5DyQtKcWN5KkknB3J567VJf+ScIx2REH2TXB8Qu+JzbpObvESlQz2rSs/Vpuay sDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700527213; x=1701132013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o0h8yAS+G8YHpuqagMyaQ9goLsE9tJyhmBTQ25AFj0s=; b=dlYMHVhxFP2MWUoq0HniqdzXiAFLMldE6Bse7/Ww03wwMsJL5Lwd2NxG8/XXjhHcNJ UJ7AJvEvNRZbNg8A0Crw7XzzzHKAjl7hkE9IQGSmxUcvuHWY4/W6JySDyzc6MTWK8j3N QuxNKX4Z8zN+Ka5OXXRVYVEjK+QVVnPcPm0s1pKmzWAf4wzXUbwFlWP5tI62frE9pwS0 lvhTUiBX4JDXziI7TpPFD48dBTvhozU+2JkeddtKVL95DhsiWHwC7m94ZyvL22WmAPe4 vk382D0yg299uytaJSVjGYq2KDrmKz0Vj7hXyOgqB3PdobLctAupQ9fJszBTRQqUPScm wCuQ== X-Gm-Message-State: AOJu0YzAMn3udRDZJAl5XFKgmqs/5xSiw11ZwlLgQXea6qyho96QRMdo 4Rw23kqIQ/nzb2TqFH3VirI= X-Received: by 2002:a17:902:eb8f:b0:1cc:237c:75d6 with SMTP id q15-20020a170902eb8f00b001cc237c75d6mr7706097plg.67.1700527213178; Mon, 20 Nov 2023 16:40:13 -0800 (PST) Received: from localhost ([47.215.232.245]) by smtp.gmail.com with ESMTPSA id u1-20020a170902b28100b001cf567252besm4035798plr.237.2023.11.20.16.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 16:40:12 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Rob Clark , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 5/7] drm/msm/gem: Cleanup submit_cleanup_bo() Date: Mon, 20 Nov 2023 16:38:49 -0800 Message-ID: <20231121003935.5868-6-robdclark@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231121003935.5868-1-robdclark@gmail.com> References: <20231121003935.5868-1-robdclark@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 20 Nov 2023 16:40:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783132188672607636 X-GMAIL-MSGID: 1783132188672607636 From: Rob Clark Now that it only handles unlock duty, drop the superfluous arg and rename it. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/msm_gem_submit.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index d001bf286606..603f04d851d9 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -248,14 +248,10 @@ static int submit_lookup_cmds(struct msm_gem_submit *submit, return ret; } -/* Unwind bo state, according to cleanup_flags. In the success case, only - * the lock is dropped at the end of the submit (and active/pin ref is dropped - * later when the submit is retired). - */ -static void submit_cleanup_bo(struct msm_gem_submit *submit, int i, - unsigned cleanup_flags) +static void submit_unlock_bo(struct msm_gem_submit *submit, int i) { struct drm_gem_object *obj = submit->bos[i].obj; + unsigned cleanup_flags = BO_LOCKED; unsigned flags = submit->bos[i].flags & cleanup_flags; /* @@ -304,10 +300,10 @@ static int submit_lock_objects(struct msm_gem_submit *submit) } for (; i >= 0; i--) - submit_cleanup_bo(submit, i, BO_LOCKED); + submit_unlock_bo(submit, i); if (slow_locked > 0) - submit_cleanup_bo(submit, slow_locked, BO_LOCKED); + submit_unlock_bo(submit, slow_locked); if (ret == -EDEADLK) { struct drm_gem_object *obj = submit->bos[contended].obj; @@ -533,7 +529,6 @@ static int submit_reloc(struct msm_gem_submit *submit, struct drm_gem_object *ob */ static void submit_cleanup(struct msm_gem_submit *submit, bool error) { - unsigned cleanup_flags = BO_LOCKED; unsigned i; if (error) @@ -541,7 +536,7 @@ static void submit_cleanup(struct msm_gem_submit *submit, bool error) for (i = 0; i < submit->nr_bos; i++) { struct drm_gem_object *obj = submit->bos[i].obj; - submit_cleanup_bo(submit, i, cleanup_flags); + submit_unlock_bo(submit, i); if (error) drm_gem_object_put(obj); }