mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
drm/amd: update mtype flags for gfx 9.5.0
Update mtype flags to meet gfx 9.5.0 requirements for remote GPU memory and system memory. Signed-off-by: Alex Sierra <alex.sierra@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Reviewed-by: Harish Kasiviswanathan <harish.kasiviswanathan@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
1f91cc4d94
commit
dad0c70507
@@ -1209,7 +1209,7 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
|
||||
if (uncached) {
|
||||
mtype = MTYPE_UC;
|
||||
} else if (ext_coherent) {
|
||||
if (adev->rev_id)
|
||||
if (gc_ip_version == IP_VERSION(9, 5, 0) || adev->rev_id)
|
||||
mtype = is_local ? MTYPE_CC : MTYPE_UC;
|
||||
else
|
||||
mtype = MTYPE_UC;
|
||||
@@ -1219,10 +1219,10 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
|
||||
/* dGPU */
|
||||
if (is_local)
|
||||
mtype = mtype_local;
|
||||
else if (is_vram)
|
||||
mtype = MTYPE_NC;
|
||||
else
|
||||
else if (gc_ip_version < IP_VERSION(9, 5, 0) && !is_vram)
|
||||
mtype = MTYPE_UC;
|
||||
else
|
||||
mtype = MTYPE_NC;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -1244,7 +1244,8 @@ svm_range_get_pte_flags(struct kfd_node *node,
|
||||
case IP_VERSION(9, 4, 4):
|
||||
case IP_VERSION(9, 5, 0):
|
||||
if (ext_coherent)
|
||||
mtype_local = node->adev->rev_id ? AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_UC;
|
||||
mtype_local = (gc_ip_version < IP_VERSION(9, 5, 0) && !node->adev->rev_id) ?
|
||||
AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_CC;
|
||||
else
|
||||
mtype_local = amdgpu_mtype_local == 1 ? AMDGPU_VM_MTYPE_NC :
|
||||
amdgpu_mtype_local == 2 ? AMDGPU_VM_MTYPE_CC : AMDGPU_VM_MTYPE_RW;
|
||||
@@ -1259,9 +1260,13 @@ svm_range_get_pte_flags(struct kfd_node *node,
|
||||
*/
|
||||
else if (svm_nodes_in_same_hive(bo_node, node) && !ext_coherent)
|
||||
mapping_flags |= AMDGPU_VM_MTYPE_NC;
|
||||
/* PCIe P2P or extended system scope coherence */
|
||||
else
|
||||
/* PCIe P2P on GPUs pre-9.5.0 */
|
||||
else if (gc_ip_version < IP_VERSION(9, 5, 0) &&
|
||||
!svm_nodes_in_same_hive(bo_node, node))
|
||||
mapping_flags |= AMDGPU_VM_MTYPE_UC;
|
||||
/* Other remote memory */
|
||||
else
|
||||
mapping_flags |= ext_coherent ? AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
||||
/* system memory accessed by the APU */
|
||||
} else if (node->adev->flags & AMD_IS_APU) {
|
||||
/* On NUMA systems, locality is determined per-page
|
||||
@@ -1273,7 +1278,10 @@ svm_range_get_pte_flags(struct kfd_node *node,
|
||||
mapping_flags |= ext_coherent ? AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
|
||||
/* system memory accessed by the dGPU */
|
||||
} else {
|
||||
mapping_flags |= AMDGPU_VM_MTYPE_UC;
|
||||
if (gc_ip_version < IP_VERSION(9, 5, 0))
|
||||
mapping_flags |= AMDGPU_VM_MTYPE_UC;
|
||||
else
|
||||
mapping_flags |= AMDGPU_VM_MTYPE_NC;
|
||||
}
|
||||
break;
|
||||
case IP_VERSION(12, 0, 0):
|
||||
|
||||
Reference in New Issue
Block a user