drm/xe/mmio: stop incorrectly triggering drm_warn
authorMatthew Auld <matthew.auld@intel.com>
Tue, 11 Apr 2023 10:04:58 +0000 (11:04 +0100)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:31:41 +0000 (18:31 -0500)
CI keeps triggering:

xe 0000:03:00.0: [drm] Restricting VRAM size to PCI resource size
(0x400000000->0x3fa000000)

Due to usable_size vs vram_size differences. However, we only want to
trigger the drm_warn() to let developers know that the system they are
using is going clamp the VRAM size to match the IO size, where they can
likely only use 256M of VRAM. Once we properly support small-bar we can
revisit this.

v2 (Lucas): Drop the TODO for now

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Gwan-gyeong Mun <gwan-gyeong.mun@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_mmio.c

index 5cacaa05759adaef7c37ec7f0dacfa0b63e9c229..98357c1f109f9c5b148980eab4980cd8aaf4e8a1 100644 (file)
@@ -228,9 +228,9 @@ int xe_mmio_probe_vram(struct xe_device *xe)
        else if (xe->mem.vram.io_size < usable_size && !xe_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)
+       if (usable_size > xe->mem.vram.io_size)
                drm_warn(&xe->drm, "Restricting VRAM size to PCI resource size (0x%llx->0x%llx)\n",
-                        vram_size, (u64)xe->mem.vram.size);
+                        usable_size, xe->mem.vram.io_size);
 
        xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe->mem.vram.io_size);
        xe->mem.vram.size = min_t(u64, xe->mem.vram.size, usable_size);