Skip to content

Commit

Permalink
drm/etnaviv: (re-)protect fence allocation with GPU mutex
Browse files Browse the repository at this point in the history
The fence allocation needs to be protected by the GPU mutex, otherwise
the fence seqnos of concurrent submits might not match the insertion order
of the jobs in the kernel ring. This breaks the assumption that jobs
complete with monotonically increasing fence seqnos.

Fixes: d985349 (drm/etnaviv: take GPU lock later in the submit process)
CC: [email protected] #4.9+
Signed-off-by: Lucas Stach <[email protected]>
  • Loading branch information
lynxeye-dev committed Mar 29, 2017
1 parent c1ae3cf commit f3cd1b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/etnaviv/etnaviv_gpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1311,15 +1311,15 @@ int etnaviv_gpu_submit(struct etnaviv_gpu *gpu,
goto out_pm_put;
}

mutex_lock(&gpu->lock);

fence = etnaviv_gpu_fence_alloc(gpu);
if (!fence) {
event_free(gpu, event);
ret = -ENOMEM;
goto out_pm_put;
}

mutex_lock(&gpu->lock);

gpu->event[event].fence = fence;
submit->fence = fence->seqno;
gpu->active_fence = submit->fence;
Expand Down

0 comments on commit f3cd1b0

Please sign in to comment.