Skip to content

Commit

Permalink
drm/amdgpu: Correct dGPU MTYPE settings for gfx943
Browse files Browse the repository at this point in the history
Revert temporary dGPU VRAM MTYPE setting and align with expected
coherency protocol.

Signed-off-by: Graham Sider <Graham.Sider@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Graham Sider authored and Alex Deucher committed Jun 9, 2023
1 parent 30b5299 commit d839a15
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
15 changes: 5 additions & 10 deletions drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1238,17 +1238,12 @@ static void gmc_v9_0_get_coherence_flags(struct amdgpu_device *adev,
mtype = MTYPE_RW;
} else {
/* dGPU */
/*
if ((mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) &&
bo_adev == adev)
mapping_flags |= AMDGPU_VM_MTYPE_RW;
if (is_vram && bo_adev == adev)
mtype = MTYPE_RW;
else if (is_vram)
mtype = MTYPE_NC;
else
*/
/* Temporarily comment out above lines and use MTYPE_NC
* on both VRAM and system memory access until
* MTYPE_RW can properly work on VRAM access
*/
mtype = MTYPE_NC;
mtype = MTYPE_UC;
}

break;
Expand Down
8 changes: 2 additions & 6 deletions drivers/gpu/drm/amd/amdkfd/kfd_svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1198,13 +1198,9 @@ svm_range_get_pte_flags(struct kfd_node *node,
if (uncached) {
mapping_flags |= AMDGPU_VM_MTYPE_UC;
} else if (domain == SVM_RANGE_VRAM_DOMAIN) {
/* local HBM region close to partition with a workaround
* for Endpoint systems.
*/
/* local HBM region close to partition */
if (bo_node == node)
mapping_flags |=
(node->adev->flags & AMD_IS_APU) ?
AMDGPU_VM_MTYPE_RW : AMDGPU_VM_MTYPE_NC;
mapping_flags |= AMDGPU_VM_MTYPE_RW;
/* local HBM region far from partition or remote XGMI GPU */
else if (svm_nodes_in_same_hive(bo_node, node))
mapping_flags |= AMDGPU_VM_MTYPE_NC;
Expand Down

0 comments on commit d839a15

Please sign in to comment.