diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2017-06-04 16:21:52 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-06-04 16:21:52 +0300 |
commit | 978267b6430c07d62cb38f83e058a3132c52eca1 (patch) | |
tree | 1a744c8230cd5a72adc363ca93458a748c664abe /drivers/gpu/drm/msm/msm_gem_submit.c | |
parent | 6bc51cbaa9d75c7c240282da5ff270815caccac0 (diff) | |
parent | ff86bf0c65f14346bf2440534f9ba5ac232c39a0 (diff) | |
download | linux-978267b6430c07d62cb38f83e058a3132c52eca1.tar.xz |
Merge branch 'timers/urgent' into WIP.timers
Pick up urgent fixes to avoid conflicts.
Diffstat (limited to 'drivers/gpu/drm/msm/msm_gem_submit.c')
-rw-r--r-- | drivers/gpu/drm/msm/msm_gem_submit.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c index 1c545ebe6a5a..7832e6421d25 100644 --- a/drivers/gpu/drm/msm/msm_gem_submit.c +++ b/drivers/gpu/drm/msm/msm_gem_submit.c @@ -410,12 +410,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, if (!in_fence) return -EINVAL; - /* TODO if we get an array-fence due to userspace merging multiple - * fences, we need a way to determine if all the backing fences - * are from our own context.. + /* + * Wait if the fence is from a foreign context, or if the fence + * array contains any fence from a foreign context. */ - - if (in_fence->context != gpu->fctx->context) { + if (!dma_fence_match_context(in_fence, gpu->fctx->context)) { ret = dma_fence_wait(in_fence, true); if (ret) return ret; @@ -496,8 +495,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, goto out; } - if ((submit_cmd.size + submit_cmd.submit_offset) >= - msm_obj->base.size) { + if (!submit_cmd.size || + ((submit_cmd.size + submit_cmd.submit_offset) > + msm_obj->base.size)) { DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size); ret = -EINVAL; goto out; |