From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Archit Taneja <architt@codeaurora.org>,
freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Rob Clark <robdclark@gmail.com>
Subject: [PATCH 01/10] drm/msm: use mutex_lock_interruptible for submit ioctl
Date: Thu, 16 Jun 2016 17:22:26 -0400 [thread overview]
Message-ID: <1466112155-25061-2-git-send-email-robdclark@gmail.com> (raw)
In-Reply-To: <1466112155-25061-1-git-send-email-robdclark@gmail.com>
Be kinder to things that do lots of signal handling (ie. Xorg)
Signed-off-by: Rob Clark <robdclark@gmail.com>
---
drivers/gpu/drm/msm/msm_gem_submit.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index eb4bb8b..ea5f709 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -372,11 +372,15 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if (args->nr_cmds > MAX_CMDS)
return -EINVAL;
- submit = submit_create(dev, gpu, args->nr_bos);
- if (!submit)
- return -ENOMEM;
+ ret = mutex_lock_interruptible(&dev->struct_mutex);
+ if (ret)
+ return ret;
- mutex_lock(&dev->struct_mutex);
+ submit = submit_create(dev, gpu, args->nr_bos);
+ if (!submit) {
+ ret = -ENOMEM;
+ goto out_unlock;
+ }
ret = submit_lookup_objects(submit, args, file);
if (ret)
@@ -462,6 +466,7 @@ out:
submit_cleanup(submit);
if (ret)
msm_gem_submit_free(submit);
+out_unlock:
mutex_unlock(&dev->struct_mutex);
return ret;
}
--
2.5.5
next prev parent reply other threads:[~2016-06-16 21:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 21:22 [PATCH 00/10] drm/msm: some stuff I'm working on for 4.8 Rob Clark
2016-06-16 21:22 ` Rob Clark [this message]
2016-06-16 21:22 ` [PATCH 02/10] drm/msm: add madvise ioctl Rob Clark
2016-06-16 21:22 ` [PATCH 03/10] drm/msm: add put_iova() helper Rob Clark
2016-06-16 21:22 ` [PATCH 04/10] drm/msm: shrinker support Rob Clark
[not found] ` <1466112155-25061-1-git-send-email-robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-16 21:22 ` [PATCH 05/10] drm/msm: change gem->vmap() to get/put Rob Clark
2016-06-16 21:22 ` [PATCH 06/10] drm/msm: wire up vmap shrinker Rob Clark
2016-06-16 21:22 ` [PATCH 07/10] drm/msm: deal with arbitrary # of cmd buffers Rob Clark
2016-06-16 21:22 ` [PATCH 08/10] drm/msm: bump kernel api version Rob Clark
2016-06-16 21:22 ` [PATCH 09/10] drm/msm/rd: split out snapshot_buf helper Rob Clark
2016-06-16 21:22 ` [PATCH 10/10] drm/msm/rd: add module param to dump all bo's Rob Clark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1466112155-25061-2-git-send-email-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=architt@codeaurora.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox