Skip to content

Commit 80742a1

Browse files
author
Lucas De Marchi
committed
drm/xe: Allow to drop vram resizing
The default behavior if the LMEMBAR doesn't match the maximum possible size is to try to resize it. However the user might want to keep, even for testing the behavior with small BAR, whatever size was set via sysfs. Change the module parameter to int and check for negative value. Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> Link: https://lore.kernel.org/r/20250409-bar-resize-param-v1-1-75bf4df38aa0@intel.com Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
1 parent 725648b commit 80742a1

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

drivers/gpu/drm/xe/xe_module.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ MODULE_PARM_DESC(force_execlist, "Force Execlist submission");
3939
module_param_named(probe_display, xe_modparam.probe_display, bool, 0444);
4040
MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise it's left untouched (default: true)");
4141

42-
module_param_named(vram_bar_size, xe_modparam.force_vram_bar_size, uint, 0600);
43-
MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size(in MiB)");
42+
module_param_named(vram_bar_size, xe_modparam.force_vram_bar_size, int, 0600);
43+
MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size (in MiB) - <0=disable-resize, 0=max-needed-size[default], >0=force-size");
4444

4545
module_param_named(guc_log_level, xe_modparam.guc_log_level, int, 0600);
4646
MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level (0=disable, 1..5=enable with verbosity min..max)");

drivers/gpu/drm/xe/xe_vram.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ _resize_bar(struct xe_device *xe, int resno, resource_size_t size)
4949
*/
5050
static void resize_vram_bar(struct xe_device *xe)
5151
{
52-
u64 force_vram_bar_size = xe_modparam.force_vram_bar_size;
52+
int force_vram_bar_size = xe_modparam.force_vram_bar_size;
5353
struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
5454
struct pci_bus *root = pdev->bus;
5555
resource_size_t current_size;
@@ -66,6 +66,9 @@ static void resize_vram_bar(struct xe_device *xe)
6666
if (!bar_size_mask)
6767
return;
6868

69+
if (force_vram_bar_size < 0)
70+
return;
71+
6972
/* set to a specific size? */
7073
if (force_vram_bar_size) {
7174
u32 bar_size_bit;

0 commit comments

Comments
 (0)