summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-03-17 19:38:40 +0100
committerRob Clark <robdclark@gmail.com>2017-05-27 13:48:28 -0400
commit3cfac69cbd56e1a57a70bfbdb07560b788030404 (patch)
treee66e02c2f77fa588b541f8a9e6bcce27f72877b3 /drivers/gpu
parentc43dd227f411359802427da7aebe5da5b0e48e0e (diff)
downloadlinux-stable-3cfac69cbd56e1a57a70bfbdb07560b788030404.tar.gz
linux-stable-3cfac69cbd56e1a57a70bfbdb07560b788030404.tar.bz2
linux-stable-3cfac69cbd56e1a57a70bfbdb07560b788030404.zip
drm/msm: for array in-fences, check if all backing fences are from our own context before waiting
Use the dma_fence_match_context helper to check if all backing fences are from our own context, in which case we don't have to wait. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Clark <robdclark@gmail.com> Cc: Gustavo Padovan <gustavo.padovan@collabora.com> [rebased on code-motion] Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/msm_gem_submit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index 1c545ebe6a5a..8ac4ca443914 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;