2 * SPDX-License-Identifier: MIT
4 * Copyright © 2021 Intel Corporation
7 #include <drm/drm_drv.h>
9 #include "gem/i915_gem_context.h"
10 #include "gem/i915_gem_object.h"
11 #include "i915_active.h"
12 #include "i915_driver.h"
13 #include "i915_params.h"
15 #include "i915_perf.h"
16 #include "i915_request.h"
17 #include "i915_scheduler.h"
18 #include "i915_selftest.h"
20 #include "i915_vma_resource.h"
22 static int i915_check_nomodeset(void)
27 * Enable KMS by default, unless explicitly overriden by
28 * either the i915.modeset parameter or by the
29 * nomodeset boot option.
32 if (i915_modparams.modeset == 0)
33 pr_warn("i915.modeset=0 is deprecated. Please use the 'nomodeset' kernel parameter instead.\n");
34 else if (i915_modparams.modeset != -1)
35 pr_warn("i915.modeset=%d is deprecated. Please remove it and the 'nomodeset' kernel parameter instead.\n",
36 i915_modparams.modeset);
38 if (i915_modparams.modeset == 0)
41 if (drm_firmware_drivers_only() && i915_modparams.modeset == -1)
45 DRM_DEBUG_DRIVER("KMS disabled.\n");
56 { .init = i915_check_nomodeset },
57 { .init = i915_active_module_init,
58 .exit = i915_active_module_exit },
59 { .init = i915_context_module_init,
60 .exit = i915_context_module_exit },
61 { .init = i915_gem_context_module_init,
62 .exit = i915_gem_context_module_exit },
63 { .init = i915_objects_module_init,
64 .exit = i915_objects_module_exit },
65 { .init = i915_request_module_init,
66 .exit = i915_request_module_exit },
67 { .init = i915_scheduler_module_init,
68 .exit = i915_scheduler_module_exit },
69 { .init = i915_vma_module_init,
70 .exit = i915_vma_module_exit },
71 { .init = i915_vma_resource_module_init,
72 .exit = i915_vma_resource_module_exit },
73 { .init = i915_mock_selftests },
74 { .init = i915_pmu_init,
75 .exit = i915_pmu_exit },
76 { .init = i915_pci_register_driver,
77 .exit = i915_pci_unregister_driver },
78 { .init = i915_perf_sysctl_register,
79 .exit = i915_perf_sysctl_unregister },
81 static int init_progress;
83 static int __init i915_init(void)
87 for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
88 err = init_funcs[i].init();
91 if (init_funcs[i].exit)
97 * Early-exit success is reserved for things which
98 * don't have an exit() function because we have no
99 * idea how far they got or how to partially tear
102 WARN_ON(init_funcs[i].exit);
112 static void __exit i915_exit(void)
116 for (i = init_progress - 1; i >= 0; i--) {
117 GEM_BUG_ON(i >= ARRAY_SIZE(init_funcs));
118 if (init_funcs[i].exit)
119 init_funcs[i].exit();
123 module_init(i915_init);
124 module_exit(i915_exit);
126 MODULE_AUTHOR("Tungsten Graphics, Inc.");
127 MODULE_AUTHOR("Intel Corporation");
129 MODULE_DESCRIPTION(DRIVER_DESC);
130 MODULE_LICENSE("GPL and additional rights");