[PATCH] drm/msm: for array in-fences, check if all backing fences are from our own context before waiting
Philipp Zabel
p.zabel at pengutronix.de
Fri Mar 17 18:38:40 UTC 2017
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 at pengutronix.de>
Cc: Rob Clark <robdclark at gmail.com>
Cc: Gustavo Padovan <gustavo.padovan at collabora.com>
---
Not sure if this can be handled exactly the same as for etnaviv. This depends on
d5b72a2123df ("dma-fence: add dma_fence_match_context helper").
---
drivers/gpu/drm/msm/msm_gem_submit.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c b/drivers/gpu/drm/msm/msm_gem_submit.c
index 1172fe7a9252c..507a6f5b911f0 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -439,17 +439,15 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
goto out;
}
- /* 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)
goto out;
}
-
}
if (!(args->fence & MSM_SUBMIT_NO_IMPLICIT)) {
--
2.11.0
More information about the dri-devel
mailing list