]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amdkfd: change MTYPEs for Aldebaran's HW requirement
authorEric Huang <jinhuieric.huang@amd.com>
Tue, 6 Apr 2021 17:19:40 +0000 (13:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Apr 2021 20:03:27 +0000 (16:03 -0400)
Due to changes of HW memory model, we need to change Aldebaran
MTYPEs to meet HW changes.

Signed-off-by: Eric Huang <jinhuieric.huang@amd.com>
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index e93850f2f3b11c400eea93b0b5da27259681a15e..6622695a5eed10fa6780df99941aeced2a23d50f 100644 (file)
@@ -445,22 +445,19 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
                        mapping_flags |= AMDGPU_VM_MTYPE_UC;
                } else if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
                        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 ?
-                                       AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
+                       mapping_flags |= coherent ?
+                               AMDGPU_VM_MTYPE_UC : AMDGPU_VM_MTYPE_NC;
                }
                break;
        default: