From patchwork Thu Jun 13 17:02:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Skeggs X-Patchwork-Id: 13697178 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 121D4C27C75 for ; Thu, 13 Jun 2024 17:02:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59AAA10EB3F; Thu, 13 Jun 2024 17:02:03 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=Nvidia.com header.i=@Nvidia.com header.b="DZc9zivm"; dkim-atps=neutral Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2046.outbound.protection.outlook.com [40.107.244.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21CA010EB44; Thu, 13 Jun 2024 17:01:54 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=czpqpIW6QUPJlQhQAskPV/NWHbGcm6VfL0clxXSu/mQu3JXrA2oGdeDhPeXQVDIKVeJTIR31SBuWbkwVxi3I5lHD/0Pfd1n0R2OZ2DJnjB609IpX1lEmFRmDDUu8g2ld90UNC0X3QXWUElyBsKapwNBWd3dHrYI5jF/QXX/mdSY8WgV+jWtwnFHjh+v9Y6T1rDK+1UXAMXBJ2VyKq/snAnuIj9nNImfWNlWfBCJHVLHXm2j3DKTmPKE/1Ap7WZKZgVZdSMeDwLeke6kN9hAc79vAUlmv2zZrdLvNzaN3XbN0UO8Nkc0gOtSUnZyAd/B3+PBZjxlDTCnjCTQQdoOsCQ== 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=17WkeGr7r7HhCghj1PZIUJ0et2wAnD3ZVaHDMHv4z6Q=; b=hI+jevuPTU+leMTwWXJVlm1ybGY+761+OW7kimODYRonasncOAYBUvNWBfbm8bwNaFnZyKYOVQVRVs8POjHHExvDGbyf/fxHEihU3+cMTuaV0rrseQC+R07GHUBrkoRIiZKEJblTcywn2dFZ/DRVPA/zcc/YET+d+/yFe1o2L0J2pqqws6FS6ZETk3MZ/bEoY1qmrkWnVQWHCF3kyA2F03iZ385f1NYu5X2tHpEHnREbAMQ47TalUDR1/9CqFny7HD6ABKygQhxuntYY1/WGgxrfyB/luYYkVtjZysntHaK9r1rTJE96LexaFL1JI6ylic2HXIIfxImSa7ebKATFyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=lists.freedesktop.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=17WkeGr7r7HhCghj1PZIUJ0et2wAnD3ZVaHDMHv4z6Q=; b=DZc9zivmERZnYCYprjt+jQvmJEHi82dZ3SrbfliCIl6rrQANSQv0fBsfgyfDBBtqtzWAZ6iPwhVQAzRP1Tkzpur36Y8GSK1xkMOMOI1Ur9Ga0pLWBlojbZoFJoZF9riMkpbJqRMZWIAnX0Webp+6KRnYrb/HahsYZqlqJ8qdTKSCtMWYjaHTDUirB8QjBz8LKh7XYeXF6gjnOytV0JyYs7OJUx6ndwkWJbveT9QVREAhXbVoZOUXSg/zNWAkqnQri29O3TmyNrNcZpPER1SRoham2ElPGTDc24qrGXovSN/vJnWx7Ylw0a2zjDIAAbhHwN4wdnN+wW5p80HoOr7msQ== Received: from BL1PR13CA0095.namprd13.prod.outlook.com (2603:10b6:208:2b9::10) by DS7PR12MB6119.namprd12.prod.outlook.com (2603:10b6:8:99::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Thu, 13 Jun 2024 17:01:45 +0000 Received: from BL6PEPF0002256F.namprd02.prod.outlook.com (2603:10b6:208:2b9:cafe::c4) by BL1PR13CA0095.outlook.office365.com (2603:10b6:208:2b9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.20 via Frontend Transport; Thu, 13 Jun 2024 17:01:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL6PEPF0002256F.mail.protection.outlook.com (10.167.249.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.15 via Frontend Transport; Thu, 13 Jun 2024 17:01:37 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 13 Jun 2024 10:01:06 -0700 Received: from fedora.mshome.net (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Thu, 13 Jun 2024 10:01:05 -0700 From: Ben Skeggs To: , CC: Ben Skeggs Subject: [PATCH 2/2] drm/nouveau/nvkm: separate out into nvkm.ko Date: Fri, 14 Jun 2024 03:02:11 +1000 Message-ID: <20240613170211.88779-3-bskeggs@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240613170211.88779-1-bskeggs@nvidia.com> References: <20240613170211.88779-1-bskeggs@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0002256F:EE_|DS7PR12MB6119:EE_ X-MS-Office365-Filtering-Correlation-Id: dd29f3d9-99a6-405f-b783-08dc8bca7ceb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230035|376009|1800799019|82310400021|36860700008; X-Microsoft-Antispam-Message-Info: ZuOaVEZDYjPkvOsruQ9UUcNX8dZEN+ULkFubwYd57kvtdM3h8nrkJA6YgD/u3vCW5CQUcpgWNUtsbe/5eiEGQx+oHIteM+4CKxdk7LcUWZAGWcXf6Rzf75/SLY2K5b9d/hVxL4aBUr9vszSiIviFSybgkNY2a2sHg/IeJV909GWjzvfL2aFMAwKNutrmzldF8bf8L6lDttsw2NQ3av9CzsxK6pVsmz2cw4z30HctdyUrXycBB3HOfArgZoi0gOpP6VJbiHw9eJtpKlvP4nnKmfzWZzEE0/ikZgaR68ULbYkQqAVpA5uG4P1aOibJSxhfGRuBta8Fo9PWJacWNyVUUmEnAsGDEo1af0U36cGQ24WqvvGYFuj9YhuTtVIsGxYDE/WVCoDsNzzMueYy89arUJpVaLJS0SKnZO86vawPxS2seH7adzAju2Zgio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idia.com; CAT:NONE; SFS:(13230035)(376009)(1800799019)(82310400021)(36860700008); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2024 17:01:37.3213 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd29f3d9-99a6-405f-b783-08dc8bca7ceb X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0002256F.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6119 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/Kbuild | 4 ++-- drivers/gpu/drm/nouveau/include/nvkm/core/module.h | 3 --- drivers/gpu/drm/nouveau/nouveau_drm.c | 10 +--------- drivers/gpu/drm/nouveau/nvkm/module.c | 8 ++++++-- 4 files changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/nouveau/Kbuild b/drivers/gpu/drm/nouveau/Kbuild index cc471ab6a7ec..b62c6858fb7b 100644 --- a/drivers/gpu/drm/nouveau/Kbuild +++ b/drivers/gpu/drm/nouveau/Kbuild @@ -8,11 +8,11 @@ ccflags-y += -I $(NOUVEAU_PATH)/$(src) # NVKM - HW resource manager include $(src)/nvkm/Kbuild -nouveau-y := $(nvkm-y) +obj-$(CONFIG_DRM_NOUVEAU) += nvkm.o # NVIF - NVKM interface library (NVKM user interface also defined here) include $(src)/nvif/Kbuild -nouveau-y += $(nvif-y) +nouveau-y := $(nvif-y) # DRM - general ifdef CONFIG_X86 diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/module.h b/drivers/gpu/drm/nouveau/include/nvkm/core/module.h index fc42ace93a1c..d1ad6aae9911 100644 --- a/drivers/gpu/drm/nouveau/include/nvkm/core/module.h +++ b/drivers/gpu/drm/nouveau/include/nvkm/core/module.h @@ -3,8 +3,5 @@ #define __NVKM_MODULE_H__ #include -int __init nvkm_init(void); -void __exit nvkm_exit(void); - extern int nvkm_runpm; #endif diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c index 7e77e950eba2..4f55cd73d1b3 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -1174,7 +1174,7 @@ static const struct dev_pm_ops nouveau_pm_ops = { static const struct auxiliary_device_id nouveau_drm_id_table[] = { - { .name = "nouveau.device" }, + { .name = "nvkm.device" }, {} }; @@ -1190,8 +1190,6 @@ nouveau_auxdrv = { static int __init nouveau_drm_init(void) { - int ret; - nouveau_display_options(); if (nouveau_modeset == -1) { @@ -1202,10 +1200,6 @@ nouveau_drm_init(void) if (!nouveau_modeset) return 0; - ret = nvkm_init(); - if (ret) - return ret; - nouveau_backlight_ctor(); return auxiliary_driver_register(&nouveau_auxdrv); @@ -1223,8 +1217,6 @@ nouveau_drm_exit(void) if (IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM)) mmu_notifier_synchronize(); - - nvkm_exit(); } module_init(nouveau_drm_init); diff --git a/drivers/gpu/drm/nouveau/nvkm/module.c b/drivers/gpu/drm/nouveau/nvkm/module.c index c14dd7fa15c2..d0ae023cdc74 100644 --- a/drivers/gpu/drm/nouveau/nvkm/module.c +++ b/drivers/gpu/drm/nouveau/nvkm/module.c @@ -26,7 +26,7 @@ int nvkm_runpm = -1; -void __exit +static void __exit nvkm_exit(void) { #ifdef CONFIG_PCI @@ -39,7 +39,7 @@ nvkm_exit(void) #endif } -int __init +static int __init nvkm_init(void) { int ret; @@ -60,3 +60,7 @@ nvkm_init(void) return 0; } + +MODULE_LICENSE("GPL and additional rights"); +module_init(nvkm_init); +module_exit(nvkm_exit);