Commit 2e3a2dda authored by Lucas Stach's avatar Lucas Stach

drm/etnaviv: move submit free out of critical section

There is no need to hold the GPU lock while freeing the submit
object. Only move the retired submits from the GPU active list to
a temporary retire list under the GPU lock.
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
parent a7cfa565
...@@ -1201,20 +1201,22 @@ static void retire_worker(struct work_struct *work) ...@@ -1201,20 +1201,22 @@ static void retire_worker(struct work_struct *work)
retire_work); retire_work);
u32 fence = gpu->completed_fence; u32 fence = gpu->completed_fence;
struct etnaviv_gem_submit *submit, *tmp; struct etnaviv_gem_submit *submit, *tmp;
LIST_HEAD(retire_list);
mutex_lock(&gpu->lock); mutex_lock(&gpu->lock);
list_for_each_entry_safe(submit, tmp, &gpu->active_submit_list, node) { list_for_each_entry_safe(submit, tmp, &gpu->active_submit_list, node) {
if (!dma_fence_is_signaled(submit->out_fence)) if (!dma_fence_is_signaled(submit->out_fence))
break; break;
list_del(&submit->node); list_move(&submit->node, &retire_list);
etnaviv_submit_put(submit);
} }
gpu->retired_fence = fence; gpu->retired_fence = fence;
mutex_unlock(&gpu->lock); mutex_unlock(&gpu->lock);
list_for_each_entry_safe(submit, tmp, &retire_list, node)
etnaviv_submit_put(submit);
} }
int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu, int etnaviv_gpu_wait_fence_interruptible(struct etnaviv_gpu *gpu,
......
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