Commit 78b7dfd9 authored by Alan Swanson's avatar Alan Swanson Committed by Alex Deucher

drm/amdgpu: resize VRAM BAR for CPU access on gfx10

Try to resize BAR0 to let CPU access all of VRAM on Navi. Syncs
code with previous gfx generations from commit d6895ad3
("drm/amdgpu: resize VRAM BAR for CPU access v6").
Signed-off-by: default avatarAlan Swanson <reiver@improbability.net>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d3a37634
...@@ -686,17 +686,23 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev, ...@@ -686,17 +686,23 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
*/ */
static int gmc_v10_0_mc_init(struct amdgpu_device *adev) static int gmc_v10_0_mc_init(struct amdgpu_device *adev)
{ {
/* Could aper size report 0 ? */ int r;
adev->gmc.aper_base = pci_resource_start(adev->pdev, 0);
adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
/* size in MB on si */ /* size in MB on si */
adev->gmc.mc_vram_size = adev->gmc.mc_vram_size =
adev->nbio.funcs->get_memsize(adev) * 1024ULL * 1024ULL; adev->nbio.funcs->get_memsize(adev) * 1024ULL * 1024ULL;
adev->gmc.real_vram_size = adev->gmc.mc_vram_size; adev->gmc.real_vram_size = adev->gmc.mc_vram_size;
adev->gmc.visible_vram_size = adev->gmc.aper_size;
if (!(adev->flags & AMD_IS_APU)) {
r = amdgpu_device_resize_fb_bar(adev);
if (r)
return r;
}
adev->gmc.aper_base = pci_resource_start(adev->pdev, 0);
adev->gmc.aper_size = pci_resource_len(adev->pdev, 0);
/* In case the PCI BAR is larger than the actual amount of vram */ /* In case the PCI BAR is larger than the actual amount of vram */
adev->gmc.visible_vram_size = adev->gmc.aper_size;
if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size) if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
adev->gmc.visible_vram_size = adev->gmc.real_vram_size; adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment