• Andres Rodriguez's avatar
    drm/amdgpu: add framework for HW specific priority settings v9 · b2ff0e8a
    Andres Rodriguez authored
    Add an initial framework for changing the HW priorities of rings. The
    framework allows requesting priority changes for the lifetime of an
    amdgpu_job. After the job completes the priority will decay to the next
    lowest priority for which a request is still valid.
    
    A new ring function set_priority() can now be populated to take care of
    the HW specific programming sequence for priority changes.
    
    v2: set priority before emitting IB, and take a ref on amdgpu_job
    v3: use AMD_SCHED_PRIORITY_* instead of AMDGPU_CTX_PRIORITY_*
    v4: plug amdgpu_ring_restore_priority_cb into amdgpu_job_free_cb
    v5: use atomic for tracking job priorities instead of last_job
    v6: rename amdgpu_ring_priority_[get/put]() and align parameters
    v7: replace spinlocks with mutexes for KIQ compatibility
    v8: raise ring priority during cs_ioctl, instead of job_run
    v9: priority_get() before push_job()
    Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
    Acked-by: default avatarChristian König <christian.koenig@amd.com>
    Signed-off-by: default avatarAndres Rodriguez <andresx7@gmail.com>
    Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
    b2ff0e8a
amdgpu_cs.c 38.9 KB