[PATCH 2/2] drm/amdkfd: change SVM MTYPEs for Aldebaran's HW requirement

Eric Huang jinhuieric.huang at amd.com
Fri Apr 9 20:05:27 UTC 2021


From: Philip Yang <Philip.Yang at amd.com>

Due to changes of HW memory model, we need to change Aldebaran MTYPEs to
meet HW changes.

Change-Id: I0b566ccd1d406abe93ee84da91216794fc650ed4
Signed-off-by: Philip Yang <Philip.Yang at amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling at amd.com>
---
 drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
index e8a21ed3a361..a66d0a9dbd7d 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
@@ -1066,21 +1066,18 @@ svm_range_get_pte_flags(struct amdgpu_device *adev, struct svm_range *prange)
 	case CHIP_ALDEBARAN:
 		if (prange->svm_bo && prange->mm_nodes) {
 			if (bo_adev == adev) {
-				mapping_flags |= AMDGPU_VM_MTYPE_RW;
+				mapping_flags |= coherent ?
+					AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW;
 				if (adev->gmc.xgmi.connected_to_cpu)
 					snoop = true;
 			} else {
-				mapping_flags |= AMDGPU_VM_MTYPE_NC;
+				mapping_flags |= AMDGPU_VM_MTYPE_UC;
 				if (amdgpu_xgmi_same_hive(adev, bo_adev))
 					snoop = true;
 			}
 		} else {
 			snoop = true;
-			if (adev->gmc.xgmi.connected_to_cpu)
-				/* system memory uses NC on A+A */
-				mapping_flags |= AMDGPU_VM_MTYPE_NC;
-			else
-				mapping_flags |= coherent ?
+			mapping_flags |= coherent ?
 					AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
 		}
 		break;
-- 
2.17.1



More information about the amd-gfx mailing list