Skip to content

Commit 0b075f8

Browse files
Lucas De Marchimattrope
authored andcommitted
drm/xe: Improve rebar log messages
Some minor improvements to the log messages in the rebar logic: use xe-oriented printk, switch unit from M to MiB in a few places for consistency and use ilog2(SZ_1M) for clarity. Suggested-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patch.msgid.link/20251219211650.1908961-6-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
1 parent 382876a commit 0b075f8

1 file changed

Lines changed: 11 additions & 13 deletions

File tree

drivers/gpu/drm/xe/xe_pci_rebar.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
#include <linux/pci.h>
77
#include <linux/types.h>
88

9-
#include <drm/drm_print.h>
10-
119
#include "regs/xe_bars.h"
1210
#include "xe_device_types.h"
1311
#include "xe_module.h"
1412
#include "xe_pci_rebar.h"
13+
#include "xe_printk.h"
1514

1615
static void resize_bar(struct xe_device *xe, int resno, resource_size_t size)
1716
{
@@ -21,12 +20,12 @@ static void resize_bar(struct xe_device *xe, int resno, resource_size_t size)
2120

2221
ret = pci_resize_resource(pdev, resno, bar_size, 0);
2322
if (ret) {
24-
drm_info(&xe->drm, "Failed to resize BAR%d to %dM (%pe). Consider enabling 'Resizable BAR' support in your BIOS\n",
25-
resno, 1 << bar_size, ERR_PTR(ret));
23+
xe_info(xe, "Failed to resize BAR%d to %dMiB (%pe). Consider enabling 'Resizable BAR' support in your BIOS\n",
24+
resno, 1 << bar_size, ERR_PTR(ret));
2625
return;
2726
}
2827

29-
drm_info(&xe->drm, "BAR%d resized to %dM\n", resno, 1 << bar_size);
28+
xe_info(xe, "BAR%d resized to %dMiB\n", resno, 1 << bar_size);
3029
}
3130

3231
/*
@@ -59,11 +58,10 @@ void xe_pci_rebar_resize(struct xe_device *xe)
5958
(resource_size_t)SZ_1M);
6059

6160
if (!pci_rebar_size_supported(pdev, LMEM_BAR, rebar_size)) {
62-
drm_info(&xe->drm,
63-
"Requested size: %lluMiB is not supported by rebar sizes: 0x%llx. Leaving default: %lluMiB\n",
64-
(u64)pci_rebar_size_to_bytes(rebar_size) >> 20,
65-
pci_rebar_get_possible_sizes(pdev, LMEM_BAR),
66-
(u64)current_size >> 20);
61+
xe_info(xe, "Requested size %lluMiB is not supported by rebar sizes: 0x%llx. Leaving default: %lluMiB\n",
62+
(u64)pci_rebar_size_to_bytes(rebar_size) >> ilog2(SZ_1M),
63+
pci_rebar_get_possible_sizes(pdev, LMEM_BAR),
64+
(u64)current_size >> ilog2(SZ_1M));
6765
return;
6866
}
6967

@@ -81,8 +79,8 @@ void xe_pci_rebar_resize(struct xe_device *xe)
8179
return;
8280
}
8381

84-
drm_info(&xe->drm, "Attempting to resize bar from %lluMiB -> %lluMiB\n",
85-
(u64)current_size >> 20, (u64)rebar_size >> 20);
82+
xe_info(xe, "Attempting to resize bar from %lluMiB -> %lluMiB\n",
83+
(u64)current_size >> ilog2(SZ_1M), (u64)rebar_size >> ilog2(SZ_1M));
8684

8785
while (root->parent)
8886
root = root->parent;
@@ -94,7 +92,7 @@ void xe_pci_rebar_resize(struct xe_device *xe)
9492
}
9593

9694
if (!root_res) {
97-
drm_info(&xe->drm, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resizable BAR' support in your BIOS\n");
95+
xe_info(xe, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resizable BAR' support in your BIOS\n");
9896
return;
9997
}
10098

0 commit comments

Comments
 (0)