drm/msm: Reorder lock vs submit alloc
This lets us drop the NORETRY. Signed-off-by: Rob Clark <robdclark@chromium.org> Patchwork: https://patchwork.freedesktop.org/patch/496114/ Link: https://lore.kernel.org/r/20220802155152.1727594-2-robdclark@gmail.com
This commit is contained in:
parent
1c23f9e627
commit
f0de40a131
1 changed files with 10 additions and 14 deletions
|
@ -36,7 +36,7 @@ static struct msm_gem_submit *submit_create(struct drm_device *dev,
|
||||||
if (sz > SIZE_MAX)
|
if (sz > SIZE_MAX)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
submit = kzalloc(sz, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY);
|
submit = kzalloc(sz, GFP_KERNEL);
|
||||||
if (!submit)
|
if (!submit)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
@ -771,25 +771,21 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
|
||||||
trace_msm_gpu_submit(pid_nr(pid), ring->id, submitid,
|
trace_msm_gpu_submit(pid_nr(pid), ring->id, submitid,
|
||||||
args->nr_bos, args->nr_cmds);
|
args->nr_bos, args->nr_cmds);
|
||||||
|
|
||||||
ret = mutex_lock_interruptible(&queue->lock);
|
|
||||||
if (ret)
|
|
||||||
goto out_post_unlock;
|
|
||||||
|
|
||||||
if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) {
|
if (args->flags & MSM_SUBMIT_FENCE_FD_OUT) {
|
||||||
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
|
out_fence_fd = get_unused_fd_flags(O_CLOEXEC);
|
||||||
if (out_fence_fd < 0) {
|
if (out_fence_fd < 0) {
|
||||||
ret = out_fence_fd;
|
ret = out_fence_fd;
|
||||||
goto out_unlock;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
submit = submit_create(dev, gpu, queue, args->nr_bos,
|
submit = submit_create(dev, gpu, queue, args->nr_bos, args->nr_cmds);
|
||||||
args->nr_cmds);
|
if (IS_ERR(submit))
|
||||||
if (IS_ERR(submit)) {
|
return PTR_ERR(submit);
|
||||||
ret = PTR_ERR(submit);
|
|
||||||
submit = NULL;
|
ret = mutex_lock_interruptible(&queue->lock);
|
||||||
goto out_unlock;
|
if (ret)
|
||||||
}
|
goto out_post_unlock;
|
||||||
|
|
||||||
submit->pid = pid;
|
submit->pid = pid;
|
||||||
submit->ident = submitid;
|
submit->ident = submitid;
|
||||||
|
@ -965,9 +961,9 @@ out_unlock:
|
||||||
if (ret && (out_fence_fd >= 0))
|
if (ret && (out_fence_fd >= 0))
|
||||||
put_unused_fd(out_fence_fd);
|
put_unused_fd(out_fence_fd);
|
||||||
mutex_unlock(&queue->lock);
|
mutex_unlock(&queue->lock);
|
||||||
|
out_post_unlock:
|
||||||
if (submit)
|
if (submit)
|
||||||
msm_gem_submit_put(submit);
|
msm_gem_submit_put(submit);
|
||||||
out_post_unlock:
|
|
||||||
if (!IS_ERR_OR_NULL(post_deps)) {
|
if (!IS_ERR_OR_NULL(post_deps)) {
|
||||||
for (i = 0; i < args->nr_out_syncobjs; ++i) {
|
for (i = 0; i < args->nr_out_syncobjs; ++i) {
|
||||||
kfree(post_deps[i].chain);
|
kfree(post_deps[i].chain);
|
||||||
|
|
Loading…
Add table
Reference in a new issue