From patchwork Wed May 17 23:08:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 13245971 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 0843CC77B7A for ; Wed, 17 May 2023 23:08:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FB3B10E2D7; Wed, 17 May 2023 23:08:50 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2084.outbound.protection.outlook.com [40.107.94.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3557E10E2D7 for ; Wed, 17 May 2023 23:08:49 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ry55/88ZuZAWV7d7wssnUPBasODQ4dNMl3yDyBEp4IgiEs1JIDQkahG1Fg6C44PGuB8wdMBpEf3C8KKWKoxeqGLXTWcACtPjYj8zQhX80AVZaXQY/3xzIol2vGDWsWJVSMTQW9qTLqnB50bpfbppguKcvbo74fEQma2BNMswDhWHvbXI+NDpkbCe43yd3LU0ji3ptsya6ridG48ixfdBKnxW9BGbO/Q+ijxVPexJ+6ylmn5Tzaz8P0HdsHgVlYVxGytN4zdAxK1W+w/+TI4E83JzvmGekKZffrMDsxDDwJEXhp9oDkwlsssRSWholYqQ9JCfjIKjaMOD/pJqtaesVQ== 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=Qw76t236JakjkuelcW2Y7o7DJGAnDdE2mTUi3fQazl8TRKIju5klgAcKcn5b5tiFOXDIzsZQd1UogL2O4GhRmwqp7q/WdfmoKpBve1coJnqHed/bRLvzzaJK3BdzxnDoUVaU6dJsMIWpdnaToFq12LaB0+WIPwivUJn2iFjXRCY4CVKJ8h8XH2R948CeD0aEeIeR6vOu2tKD+W5Cyt3316m+hRCEv0Oj4cxrgsEsPU2OwAmy0no0kuLHck7FanVA2FrmA7z3WVXtC/LiebkR6hF6dQRmWOE15G64/Gd7d2guCStQeL1ed+2gv9gD+yZm8OMiYuZ++DCDYbHFEOpljQ== 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=wO5Lbzj41NtxJHHnlPSp+t0Z0FmxOd72PwpCrAHIthf5/zIfHI/8mFG+pSk6BMw2kR/0EoW2bHZqauCTh8u/15GTW9Q9hoZ4fYyZ7Td8JuNgYuMHlAWQWFca2OWN4O1Fn/5Oxa8UZznIuAzkxTU1MyTdyEVgXlJRUNgyBZed4ow= Received: from MW4PR04CA0140.namprd04.prod.outlook.com (2603:10b6:303:84::25) by MN2PR12MB4424.namprd12.prod.outlook.com (2603:10b6:208:26a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Wed, 17 May 2023 23:08:47 +0000 Received: from CO1NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::9e) by MW4PR04CA0140.outlook.office365.com (2603:10b6:303:84::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.18 via Frontend Transport; Wed, 17 May 2023 23:08:46 +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 CO1NAM11FT083.mail.protection.outlook.com (10.13.174.92) 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:08:46 +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:08:45 -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:08:18 -0400 Message-ID: <20230517230820.371572-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: CO1NAM11FT083:EE_|MN2PR12MB4424:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ec48208-a528-43f7-7da2-08db572baad3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: wCmyunuU4sTMO80u7a8rW/tdKVv0wb//2faTQ/QOLkgXuPZbP6uRt4y2fN+UHRDqRudL6vxarjpv6BkBfpcdTrZ8F4yFdDzT4xf4ZdFEjbGUZ3WX1maHwbEQxlrtt9G5DQIAKj0zuH0WwY/GfOEeL4+NifZ8PWnDGisJ7wMVGnQttFUyZMaTQmb3st/dd4Tk1Q9cMxg5L7r00jiJ5unE+X6/ixkzbVpc5GUkgUoV9vQDqdpS45SwYu/NeaQ0rSIANZSao3v1k9ppABzPfzBM/SDKnxXNmNvxkjjQ4vkpUBwW2YxDirZ61j52S1Ao/bcyObtSZbNUgdVnwRzoQrTPNprEgMsXGpfGM1qw62S5vv4GDLpBHa+f4PNzxyam/InYw1tNnWvBcpz/+O8Cp9in6C102ZAY+ENGdRbAwyNn+ggy3NAa6w5J30mLJfjlhddbajehuGcsStcQpJfdkkvkRAXJb6V2DLDhY6RatVYmd20G2sEKjeWJYp1HnWkJZ54aSMWVXXj4Zjgt+UsLkUu4SICHZnOn0V6CaTpzLfVuJmXtBN/tXBmSjPZoC2YgwZY0UDIqcmAyt9MuKrxh/JTHeT2uTyX5BlW2V1SYu0uZ4u4EAtuKePkwFSJQhcfY1lfX4kadD9gJ6nrz8XO2dPDT8QzZZ+hRgTaofLXpIrM9e66bPfoNWw8sPkF9Ag7kLfo8GVZ8sFNBqM2Htkgh3IjXqmmLFrU37RtyxZprHPEkZt+MttLVTU8xwRFyqcgJxnz7Wkosr9rak4dJWBoenyMmzw== 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)(136003)(346002)(396003)(376002)(39860400002)(451199021)(40470700004)(36840700001)(46966006)(54906003)(41300700001)(6666004)(82740400003)(70586007)(70206006)(4326008)(6916009)(316002)(44832011)(8936002)(5660300002)(8676002)(478600001)(86362001)(26005)(1076003)(40460700003)(2906002)(16526019)(186003)(82310400005)(81166007)(66574015)(47076005)(356005)(2616005)(40480700001)(36756003)(83380400001)(336012)(36860700001)(426003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 23:08:46.2692 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ec48208-a528-43f7-7da2-08db572baad3 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: CO1NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4424 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:08:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Luben Tuikov X-Patchwork-Id: 13245972 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 D011FC77B7A for ; Wed, 17 May 2023 23:08:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EFE3110E2E6; Wed, 17 May 2023 23:08:54 +0000 (UTC) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20630.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e89::630]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9BED210E2E6 for ; Wed, 17 May 2023 23:08:52 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TdwgAh48+OEWC7qrYLHpiIa/13Zz9aD0RO9qcTonHxJUQlpv7sqNDAueKSPtg5OAgWuxtcguP9PxqR+4VTrVURlofi1bdaOxcDesWUfiAqr4+J1haX0cnBgmzr7qsxfdYLjRJHlASGQ3HQ49Dwm4tx4UDrQ5RvCGsNuR58JWm46615w8fizeXXQsSq6Z0NvLQKCKGOxfkm7iUwL3HjRR+vwLrnmM3uSpnmNdjVDly6tUqtg3SpuJ1sMs5hYTs6YuhJn1tSR6791+Ppb10qStbtS8Fcq30WAIpBpnM2fyMSsA2yo0vvE0g3yS3RwAhEFcZT1KptCmxarpY2xE88UY/w== 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=itU23RMRqQRTGC6LAaIWVXN9WtbxErO1ALrFWGCIDi/5sm5xAQZSme65c3BjzqRJNJsDAF+mtnonNcqBFNmfEvddFcxlLE8dLKU9I5r0SK8Wpgh4aziUROxeURSYR+pKUlW3hDhO8Fl7LUuhGT8BQuOGgULG6LEppeRPBpJn9PVFG4RWlm6EalgZqYms/8DmwMPu9NVxE2Ao6+HxDHLWgjq/4LD8okruduaAiW9Lat9g9MZktWdeOwLATYBTq3ioQGSiM8b9tEcphOFcbKCBW+BDsYiHuacP8DwKr5qwfmuNfJ/LfmdeU4HeahbQJ8j2pgsbdez7okRS2z1QQ7JhTw== 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=I9j9140GFvQmaCC4Se9L9jONBtU8sONVIB7yMmuWLdyhxkDcy0LI22PURsluDmvjNMJWvHVckPuSVkqM0c7J++ZtE9K8FFMsRiHCmAuVAl3+V2WYXamT13iL2fnRyl1Mt3JnFgAKO86CrSTPREXnGpr04yoasHkZzvcSf8lLHoE= Received: from MW4PR04CA0122.namprd04.prod.outlook.com (2603:10b6:303:84::7) by DM8PR12MB5493.namprd12.prod.outlook.com (2603:10b6:8:3d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.33; Wed, 17 May 2023 23:08:48 +0000 Received: from CO1NAM11FT083.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::63) by MW4PR04CA0122.outlook.office365.com (2603:10b6:303:84::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.18 via Frontend Transport; Wed, 17 May 2023 23:08:47 +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 CO1NAM11FT083.mail.protection.outlook.com (10.13.174.92) 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:08:47 +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:08:45 -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:08:19 -0400 Message-ID: <20230517230820.371572-2-luben.tuikov@amd.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230517230820.371572-1-luben.tuikov@amd.com> References: <20230517230820.371572-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: CO1NAM11FT083:EE_|DM8PR12MB5493:EE_ X-MS-Office365-Filtering-Correlation-Id: 0a3a64ab-b07c-4aee-aace-08db572bab88 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sZCqSn84dliEg3UKbEvq5Imj4q+vnsZDyIw/DW50lI7DIEWBXVJXkscw/nJY+YpfvH8Bm3sc0zOdP/k2EWpomK3DmoHhVd7zGmMErz+X41bFV2G/NqdF3TGsZY1UwTBJgTU/TEfkVG4yjk7pIQYRKXi/FaP5HT4SX6MntS1twChjx5Gsc60WrdltVzGNLyGPfasXiVe9MAjgjHa7mDzms5sBqvZzNQRP7KL/4N8oad56goThzEWoy8cknoZ/uSpRvymuA8blQwgagX8cSwxvzlCoAPV8fLY6mVs2yWqQBl8iln/SW33FXr+TkIIOrJ46w8QHTcgf8qtuYwCo/NkRHAQ64bthQHrrwzDK9B+Bz2CHQ9vm11ZHbrKZHhFrMzjEIe98YMALQtMbO9LstFgZps2SmCiTOGtcN7VaZWgdCJZTKMJRVbW2aCJUrPtdEZLcWcLzIOuDE9gLV9GwQ9ubt8914MS+R6ERu/apLOwyxGE1gyK5Vz38OBukNXefovDv4PgZaAlO1usW9fzKEUvE8CZqgPrhBKgU9odBLr/PWQwqpbbBUYnW5FqV1iaVfENCvRtdsv5YaWkmf2DIziZ9BLvhZfvY9YOKICPF+0P4nmFJMAbOw6f9mymf4jY1/temOb/+KNJnBjttr0qU6wwQasb/LE+uGW6uhp89PcpHcmVRfkT5JZGCSk8CgILx1AEIrmZKdPmoLQj751fEBVkeMoWze2zAD4E/HEWTxttMwm19JAqdnGdQmG+ATuOnyz7iLO2G+6Afqf01QRnRdYmHqQ== 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)(376002)(396003)(136003)(346002)(39860400002)(451199021)(40470700004)(46966006)(36840700001)(316002)(478600001)(70586007)(70206006)(54906003)(6916009)(4326008)(36756003)(83380400001)(16526019)(186003)(1076003)(26005)(356005)(2616005)(82740400003)(81166007)(336012)(426003)(47076005)(66574015)(36860700001)(40480700001)(8936002)(82310400005)(6666004)(40460700003)(41300700001)(8676002)(86362001)(5660300002)(44832011)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 May 2023 23:08:47.4565 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0a3a64ab-b07c-4aee-aace-08db572bab88 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: CO1NAM11FT083.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5493 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 --- 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);