Skip to content

Commit 4abf0b0

Browse files
dayatsin-amdalexdeucher
authored andcommitted
drm/amdgpu: Change extended-scope MTYPE on GC 9.4.3
Change local memory type to MTYPE_UC on revision id 0 Signed-off-by: David Yat Sin <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 61e0a98 commit 4abf0b0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,10 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
11801180
if (uncached) {
11811181
mtype = MTYPE_UC;
11821182
} else if (ext_coherent) {
1183-
mtype = is_local ? MTYPE_CC : MTYPE_UC;
1183+
if (adev->rev_id)
1184+
mtype = is_local ? MTYPE_CC : MTYPE_UC;
1185+
else
1186+
mtype = MTYPE_UC;
11841187
} else if (adev->flags & AMD_IS_APU) {
11851188
mtype = is_local ? mtype_local : MTYPE_NC;
11861189
} else {
@@ -1301,7 +1304,7 @@ static void gmc_v9_0_override_vm_pte_flags(struct amdgpu_device *adev,
13011304

13021305
*flags = (*flags & ~AMDGPU_PTE_MTYPE_VG10_MASK) |
13031306
AMDGPU_PTE_MTYPE_VG10(mtype_local);
1304-
} else {
1307+
} else if (adev->rev_id) {
13051308
/* MTYPE_UC case */
13061309
*flags = (*flags & ~AMDGPU_PTE_MTYPE_VG10_MASK) |
13071310
AMDGPU_PTE_MTYPE_VG10(MTYPE_CC);

drivers/gpu/drm/amd/amdkfd/kfd_svm.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,9 +1255,11 @@ svm_range_get_pte_flags(struct kfd_node *node,
12551255
}
12561256
break;
12571257
case IP_VERSION(9, 4, 3):
1258-
mtype_local = amdgpu_mtype_local == 1 ? AMDGPU_VM_MTYPE_NC :
1259-
(amdgpu_mtype_local == 2 || ext_coherent ?
1260-
AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW);
1258+
if (ext_coherent)
1259+
mtype_local = node->adev->rev_id ? AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_UC;
1260+
else
1261+
mtype_local = amdgpu_mtype_local == 1 ? AMDGPU_VM_MTYPE_NC :
1262+
amdgpu_mtype_local == 2 ? AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW;
12611263
snoop = true;
12621264
if (uncached) {
12631265
mapping_flags |= AMDGPU_VM_MTYPE_UC;

0 commit comments

Comments
 (0)