diff options
author | 2021-04-01 14:36:41 -0500 | |
---|---|---|
committer | 2021-04-15 16:03:01 -0400 | |
commit | 0ca565ab97083acaf640dd58a6f66cbe3d802356 (patch) | |
tree | 16e3c6960d7b32a381839df764bac88bc4a707ec /drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c | |
parent | drm/amdgpu: Introduce functions for vram physical addr calculation (diff) | |
download | linux-0ca565ab97083acaf640dd58a6f66cbe3d802356.tar.gz linux-0ca565ab97083acaf640dd58a6f66cbe3d802356.tar.bz2 linux-0ca565ab97083acaf640dd58a6f66cbe3d802356.zip |
drm/amdgpu: Calling address translation functions to simplify codes
Use amdgpu_gmc_vram_pa and amdgpu_gmc_vram_cpu_pa
to simplify codes. No logic change.
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c index 1141c37432f0..a9899335d0b1 100644 --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c @@ -162,8 +162,7 @@ static void mmhub_v2_3_init_system_aperture_regs(struct amdgpu_device *adev) max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18); /* Set default page address. */ - value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start + - adev->vm_manager.vram_base_offset; + value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr); WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB, (u32)(value >> 12)); WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB, |