[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com>

-----Original Message-----
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> On Behalf Of Eric Huang
Sent: Friday, April 9, 2021 4:05 PM
To: amd-gfx@lists.freedesktop.org
Cc: Huang, JinHuiEric <jinhuieric.hu...@amd.com>; Greathouse, Joseph 
<joseph.greatho...@amd.com>
Subject: [PATCH 1/2] drm/amdkfd: change MTYPEs for Aldebaran's HW requirement

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

Signed-off-by: Eric Huang <jinhuieric.hu...@amd.com>
Reviewed-by: Harish Kasiviswanathan <harish.kasiviswanat...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
index 7357c1e4d883..b6662f53c28c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
@@ -439,22 +439,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:
--
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Charish.kasiviswanathan%40amd.com%7Cfccf86dba3ee4f08205b08d8fb92e9b2%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637535955702309648%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=U8Uv2qoePy%2BQct%2BDgho%2BrkGJvbJQpcwE%2FuAjf7jREGg%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to