• Rajneesh Bhardwaj's avatar
    drm/amdkfd: refactor runtime pm for baco · 9593f4d6
    Rajneesh Bhardwaj authored
    So far the kfd driver implemented same routines for runtime and system
    wide suspend and resume (s2idle or mem). During system wide suspend the
    kfd aquires an atomic lock that prevents any more user processes to
    create queues and interact with kfd driver and amd gpu. This mechanism
    created problem when amdgpu device is runtime suspended with BACO
    enabled. Any application that relies on kfd driver fails to load because
    the driver reports a locked kfd device since gpu is runtime suspended.
    
    However, in an ideal case, when gpu is runtime  suspended the kfd driver
    should be able to:
    
     - auto resume amdgpu driver whenever a client requests compute service
     - prevent runtime suspend for amdgpu  while kfd is in use
    
    This change refactors the amdgpu and amdkfd drivers to support BACO and
    runtime power management.
    Reviewed-by: default avatarOak Zeng <oak.zeng@amd.com>
    Reviewed-by: default avatarFelix Kuehling <felix.kuehling@amd.com>
    Signed-off-by: default avatarRajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    9593f4d6
kfd_priv.h 31.8 KB