diff options
author | Christian König <christian.koenig@amd.com> | 2016-11-04 08:23:41 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 12:20:44 -0500 |
commit | f39093059b2f2998198ab1f7a4e0a92e177f0d66 (patch) | |
tree | c72ed4475ea1c35709c83417c0bf8615c6d424eb | |
parent | 8485b5e1876b46d7c4f63a2cfcec2ee30362a207 (diff) |
drm/amdgpu: access stolen VRAM directly on KV/KB (v2)
We don't need to use the PCI BAR on APUs. This allows us to access
the full VRAM directly without being limited by the BAR size.
v2: squash in 64bit shift fix
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c index 273b16fb9459..8d05e0c4e3d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | |||
@@ -375,9 +375,16 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev) | |||
375 | /* size in MB on si */ | 375 | /* size in MB on si */ |
376 | adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL; | 376 | adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL; |
377 | adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL; | 377 | adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL; |
378 | adev->mc.visible_vram_size = adev->mc.aper_size; | 378 | |
379 | #ifdef CONFIG_X86_64 | ||
380 | if (adev->flags & AMD_IS_APU) { | ||
381 | adev->mc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22; | ||
382 | adev->mc.aper_size = adev->mc.real_vram_size; | ||
383 | } | ||
384 | #endif | ||
379 | 385 | ||
380 | /* In case the PCI BAR is larger than the actual amount of vram */ | 386 | /* In case the PCI BAR is larger than the actual amount of vram */ |
387 | adev->mc.visible_vram_size = adev->mc.aper_size; | ||
381 | if (adev->mc.visible_vram_size > adev->mc.real_vram_size) | 388 | if (adev->mc.visible_vram_size > adev->mc.real_vram_size) |
382 | adev->mc.visible_vram_size = adev->mc.real_vram_size; | 389 | adev->mc.visible_vram_size = adev->mc.real_vram_size; |
383 | 390 | ||