]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/amdkfd: set coherent host access capability flag
authorAlex Sierra <alex.sierra@amd.com>
Thu, 15 Jun 2023 15:37:21 +0000 (10:37 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Jun 2023 19:35:34 +0000 (15:35 -0400)
This flag determines whether the host possesses coherent access to
the memory of the device.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c

index 90b86a6ac7bd63f030a1ccef73fa0e582cb19ea3..61fc62f3e0034a1b129ddb4ad298cb2667fa556d 100644 (file)
@@ -2107,6 +2107,10 @@ int kfd_topology_add_device(struct kfd_node *gpu)
        if (KFD_IS_SVM_API_SUPPORTED(dev->gpu->adev))
                dev->node_props.capability |= HSA_CAP_SVMAPI_SUPPORTED;
 
+       if (dev->gpu->adev->gmc.is_app_apu ||
+               dev->gpu->adev->gmc.xgmi.connected_to_cpu)
+               dev->node_props.capability |= HSA_CAP_FLAGS_COHERENTHOSTACCESS;
+
        kfd_debug_print_topology();
 
        kfd_notify_gpu_change(gpu_id, 1);