drm/amdgpu: convert amdgpu_amdkfd_gpuvm.c to IP version checks
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 3 Oct 2022 19:09:57 +0000 (15:09 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Oct 2022 21:41:19 +0000 (17:41 -0400)
For consistency with the rest of the code.

Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c

index 978d397..8ad01e1 100644 (file)
@@ -418,9 +418,9 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
        if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_EXECUTABLE)
                mapping_flags |= AMDGPU_VM_PAGE_EXECUTABLE;
 
-       switch (adev->asic_type) {
-       case CHIP_ARCTURUS:
-       case CHIP_ALDEBARAN:
+       switch (adev->ip_versions[GC_HWIP][0]) {
+       case IP_VERSION(9, 4, 1):
+       case IP_VERSION(9, 4, 2):
                if (mem->alloc_flags & KFD_IOC_ALLOC_MEM_FLAGS_VRAM) {
                        if (bo_adev == adev) {
                                if (uncached)
@@ -429,7 +429,7 @@ static uint64_t get_pte_flags(struct amdgpu_device *adev, struct kgd_mem *mem)
                                        mapping_flags |= AMDGPU_VM_MTYPE_CC;
                                else
                                        mapping_flags |= AMDGPU_VM_MTYPE_RW;
-                               if (adev->asic_type == CHIP_ALDEBARAN &&
+                               if ((adev->ip_versions[GC_HWIP][0] == IP_VERSION(9, 4, 2)) &&
                                    adev->gmc.xgmi.connected_to_cpu)
                                        snoop = true;
                        } else {