drm/xe: fix xe_mmio_total_vram_size
authorPhilippe Lecluse <philippe.lecluse@intel.com>
Fri, 13 Jan 2023 14:07:17 +0000 (14:07 +0000)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 12 Dec 2023 19:06:00 +0000 (14:06 -0500)
As also cause issue on PVC, moving back
to what we did before stolen was
introduced

Signed-off-by: Philippe Lecluse <philippe.lecluse@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_mmio.c

index 88d475d..54d2a94 100644 (file)
@@ -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;
        }