[Intel-xe] [PATCH 4/4] drm/xe: Migrate module parameters to new debugfs structure
Stuart Summers
stuart.summers at intel.com
Wed Apr 19 17:55:01 UTC 2023
Use the new debugfs structure for the current module parameters
outside of force_probe. This still allows the driver to be
manually probed without any need to change the autoprobe settings.
For the rest, they can now be tuned prior to binding to the device
by disabling the driver autoprobe.
Drop the current dummy parameter.
Signed-off-by: Stuart Summers <stuart.summers at intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 4 ++--
drivers/gpu/drm/xe/xe_display.c | 3 ++-
drivers/gpu/drm/xe/xe_guc_log.c | 2 +-
drivers/gpu/drm/xe/xe_mmio.c | 4 ++--
drivers/gpu/drm/xe/xe_module.c | 16 ----------------
drivers/gpu/drm/xe/xe_module.h | 5 -----
drivers/gpu/drm/xe/xe_params.h | 5 ++++-
7 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 867051d74eea..b07f8fc1a515 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -195,8 +195,8 @@ int xe_device_init(struct xe_device *xe)
if (WARN_ON(err))
goto err_put;
- xe->info.enable_guc = enable_guc;
- xe->info.enable_display = enable_display;
+ xe->info.enable_guc = xe->info.params.enable_guc;
+ xe->info.enable_display = xe->info.params.enable_display;
spin_lock_init(&xe->irq.lock);
diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
index c67f6a591a58..35f8344fdc5a 100644
--- a/drivers/gpu/drm/xe/xe_display.c
+++ b/drivers/gpu/drm/xe/xe_display.c
@@ -29,6 +29,7 @@
#include "intel_hotplug.h"
#include "intel_opregion.h"
#include "xe_module.h"
+#include "xe_params.h"
/* Xe device functions */
@@ -49,7 +50,7 @@ static void xe_display_last_close(struct drm_device *dev)
*/
int xe_display_set_driver_hooks(struct pci_dev *pdev, struct drm_driver *driver)
{
- if (!enable_display)
+ if (!xe_modparams.enable_display)
return 0;
/* Detect if we need to wait for other drivers early on */
diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
index 9a7b5d5906c1..9a2930f6613f 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.c
+++ b/drivers/gpu/drm/xe/xe_guc_log.c
@@ -100,7 +100,7 @@ int xe_guc_log_init(struct xe_guc_log *log)
xe_map_memset(xe, &bo->vmap, 0, 0, guc_log_size());
log->bo = bo;
- log->level = xe_guc_log_level;
+ log->level = xe->info.params.guc_log_level;
err = drmm_add_action_or_reset(&xe->drm, guc_log_fini, log);
if (err)
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index 5cacaa05759a..58c459d852ed 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -78,7 +78,7 @@ static int xe_resize_vram_bar(struct xe_device *xe, resource_size_t vram_size)
u32 pci_cmd;
int i;
int ret;
- u64 force_vram_bar_size = xe_force_vram_bar_size;
+ u64 force_vram_bar_size = xe->info.params.force_vram_bar_size;
current_size = roundup_pow_of_two(pci_resource_len(pdev, GEN12_LMEM_BAR));
@@ -225,7 +225,7 @@ int xe_mmio_probe_vram(struct xe_device *xe)
drm_info(&xe->drm, "Successfully resize VRAM from %lluMiB to %lluMiB\n",
(u64)original_size >> 20,
(u64)xe->mem.vram.io_size >> 20);
- else if (xe->mem.vram.io_size < usable_size && !xe_force_vram_bar_size)
+ else if (xe->mem.vram.io_size < usable_size && !xe->info.params.force_vram_bar_size)
drm_info(&xe->drm, "Using a reduced BAR size of %lluMiB. Consider enabling 'Resizable BAR' support in your BIOS.\n",
(u64)xe->mem.vram.size >> 20);
if (xe->mem.vram.size < vram_size)
diff --git a/drivers/gpu/drm/xe/xe_module.c b/drivers/gpu/drm/xe/xe_module.c
index 6860586ce7f8..962c89d371d8 100644
--- a/drivers/gpu/drm/xe/xe_module.c
+++ b/drivers/gpu/drm/xe/xe_module.c
@@ -14,22 +14,6 @@
#include "xe_pci.h"
#include "xe_sched_job.h"
-bool enable_guc = true;
-module_param_named_unsafe(enable_guc, enable_guc, bool, 0444);
-MODULE_PARM_DESC(enable_guc, "Enable GuC submission");
-
-bool enable_display = true;
-module_param_named(enable_display, enable_display, bool, 0444);
-MODULE_PARM_DESC(enable_display, "Enable display");
-
-u32 xe_force_vram_bar_size;
-module_param_named(vram_bar_size, xe_force_vram_bar_size, uint, 0600);
-MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size(in MiB)");
-
-int xe_guc_log_level = 5;
-module_param_named(guc_log_level, xe_guc_log_level, int, 0600);
-MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level (0=disable, 1..5=enable with verbosity min..max)");
-
char *xe_param_force_probe = CONFIG_DRM_XE_FORCE_PROBE;
module_param_named_unsafe(force_probe, xe_param_force_probe, charp, 0400);
MODULE_PARM_DESC(force_probe,
diff --git a/drivers/gpu/drm/xe/xe_module.h b/drivers/gpu/drm/xe/xe_module.h
index 86916c176382..fb95bff2c2f4 100644
--- a/drivers/gpu/drm/xe/xe_module.h
+++ b/drivers/gpu/drm/xe/xe_module.h
@@ -5,9 +5,4 @@
#include <linux/init.h>
-/* Module modprobe variables */
-extern bool enable_guc;
-extern bool enable_display;
-extern u32 xe_force_vram_bar_size;
-extern int xe_guc_log_level;
extern char *xe_param_force_probe;
diff --git a/drivers/gpu/drm/xe/xe_params.h b/drivers/gpu/drm/xe/xe_params.h
index 26fb592e9cd6..7d17d75c1a85 100644
--- a/drivers/gpu/drm/xe/xe_params.h
+++ b/drivers/gpu/drm/xe/xe_params.h
@@ -23,7 +23,10 @@ struct drm_printer;
* debugfs file
*/
#define XE_PARAMS_FOR_EACH(param) \
- param(bool, dummy, true, 0444)
+ param(bool, enable_guc, true, 0444) \
+ param(bool, enable_display, true, 0444) \
+ param(unsigned int, force_vram_bar_size, -1, 0600) \
+ param(int, guc_log_level, 5, 0600)
#define MEMBER(T, member, ...) T member;
struct xe_params {
--
2.38.1.143.g1fc3c0ad40
More information about the Intel-xe
mailing list