Return-Path: From: Rodrigo Vivi Date: Fri, 20 Jan 2023 15:44:10 -0500 Message-ID: <20230120204426.68104-5-rodrigo.vivi@intel.com> In-Reply-To: <20230120204426.68104-1-rodrigo.vivi@intel.com> References: <20230120204426.68104-1-rodrigo.vivi@intel.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain MIME-Version: 1.0 Subject: [Intel-xe] [PATCH 04/20] drm/xe: fix xe_mmio_total_vram_size List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" To: intel-xe@lists.freedesktop.org, maarten.lankhorst@linux.intel.com, philippe.lecluse@intel.com, mchehab@kernel.org Cc: Matthew Auld , Rodrigo Vivi From: Philippe Lecluse As also cause issue on PVC, moving back to what we did before stolen was introduced Signed-off-by: Philippe Lecluse Cc: Matthew Auld Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/xe/xe_mmio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c index b3c1a39ef79d..7600ce348005 100644 --- a/drivers/gpu/drm/xe/xe_mmio.c +++ b/drivers/gpu/drm/xe/xe_mmio.c @@ -162,12 +162,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; } -- 2.39.0