From: Philippe Lecluse Date: Fri, 13 Jan 2023 14:07:17 +0000 (+0000) Subject: drm/xe: fix xe_mmio_total_vram_size X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=760f168db30a5c06893e87c88f25cd3578a8453a;p=linux.git drm/xe: fix xe_mmio_total_vram_size As also cause issue on PVC, moving back to what we did before stolen was introduced Signed-off-by: Philippe Lecluse Reviewed-by: Matthew Auld Signed-off-by: Rodrigo Vivi --- diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index 88d475dca6db6..54d2a94a75190 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -159,12 +159,8 @@ int xe_mmio_total_vram_size(struct xe_device *xe, u64 *vram_size, u64 *usable_si if (!xe->info.has_flat_ccs) { *vram_size = pci_resource_len(pdev, GEN12_LMEM_BAR); - if (usable_size) { - if (xe->info.platform == XE_DG1) - *usable_size = xe_mmio_read64(gt, GEN12_GSMBASE.reg); - else - *usable_size = *vram_size; - } + if (usable_size) + *usable_size = min(*vram_size, xe_mmio_read64(gt, GEN12_GSMBASE.reg)); return 0; }