2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-27 14:43:58 +08:00

drm/msm: use mutex_lock_interruptible for submit ioctl

Be kinder to things that do lots of signal handling (ie. Xorg)

Signed-off-by: Rob Clark <robdclark@gmail.com>
This commit is contained in:
Rob Clark 2016-05-17 15:43:35 -04:00
parent b137bb4bec
commit b5b4c264df

View File

@ -372,11 +372,15 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
if (args->nr_cmds > MAX_CMDS) if (args->nr_cmds > MAX_CMDS)
return -EINVAL; return -EINVAL;
submit = submit_create(dev, gpu, args->nr_bos); ret = mutex_lock_interruptible(&dev->struct_mutex);
if (!submit) if (ret)
return -ENOMEM; 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); ret = submit_lookup_objects(submit, args, file);
if (ret) if (ret)
@ -462,6 +466,7 @@ out:
submit_cleanup(submit); submit_cleanup(submit);
if (ret) if (ret)
msm_gem_submit_free(submit); msm_gem_submit_free(submit);
out_unlock:
mutex_unlock(&dev->struct_mutex); mutex_unlock(&dev->struct_mutex);
return ret; return ret;
} }