mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

UAPI Changes: - Add sysfs for SLPC power profiles [slpc] (Vinay Belgaumkar) Driver Changes: Fixes/improvements/new stuff: - Fix zero delta busyness issue [pmu] (Umesh Nerlige Ramappa) - Fix page cleanup on DMA remap failure (Brian Geffon) - Debug print LRC state entries only if the context is pinned [guc] (Daniele Ceraolo Spurio) - Drop custom hotplug code [pmu] (Lucas De Marchi) - Use spin_lock_irqsave() in interruptible context [guc] (Krzysztof Karas) - Add wait on depth stall done bit handling [gen12] (Juha-Pekka Heikkila) Miscellaneous: - Change throttle criteria for rps [selftest] (Raag Jadav) - Add debug print about hw config table size (John Harrison) - Include requested frequency in slow firmware load messages [uc] (John Harrison) - Remove i915_pmu_event_event_idx() [pmu] (Lucas De Marchi) - Remove unused live_context_for_engine (Dr. David Alan Gilbert) - Add Wa_22010465259 in its respective WA list (Ranu Maurya) - Correct frequency handling in RPS power measurement [selftests] (Sk Anirban) - Add helper function slpc_measure_power [guc/slpc] (Sk Anirban) - Revert "drm/i915/gt: Log reason for setting TAINT_WARN at reset" [gt] (Sebastian Brzezinka) - Avoid using uninitialized context [selftests] (Krzysztof Karas) - Use struct_size() helper in kmalloc() (luoqing) - Use prandom in selftest [selftests] (Markus Theil) - Replace kmap with its safer kmap_local_page counterpart [gt] (Andi Shyti) Merges: - Merge drm/drm-next into drm-intel-gt-next (Tvrtko Ursulin) Signed-off-by: Dave Airlie <airlied@redhat.com> From: Tvrtko Ursulin <tursulin@igalia.com> Link: https://patchwork.freedesktop.org/patch/msgid/Z77NLt2mR7SqxJ4u@linux
128 lines
3 KiB
C
128 lines
3 KiB
C
/*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
* Copyright © 2021 Intel Corporation
|
|
*/
|
|
|
|
#include <drm/drm_drv.h>
|
|
|
|
#include "gem/i915_gem_context.h"
|
|
#include "gem/i915_gem_object.h"
|
|
#include "i915_active.h"
|
|
#include "i915_driver.h"
|
|
#include "i915_params.h"
|
|
#include "i915_pci.h"
|
|
#include "i915_perf.h"
|
|
#include "i915_request.h"
|
|
#include "i915_scheduler.h"
|
|
#include "i915_selftest.h"
|
|
#include "i915_vma.h"
|
|
#include "i915_vma_resource.h"
|
|
|
|
static int i915_check_nomodeset(void)
|
|
{
|
|
bool use_kms = true;
|
|
|
|
/*
|
|
* Enable KMS by default, unless explicitly overridden by
|
|
* either the i915.modeset parameter or by the
|
|
* nomodeset boot option.
|
|
*/
|
|
|
|
if (i915_modparams.modeset == 0)
|
|
pr_warn("i915.modeset=0 is deprecated. Please use the 'nomodeset' kernel parameter instead.\n");
|
|
else if (i915_modparams.modeset != -1)
|
|
pr_warn("i915.modeset=%d is deprecated. Please remove it and the 'nomodeset' kernel parameter instead.\n",
|
|
i915_modparams.modeset);
|
|
|
|
if (i915_modparams.modeset == 0)
|
|
use_kms = false;
|
|
|
|
if (drm_firmware_drivers_only() && i915_modparams.modeset == -1)
|
|
use_kms = false;
|
|
|
|
if (!use_kms) {
|
|
DRM_DEBUG_DRIVER("KMS disabled.\n");
|
|
return -ENODEV;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static const struct {
|
|
int (*init)(void);
|
|
void (*exit)(void);
|
|
} init_funcs[] = {
|
|
{ .init = i915_check_nomodeset },
|
|
{ .init = i915_active_module_init,
|
|
.exit = i915_active_module_exit },
|
|
{ .init = i915_context_module_init,
|
|
.exit = i915_context_module_exit },
|
|
{ .init = i915_gem_context_module_init,
|
|
.exit = i915_gem_context_module_exit },
|
|
{ .init = i915_objects_module_init,
|
|
.exit = i915_objects_module_exit },
|
|
{ .init = i915_request_module_init,
|
|
.exit = i915_request_module_exit },
|
|
{ .init = i915_scheduler_module_init,
|
|
.exit = i915_scheduler_module_exit },
|
|
{ .init = i915_vma_module_init,
|
|
.exit = i915_vma_module_exit },
|
|
{ .init = i915_vma_resource_module_init,
|
|
.exit = i915_vma_resource_module_exit },
|
|
{ .init = i915_mock_selftests },
|
|
{ .init = i915_pci_register_driver,
|
|
.exit = i915_pci_unregister_driver },
|
|
{ .init = i915_perf_sysctl_register,
|
|
.exit = i915_perf_sysctl_unregister },
|
|
};
|
|
static int init_progress;
|
|
|
|
static int __init i915_init(void)
|
|
{
|
|
int err, i;
|
|
|
|
for (i = 0; i < ARRAY_SIZE(init_funcs); i++) {
|
|
err = init_funcs[i].init();
|
|
if (err < 0) {
|
|
while (i--) {
|
|
if (init_funcs[i].exit)
|
|
init_funcs[i].exit();
|
|
}
|
|
return err;
|
|
} else if (err > 0) {
|
|
/*
|
|
* Early-exit success is reserved for things which
|
|
* don't have an exit() function because we have no
|
|
* idea how far they got or how to partially tear
|
|
* them down.
|
|
*/
|
|
WARN_ON(init_funcs[i].exit);
|
|
break;
|
|
}
|
|
}
|
|
|
|
init_progress = i;
|
|
|
|
return 0;
|
|
}
|
|
|
|
static void __exit i915_exit(void)
|
|
{
|
|
int i;
|
|
|
|
for (i = init_progress - 1; i >= 0; i--) {
|
|
GEM_BUG_ON(i >= ARRAY_SIZE(init_funcs));
|
|
if (init_funcs[i].exit)
|
|
init_funcs[i].exit();
|
|
}
|
|
}
|
|
|
|
module_init(i915_init);
|
|
module_exit(i915_exit);
|
|
|
|
MODULE_AUTHOR("Tungsten Graphics, Inc.");
|
|
MODULE_AUTHOR("Intel Corporation");
|
|
|
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
|
MODULE_LICENSE("GPL and additional rights");
|