Commit 9d46f32b authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/amdgpu: allow for more flexible priority handling

Allow to call amdgpu_ring_priority_get() after pushing the ring to the
scheduler.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarChunming Zhou <david1.zhou@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e6d57520
...@@ -211,7 +211,8 @@ void amdgpu_ring_priority_get(struct amdgpu_ring *ring, ...@@ -211,7 +211,8 @@ void amdgpu_ring_priority_get(struct amdgpu_ring *ring,
if (!ring->funcs->set_priority) if (!ring->funcs->set_priority)
return; return;
atomic_inc(&ring->num_jobs[priority]); if (atomic_inc_return(&ring->num_jobs[priority]) <= 0)
return;
mutex_lock(&ring->priority_mutex); mutex_lock(&ring->priority_mutex);
if (priority <= ring->priority) if (priority <= ring->priority)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment