[3/3] drm/i915: disallow replacing fences of timeline syncobjs
diff mbox series

Message ID 20190826090448.12819-4-lionel.g.landwerlin@intel.com
State New
Headers show
Series
  • drm/syncobj: add protection against timeline resets
Related show

Commit Message

Lionel Landwerlin Aug. 26, 2019, 9:04 a.m. UTC
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch
diff mbox series

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) {