[2/3] drm/amd/amdgpu: disallow replacing fences in timeline syncobjs
diff mbox series

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

Commit Message

Lionel Landwerlin Aug. 26, 2019, 9:04 a.m. UTC
Similarly to the host path from drm_syncobj.c we would like to
disallow those operations to help applications figure where they using
the wrong kind of ioctl.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
 1 file changed, 2 insertions(+)

diff mbox series

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 2e53feed40e2..d9bbc31e97d0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -1159,6 +1159,8 @@  static int amdgpu_cs_process_syncobj_out_dep(struct amdgpu_cs_parser *p,
 			drm_syncobj_find(p->filp, deps[i].handle);
 		if (!p->post_deps[i].syncobj)
 			return -EINVAL;
+		if (p->post_deps[i].syncobj->is_timeline)
+			return -EINVAL;
 		p->post_deps[i].chain = NULL;
 		p->post_deps[i].point = 0;