From patchwork Wed May 17 23:35:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 13245988 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 10017C77B7A for ; Wed, 17 May 2023 23:36:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 31A8310E301; Wed, 17 May 2023 23:36:25 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2050.outbound.protection.outlook.com [40.107.94.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAC5C10E2FD for ; Wed, 17 May 2023 23:36:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EGZfv//Nk+GAWahfEG5FaxsBd+QsZ6dAohk0MqlBeZgqAul9gWCtsEPWuk/NZMdnROrm3tVuoEOl7ITNgQVQPunjJYijcD8zuJ184IYWwhkZk+IfkLVPC9QO1GgZ59Q0ytYJVMxa56zOzuOdvZLwcYtkJXqP89ESJeCEFZpb9U4nSpBNA+r8ZA4dOEVZFMXpfzfIrmOo/GAP9b2Du7ME3P7QKyUyrNMkuOtF4RKNajsAQBEu1IhZFI5vQMRX9Yqg8ZRUiuVb/b81Peg4SHYUHMAYjF3s84JpwIrZkXx0ECPISQpBkWHeu2z/3qqDBKRP7BNfd5kls7ifS797mlri7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nFNkwrMt7ra/7tYiO9KrCGVdNId0HHkIobJUXuJg/aU=; b=i/LbfjyN7s+0dHzuDO+Gq/cc3jixVt7XLLdkswBUTu9K2VToQCd1DXDIu3JF7HBlyy5YsxYdDitwZYnDXvdzEqRPl+mwsIPpLX6GjFT+IeldSt1pDgszeqr7vnWHvSIE4wT1uWgHbqIA3nG1HPV2HP0p7W4T1CWw/sExyWKxhlCkMkSlKv8yogu5GMhy5swWeiu48OF1+thlrXT0s8RuIvxa+pvCRZvTpEQ6hpoYzTu6b0bfp+ibb5AlOUGBGUqXvathCN9bE6+Ok7yakP5NlIa12MS+Ei0GlQCxuPa6lPNwqK3PxEb34eXG2JG+9tTgdtoUYX+WL9jcZXcdTs6yHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nFNkwrMt7ra/7tYiO9KrCGVdNId0HHkIobJUXuJg/aU=; b=ogxFXQEieoID2VYF0x5cwYd7afOo39V3dU8a+nydQO57sYRGowHEDC7rg9fZ4FbSHtfbhT1DCDFxSSbQV8CIa+CAVxGdfZE69eele5SueqFJqZBZndyUgPJ0KYWk3LD007V53wTN7UtKBI9eKZ4s8xCKAUZjVY/WwaHG5ZjzDGc= Received: from DM6PR01CA0002.prod.exchangelabs.com (2603:10b6:5:296::7) by SJ2PR12MB8652.namprd12.prod.outlook.com (2603:10b6:a03:53a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Wed, 17 May 2023 23:36:19 +0000 Received: from DM6NAM11FT103.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::7e) by DM6PR01CA0002.outlook.office365.com (2603:10b6:5:296::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17 via Frontend Transport; Wed, 17 May 2023 23:36:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT103.mail.protection.outlook.com (10.13.172.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.19 via Frontend Transport; Wed, 17 May 2023 23:36:19 +0000 Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 17 May 2023 18:36:18 -0500 From: Luben Tuikov To: Direct Rendering Infrastructure - Development Subject: [PATCH 1/2] drm/sched: Rename to drm_sched_can_queue() Date: Wed, 17 May 2023 19:35:49 -0400 Message-ID: <20230517233550.377847-1-luben.tuikov@amd.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-check-string-leak: v1.1 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT103:EE_|SJ2PR12MB8652:EE_ X-MS-Office365-Filtering-Correlation-Id: 3cc1e4d8-eb0c-4047-521b-08db572f8414 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LgNNE3LpG4bFc1YQlt8sdz3DpCJomD0Ao8FG1LpZUEmMRoJbZ7l5nbibSo/peSUeKMM8OS3IO48gYFRv2aPlLHSSvO1+TJQ67hVamn2jJAe9CXMWFXAY41mggWY0ORLPfLhrKt5p2KSpsacr6xl+6Cap9BkMUDThOkhANCkROZ4gq6G4h/SWxFbWHWbzs9Dukc1Zar0wVCpRyWEZWam+xjGGY5OWF9ANYEcZR2G8rtxgRH+w7BkyhYa280lTfyqi50CyN+pwb5QYJ22qXM5rV3MHgmqHhY6JebUwg8u4YndlxzsCynjn8aHxT/VQJyvskKeyCfisS/zcPPIS8+jgM4gmvmfalIdrhkN6S8xoJ3ra4kJUqocAy6XmdjVVlZI3XIb8FesOEkveCIAa3HGyF3e3VYOn7aiSa4bKmaL7Nr6T9MHxDdCd3+sX9FkS3NmDPcDQ/Qx4VcWaGxnXFIbCtsnWl35x4hDRp3uIQ17iJLa1dqCNhOAxDDlw/fqugrTbIkT/1BW3FbGbrjEr2LRyUfWNe1xgD56POb92ZP1NqHjp2Xjc+k7GoOUC+yLw4rJowRtxu+PB09QEv7mVs4CD1kPoGk4lpUwwKuU5n9eyL749/rWhviJpa1OVzEU2XiwwULt/6L9QbvYyiQ/jaRqwvsIaHTwJ9iDl8DbNlimthlHcp93U2KMCa7giVCvCVYWvgb/rwHab65SGnMEJTRNk9hquoyB9hEUJcaK1rveS3fqV/Ta0Zxg8Y8l59FIvrqIHNsmZs94gb7sge9CDctdU9A== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(376002)(136003)(396003)(346002)(451199021)(36840700001)(46966006)(40470700004)(82310400005)(16526019)(186003)(2906002)(40460700003)(86362001)(1076003)(26005)(83380400001)(40480700001)(2616005)(336012)(426003)(36860700001)(36756003)(47076005)(81166007)(66574015)(356005)(82740400003)(6666004)(41300700001)(70206006)(4326008)(70586007)(316002)(6916009)(54906003)(478600001)(44832011)(5660300002)(8676002)(8936002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 23:36:19.3279 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3cc1e4d8-eb0c-4047-521b-08db572f8414 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT103.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8652 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Luben Tuikov , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rename drm_sched_ready() to drm_sched_can_queue(). "ready" can mean many things and is thus meaningless in this context. Instead, rename to a name which precisely conveys what is being checked. Cc: Christian König Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher --- drivers/gpu/drm/scheduler/sched_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) base-commit: f47d6140b7a4c858d82d263e7577ff6fb5279a9c diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 172e63c87bfcf3..8739322c30321b 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -848,13 +848,12 @@ void drm_sched_job_cleanup(struct drm_sched_job *job) EXPORT_SYMBOL(drm_sched_job_cleanup); /** - * drm_sched_ready - is the scheduler ready - * + * drm_sched_can_queue -- Can we queue more to the hardware? * @sched: scheduler instance * * Return true if we can push more jobs to the hw, otherwise false. */ -static bool drm_sched_ready(struct drm_gpu_scheduler *sched) +static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched) { return atomic_read(&sched->hw_rq_count) < sched->hw_submission_limit; @@ -868,7 +867,7 @@ static bool drm_sched_ready(struct drm_gpu_scheduler *sched) */ void drm_sched_wakeup(struct drm_gpu_scheduler *sched) { - if (drm_sched_ready(sched)) + if (drm_sched_can_queue(sched)) wake_up_interruptible(&sched->wake_up_worker); } @@ -885,7 +884,7 @@ drm_sched_select_entity(struct drm_gpu_scheduler *sched) struct drm_sched_entity *entity; int i; - if (!drm_sched_ready(sched)) + if (!drm_sched_can_queue(sched)) return NULL; /* Kernel run queue has higher priority than normal run queue*/ From patchwork Wed May 17 23:35:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 13245989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2B997C77B75 for ; Wed, 17 May 2023 23:36:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CCFF10E2FD; Wed, 17 May 2023 23:36:28 +0000 (UTC) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20622.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe59::622]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27BDC10E2FD for ; Wed, 17 May 2023 23:36:25 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DKea02I5fPW7o6zF6Ul44UOQ0a249DjvAVUKNdtAU5tuLQZsMQfAn08fm9hUMuH4AV83TlZFQ4Lca4Jp+PbnDMAiIgzQfLb8jCQCkpFSqWs32MeFG6IW+6h47CGIp4QxUV4gBsT+auPp3CvdmGpFR+SPctuciDhA7iZR+/fmn5jQsz8PhNtK9BCgQeQtnT1FlvSP4JxgbphlPpFjkfEH7+coxKMZDM0qMHa2ogBNKBl3iE2+u4QKQRn6sXyh/N3X+xT1qZn859wT/GwRz0buqYAjHoiUii6i2qSMba4nRhXXR+LI2Q2i1ApS/OxZTwHc856+1og20M4sT/nO6FVCyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7wVF2RuHqdN8mKQ9Ls5+dMNlA/zaYBHuaSrOpwnpxqI=; b=hzVEf5CHCW3LH6MgxqKe4Brfmdo3WthlAQuQ5FXz9NOTmQfv/P9laV2WvRG1JFoIQXwFtu/WtVDado1O16yKaoryh4LUCiB5hWTNnYzAmkmH01k/HwAa4wZ31yob9P6SHgO5dyYKkNH/kzquUFHIlLOPNbsrLT/Vxkj6vIue3l5xdrbUh84La161cwBgE99Rp14wkEeVYNpu4Bof5rXKoiEPY+hinnUWBzNPMbEQyrZZ2lJc4crNMOeOrU+srR02g4ToKsc0pmZX3OhPdGOo/PCLKkWXNbTLB8a4c3bVyK4wX7qbvUXxNzYoXhgvwLCPlePe8Is+km2ivJXsZ055+Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7wVF2RuHqdN8mKQ9Ls5+dMNlA/zaYBHuaSrOpwnpxqI=; b=2QgbC/ST2JS/qlKPMR4x3K1VmpDn92gGDwuQUKEy7v2NFuRBHtN+e5J55R2ETsLvoA/laaQd/chhy2kYIT5DiW+T6M54QA3HhVI4Q3iTWi/55sDRYeWP7J5pk76/ftiqKkAB8zTAKfqiYzfu4H7DgJISaGXeJRKOnkmmxO/HG2Q= Received: from DM6PR01CA0013.prod.exchangelabs.com (2603:10b6:5:296::18) by SA1PR12MB8841.namprd12.prod.outlook.com (2603:10b6:806:376::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17; Wed, 17 May 2023 23:36:20 +0000 Received: from DM6NAM11FT103.eop-nam11.prod.protection.outlook.com (2603:10b6:5:296:cafe::3c) by DM6PR01CA0013.outlook.office365.com (2603:10b6:5:296::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.17 via Frontend Transport; Wed, 17 May 2023 23:36:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT103.mail.protection.outlook.com (10.13.172.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6411.19 via Frontend Transport; Wed, 17 May 2023 23:36:19 +0000 Received: from smtp.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 17 May 2023 18:36:19 -0500 From: Luben Tuikov To: Direct Rendering Infrastructure - Development Subject: [PATCH 2/2] drm/sched: Rename to drm_sched_wakeup_if_can_queue() Date: Wed, 17 May 2023 19:35:50 -0400 Message-ID: <20230517233550.377847-2-luben.tuikov@amd.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517233550.377847-1-luben.tuikov@amd.com> References: <20230517233550.377847-1-luben.tuikov@amd.com> MIME-Version: 1.0 X-check-string-leak: v1.1 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT103:EE_|SA1PR12MB8841:EE_ X-MS-Office365-Filtering-Correlation-Id: d1c957d0-1cf0-40e5-254c-08db572f846a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: t7ABmsgWmdd3HvJcMvA0TLzxTVucXt8YYwoOvyXUUXTGCjTo6J2EQhHalvtMWZFXDrYMyjVBKYiXY8wXTXUIcR9A1QWy5TnA0GbymyWL6AoIWfp2KraEHmH0oF9XW+31CBPr09yb2vHk+Tf+EtVwU99r+oVRPCGUEPAFM2O8OXft1xplhKrXuxRczU9yt0wcrPyYnPnvwT1GoBEsOxmQNace9OFWpJJkkTtINdoz/rVgARDxJXd7M+Gc8Ba+UVx/+zNHc7w+v4ddrlTMs6mEm619bOh5z3AGpWVWJP2ICXeDyUh0fNoTK0/lJUktalH/wVnCDHDN64IV2JVa256aJNumgzeKfoJG6DgySA69G5IizdUNjq7sItCc0GP2sHDWgR2twsrw3NfTngUO3ZEyIKfNB3USlgB3Jc7Mg8er9dA3hIHlfG5EhLtGwQ5Y3WDipUIIEFFYAsJDBJnzi3rDwQrH0YVk2Q2qSjueWLf/Inu58gCU1GQsazRuNKHoFUXl7+nnx7/3+j+wfIn7BMIZh0fFLYKt0Ov/xR9metLluGnorleBmGtyNAhP3zwaUFYsg69kyAbk1sDqMK5365ldHmvK4cxFlegHdkBqjAjcsXQEbalDcUNj0q8cOYG7RbxPWkib7b1VZYoEj9wL2XyZFNWovs+CoLsNsVqmEOsMJJpz/tDE66zOMmM8NestSIe1BybyjNhSIAnE4MVgOv5na9B4i4q6IkneLmfFK/V8acG/VN94OxnvPR9kLll2UqiWzmRSR68BzS1Bo1nduCP/gQ== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230028)(4636009)(396003)(376002)(136003)(346002)(39860400002)(451199021)(36840700001)(46966006)(40470700004)(8936002)(8676002)(66574015)(5660300002)(44832011)(47076005)(83380400001)(36860700001)(16526019)(26005)(356005)(1076003)(81166007)(186003)(2616005)(426003)(86362001)(82740400003)(40460700003)(41300700001)(40480700001)(6666004)(82310400005)(70586007)(70206006)(336012)(6916009)(36756003)(478600001)(4326008)(316002)(2906002)(54906003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 23:36:19.8904 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1c957d0-1cf0-40e5-254c-08db572f846a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT103.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB8841 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alex Deucher , Luben Tuikov , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Rename drm_sched_wakeup() to drm_sched_wakeup_if_canqueue() since the former is misleading, as it wakes up the GPU scheduler _only if_ more jobs can be queued to the underlying hardware. This distinction is important to make, since the wake conditional in the GPU scheduler thread wakes up when other conditions are also true, e.g. when there are jobs to be cleaned. For instance, a user might want to wake up the scheduler only because there are more jobs to clean, but whether we can queue more jobs is irrelevant. v2: Separate "canqueue" to "can_queue". (Alex D.) Cc: Christian König Cc: Alex Deucher Signed-off-by: Luben Tuikov Reviewed-by: Alex Deucher --- drivers/gpu/drm/scheduler/sched_entity.c | 4 ++-- drivers/gpu/drm/scheduler/sched_main.c | 6 +++--- include/drm/gpu_scheduler.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c index cfb433e9200586..68e807ae136ad8 100644 --- a/drivers/gpu/drm/scheduler/sched_entity.c +++ b/drivers/gpu/drm/scheduler/sched_entity.c @@ -342,7 +342,7 @@ static void drm_sched_entity_wakeup(struct dma_fence *f, container_of(cb, struct drm_sched_entity, cb); drm_sched_entity_clear_dep(f, cb); - drm_sched_wakeup(entity->rq->sched); + drm_sched_wakeup_if_can_queue(entity->rq->sched); } /** @@ -565,7 +565,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job) if (drm_sched_policy == DRM_SCHED_POLICY_FIFO) drm_sched_rq_update_fifo(entity, submit_ts); - drm_sched_wakeup(entity->rq->sched); + drm_sched_wakeup_if_can_queue(entity->rq->sched); } } EXPORT_SYMBOL(drm_sched_entity_push_job); diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c index 8739322c30321b..b352227a605538 100644 --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c @@ -860,12 +860,12 @@ static bool drm_sched_can_queue(struct drm_gpu_scheduler *sched) } /** - * drm_sched_wakeup - Wake up the scheduler when it is ready - * + * drm_sched_wakeup_if_can_queue - Wake up the scheduler * @sched: scheduler instance * + * Wake up the scheduler if we can queue jobs. */ -void drm_sched_wakeup(struct drm_gpu_scheduler *sched) +void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched) { if (drm_sched_can_queue(sched)) wake_up_interruptible(&sched->wake_up_worker); diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 31d1f5166c79fe..e95b4837e5a373 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -549,7 +549,7 @@ void drm_sched_entity_modify_sched(struct drm_sched_entity *entity, unsigned int num_sched_list); void drm_sched_job_cleanup(struct drm_sched_job *job); -void drm_sched_wakeup(struct drm_gpu_scheduler *sched); +void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched); void drm_sched_stop(struct drm_gpu_scheduler *sched, struct drm_sched_job *bad); void drm_sched_start(struct drm_gpu_scheduler *sched, bool full_recovery); void drm_sched_resubmit_jobs(struct drm_gpu_scheduler *sched);