mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
drm/xe: Keep all defaults in single header
We already have most of Xe defaults defined in xe_module.c, where we use them for the modparam initializations, but some were defined elsewhere, which breaks the consistency. Introduce xe_defaults.h file, that will act as a placeholder for all our default values, and can be used from other places. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patch.msgid.link/20260121214218.2817-2-michal.wajdeczko@intel.com
This commit is contained in:
parent
0bc2c2e1a3
commit
44f44d43f9
25
drivers/gpu/drm/xe/xe_defaults.h
Normal file
25
drivers/gpu/drm/xe/xe_defaults.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2026 Intel Corporation
|
||||
*/
|
||||
#ifndef _XE_DEFAULTS_H_
|
||||
#define _XE_DEFAULTS_H_
|
||||
|
||||
#include "xe_device_types.h"
|
||||
|
||||
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
|
||||
#define XE_DEFAULT_GUC_LOG_LEVEL 3
|
||||
#else
|
||||
#define XE_DEFAULT_GUC_LOG_LEVEL 1
|
||||
#endif
|
||||
|
||||
#define XE_DEFAULT_PROBE_DISPLAY true
|
||||
#define XE_DEFAULT_VRAM_BAR_SIZE 0
|
||||
#define XE_DEFAULT_FORCE_PROBE CONFIG_DRM_XE_FORCE_PROBE
|
||||
#define XE_DEFAULT_MAX_VFS ~0
|
||||
#define XE_DEFAULT_MAX_VFS_STR "unlimited"
|
||||
#define XE_DEFAULT_WEDGED_MODE XE_WEDGED_MODE_UPON_CRITICAL_ERROR
|
||||
#define XE_DEFAULT_WEDGED_MODE_STR "upon-critical-error"
|
||||
#define XE_DEFAULT_SVM_NOTIFIER_SIZE 512
|
||||
|
||||
#endif
|
||||
|
|
@ -26,6 +26,7 @@
|
|||
#include "xe_bo.h"
|
||||
#include "xe_bo_evict.h"
|
||||
#include "xe_debugfs.h"
|
||||
#include "xe_defaults.h"
|
||||
#include "xe_devcoredump.h"
|
||||
#include "xe_device_sysfs.h"
|
||||
#include "xe_dma_buf.h"
|
||||
|
|
@ -743,7 +744,7 @@ int xe_device_probe_early(struct xe_device *xe)
|
|||
assert_lmem_ready(xe);
|
||||
|
||||
xe->wedged.mode = xe_device_validate_wedged_mode(xe, xe_modparam.wedged_mode) ?
|
||||
XE_WEDGED_MODE_DEFAULT : xe_modparam.wedged_mode;
|
||||
XE_DEFAULT_WEDGED_MODE : xe_modparam.wedged_mode;
|
||||
drm_dbg(&xe->drm, "wedged_mode: setting mode (%u) %s\n",
|
||||
xe->wedged.mode, xe_wedged_mode_to_string(xe->wedged.mode));
|
||||
|
||||
|
|
|
|||
|
|
@ -62,9 +62,6 @@ enum xe_wedged_mode {
|
|||
XE_WEDGED_MODE_UPON_ANY_HANG_NO_RESET = 2,
|
||||
};
|
||||
|
||||
#define XE_WEDGED_MODE_DEFAULT XE_WEDGED_MODE_UPON_CRITICAL_ERROR
|
||||
#define XE_WEDGED_MODE_DEFAULT_STR "upon-critical-error"
|
||||
|
||||
#define XE_BO_INVALID_OFFSET LONG_MAX
|
||||
|
||||
#define GRAPHICS_VER(xe) ((xe)->info.graphics_verx100 / 100)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <drm/drm_module.h>
|
||||
|
||||
#include "xe_defaults.h"
|
||||
#include "xe_device_types.h"
|
||||
#include "xe_drv.h"
|
||||
#include "xe_configfs.h"
|
||||
|
|
@ -19,51 +20,36 @@
|
|||
#include "xe_observation.h"
|
||||
#include "xe_sched_job.h"
|
||||
|
||||
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
|
||||
#define DEFAULT_GUC_LOG_LEVEL 3
|
||||
#else
|
||||
#define DEFAULT_GUC_LOG_LEVEL 1
|
||||
#endif
|
||||
|
||||
#define DEFAULT_PROBE_DISPLAY true
|
||||
#define DEFAULT_VRAM_BAR_SIZE 0
|
||||
#define DEFAULT_FORCE_PROBE CONFIG_DRM_XE_FORCE_PROBE
|
||||
#define DEFAULT_MAX_VFS ~0
|
||||
#define DEFAULT_MAX_VFS_STR "unlimited"
|
||||
#define DEFAULT_WEDGED_MODE XE_WEDGED_MODE_DEFAULT
|
||||
#define DEFAULT_WEDGED_MODE_STR XE_WEDGED_MODE_DEFAULT_STR
|
||||
#define DEFAULT_SVM_NOTIFIER_SIZE 512
|
||||
|
||||
struct xe_modparam xe_modparam = {
|
||||
.probe_display = DEFAULT_PROBE_DISPLAY,
|
||||
.guc_log_level = DEFAULT_GUC_LOG_LEVEL,
|
||||
.force_probe = DEFAULT_FORCE_PROBE,
|
||||
.probe_display = XE_DEFAULT_PROBE_DISPLAY,
|
||||
.guc_log_level = XE_DEFAULT_GUC_LOG_LEVEL,
|
||||
.force_probe = XE_DEFAULT_FORCE_PROBE,
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
.max_vfs = DEFAULT_MAX_VFS,
|
||||
.max_vfs = XE_DEFAULT_MAX_VFS,
|
||||
#endif
|
||||
.wedged_mode = DEFAULT_WEDGED_MODE,
|
||||
.svm_notifier_size = DEFAULT_SVM_NOTIFIER_SIZE,
|
||||
.wedged_mode = XE_DEFAULT_WEDGED_MODE,
|
||||
.svm_notifier_size = XE_DEFAULT_SVM_NOTIFIER_SIZE,
|
||||
/* the rest are 0 by default */
|
||||
};
|
||||
|
||||
module_param_named(svm_notifier_size, xe_modparam.svm_notifier_size, uint, 0600);
|
||||
MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier size in MiB, must be power of 2 "
|
||||
"[default=" __stringify(DEFAULT_SVM_NOTIFIER_SIZE) "]");
|
||||
"[default=" __stringify(XE_DEFAULT_SVM_NOTIFIER_SIZE) "]");
|
||||
|
||||
module_param_named_unsafe(force_execlist, xe_modparam.force_execlist, bool, 0444);
|
||||
MODULE_PARM_DESC(force_execlist, "Force Execlist submission");
|
||||
|
||||
module_param_named(probe_display, xe_modparam.probe_display, bool, 0444);
|
||||
MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise it's left untouched "
|
||||
"[default=" __stringify(DEFAULT_PROBE_DISPLAY) "])");
|
||||
"[default=" __stringify(XE_DEFAULT_PROBE_DISPLAY) "])");
|
||||
|
||||
module_param_named(vram_bar_size, xe_modparam.force_vram_bar_size, int, 0600);
|
||||
MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size in MiB (<0=disable-resize, 0=max-needed-size, >0=force-size "
|
||||
"[default=" __stringify(DEFAULT_VRAM_BAR_SIZE) "])");
|
||||
"[default=" __stringify(XE_DEFAULT_VRAM_BAR_SIZE) "])");
|
||||
|
||||
module_param_named(guc_log_level, xe_modparam.guc_log_level, int, 0600);
|
||||
MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level (0=disable, 1=normal, 2..5=verbose-levels "
|
||||
"[default=" __stringify(DEFAULT_GUC_LOG_LEVEL) "])");
|
||||
"[default=" __stringify(XE_DEFAULT_GUC_LOG_LEVEL) "])");
|
||||
|
||||
module_param_named_unsafe(guc_firmware_path, xe_modparam.guc_firmware_path, charp, 0400);
|
||||
MODULE_PARM_DESC(guc_firmware_path,
|
||||
|
|
@ -80,20 +66,20 @@ MODULE_PARM_DESC(gsc_firmware_path,
|
|||
module_param_named_unsafe(force_probe, xe_modparam.force_probe, charp, 0400);
|
||||
MODULE_PARM_DESC(force_probe,
|
||||
"Force probe options for specified devices. See CONFIG_DRM_XE_FORCE_PROBE for details "
|
||||
"[default=" DEFAULT_FORCE_PROBE "])");
|
||||
"[default=" XE_DEFAULT_FORCE_PROBE "])");
|
||||
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
module_param_named(max_vfs, xe_modparam.max_vfs, uint, 0400);
|
||||
MODULE_PARM_DESC(max_vfs,
|
||||
"Limit number of Virtual Functions (VFs) that could be managed. "
|
||||
"(0=no VFs; N=allow up to N VFs "
|
||||
"[default=" DEFAULT_MAX_VFS_STR "])");
|
||||
"[default=" XE_DEFAULT_MAX_VFS_STR "])");
|
||||
#endif
|
||||
|
||||
module_param_named_unsafe(wedged_mode, xe_modparam.wedged_mode, uint, 0600);
|
||||
MODULE_PARM_DESC(wedged_mode,
|
||||
"Module's default policy for the wedged mode (0=never, 1=upon-critical-error, 2=upon-any-hang-no-reset "
|
||||
"[default=" DEFAULT_WEDGED_MODE_STR "])");
|
||||
"[default=" XE_DEFAULT_WEDGED_MODE_STR "])");
|
||||
|
||||
static int xe_check_nomodeset(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user