aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2016-11-01 13:15:29 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-07-14 11:05:47 -0400
commitba3a5b83dd9b7490fcab098c875709c03cf439ef (patch)
treeea9670b826aeafdf5deea96ec798b1f0e3726f32
parente0205a7156a62bfcaa3f3f2ed556faf3c9b38aad (diff)
drm/amdgpu/gmc6: use the vram location programmed by the vbios
This makes mc programming much simpler in future patches. Since evergreen, the vbios has been programming the fb location to the proper vram size. The only reason to reprogram it would be to change the location. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
index d0214d942bfc..224b6935c885 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c
@@ -228,12 +228,15 @@ static int gmc_v6_0_mc_load_microcode(struct amdgpu_device *adev)
228static void gmc_v6_0_vram_gtt_location(struct amdgpu_device *adev, 228static void gmc_v6_0_vram_gtt_location(struct amdgpu_device *adev,
229 struct amdgpu_mc *mc) 229 struct amdgpu_mc *mc)
230{ 230{
231 u64 base = RREG32(mmMC_VM_FB_LOCATION) & 0xFFFF;
232 base <<= 24;
233
231 if (mc->mc_vram_size > 0xFFC0000000ULL) { 234 if (mc->mc_vram_size > 0xFFC0000000ULL) {
232 dev_warn(adev->dev, "limiting VRAM\n"); 235 dev_warn(adev->dev, "limiting VRAM\n");
233 mc->real_vram_size = 0xFFC0000000ULL; 236 mc->real_vram_size = 0xFFC0000000ULL;
234 mc->mc_vram_size = 0xFFC0000000ULL; 237 mc->mc_vram_size = 0xFFC0000000ULL;
235 } 238 }
236 amdgpu_vram_location(adev, &adev->mc, 0); 239 amdgpu_vram_location(adev, &adev->mc, base);
237 adev->mc.gtt_base_align = 0; 240 adev->mc.gtt_base_align = 0;
238 amdgpu_gtt_location(adev, mc); 241 amdgpu_gtt_location(adev, mc);
239} 242}