[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230815065445.25576-1-hongao@uniontech.com>
Date: Tue, 15 Aug 2023 14:54:45 +0800
From: hongao <hongao@...ontech.com>
To: alexander.deucher@....com, Xinhui.Pan@....com, airlied@...il.com,
daniel@...ll.ch, lijo.lazar@....com, mario.limonciello@....com
Cc: amd-gfx@...ts.freedesktop.org, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org, hongao <hongao@...ontech.com>
Subject: [PATCH] drm/amdgpu/gmc6: fix in case the PCI BAR is larger than the actual amount of vram
[why]
limit visible_vram_size to real_vram_size in case
the PCI BAR is larger than the actual amount of vram.
Signed-off-by: hongao <hongao@...ontech.com>
---
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index b7dad4e67813..c0de7496bfd1 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -320,6 +320,8 @@ static int gmc_v6_0_mc_init(struct amdgpu_device *adev)
adev->gmc.aper_base = pci_resource_start(adev->pdev, 0);
adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
adev->gmc.visible_vram_size = adev->gmc.aper_size;
+ if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
+ adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
/* set the gart size */
if (amdgpu_gart_size == -1) {
--
2.20.1
Powered by blists - more mailing lists