Commit 35d5f224 authored by Oak Zeng's avatar Oak Zeng Committed by Alex Deucher

drm/amdgpu: Don't reserve vram as WC for A+A

On A+A platform, vram can be mapped as WB. Not necessarily
to always map vram as WC on such platform.

Calling function arch_io_reserve_memtype_wc will mark the
whole vram region as WC. So don't call it for A+A platform.
Signed-off-by: default avatarOak Zeng <Oak.Zeng@amd.com>
Suggested-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Acked-by: default avatarChristian Konig <christian.koenig@amd.com>
Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent debd629a
...@@ -1065,13 +1065,17 @@ static const char *amdgpu_vram_names[] = { ...@@ -1065,13 +1065,17 @@ static const char *amdgpu_vram_names[] = {
*/ */
int amdgpu_bo_init(struct amdgpu_device *adev) int amdgpu_bo_init(struct amdgpu_device *adev)
{ {
/* reserve PAT memory space to WC for VRAM */ /* On A+A platform, VRAM can be mapped as WB */
arch_io_reserve_memtype_wc(adev->gmc.aper_base, if (!adev->gmc.xgmi.connected_to_cpu) {
adev->gmc.aper_size); /* reserve PAT memory space to WC for VRAM */
arch_io_reserve_memtype_wc(adev->gmc.aper_base,
adev->gmc.aper_size);
/* Add an MTRR for the VRAM */
adev->gmc.vram_mtrr = arch_phys_wc_add(adev->gmc.aper_base,
adev->gmc.aper_size);
}
/* Add an MTRR for the VRAM */
adev->gmc.vram_mtrr = arch_phys_wc_add(adev->gmc.aper_base,
adev->gmc.aper_size);
DRM_INFO("Detected VRAM RAM=%lluM, BAR=%lluM\n", DRM_INFO("Detected VRAM RAM=%lluM, BAR=%lluM\n",
adev->gmc.mc_vram_size >> 20, adev->gmc.mc_vram_size >> 20,
(unsigned long long)adev->gmc.aper_size >> 20); (unsigned long long)adev->gmc.aper_size >> 20);
...@@ -1089,8 +1093,10 @@ int amdgpu_bo_init(struct amdgpu_device *adev) ...@@ -1089,8 +1093,10 @@ int amdgpu_bo_init(struct amdgpu_device *adev)
void amdgpu_bo_fini(struct amdgpu_device *adev) void amdgpu_bo_fini(struct amdgpu_device *adev)
{ {
amdgpu_ttm_fini(adev); amdgpu_ttm_fini(adev);
arch_phys_wc_del(adev->gmc.vram_mtrr); if (!adev->gmc.xgmi.connected_to_cpu) {
arch_io_free_memtype_wc(adev->gmc.aper_base, adev->gmc.aper_size); arch_phys_wc_del(adev->gmc.vram_mtrr);
arch_io_free_memtype_wc(adev->gmc.aper_base, adev->gmc.aper_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