[PATCH 3/3] drm/i915: disallow replacing fences of timeline syncobjs

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Aug 26 09:04:48 UTC 2019


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 09248398fa7b..f1af3490f96b 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -2494,6 +2494,14 @@ get_legacy_fence_array(struct i915_execbuffer *eb,
 			goto err;
 		}
 
+		if ((user_fence.flags & I915_EXEC_FENCE_SIGNAL) &&
+		    syncobj->is_timeline) {
+			DRM_DEBUG("Cannot replace fence in timeline syncobj\n");
+			drm_syncobj_put(syncobj);
+			err = -EINVAL;
+			goto err;
+		}
+
 		if (user_fence.flags & I915_EXEC_FENCE_WAIT) {
 			fence = drm_syncobj_fence_get(syncobj);
 			if (!fence) {
-- 
2.23.0



More information about the dri-devel mailing list