[PATCH 102/159] drm/amdgpu: Add support for cached VRAM in A+A
Alex Deucher
alexander.deucher at amd.com
Wed Feb 24 22:18:02 UTC 2021
From: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>
This change was lost in last merge. The upstream commit 672242be560
removed init_mem_type
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>
Acked-by: Rajneesh Bhardwaj <rajneesh.bhardwaj at amd.com>
Reviewed-by: Eric Huang <jinhuieric.huang at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index b325b067926b..d6bc08fb5b42 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -181,8 +181,13 @@ int amdgpu_vram_mgr_init(struct amdgpu_device *adev)
struct ttm_resource_manager *man = &mgr->manager;
int ret;
- man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
- man->default_caching = TTM_PL_FLAG_WC;
+ if (adev->gmc.xgmi.connected_to_cpu) {
+ man->available_caching = TTM_PL_FLAG_CACHED;
+ man->default_caching = TTM_PL_FLAG_CACHED;
+ } else {
+ man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC;
+ man->default_caching = TTM_PL_FLAG_WC;
+ }
ttm_resource_manager_init(man, adev->gmc.real_vram_size >> PAGE_SHIFT);
--
2.29.2
More information about the amd-gfx
mailing list