[PATCH 2/3] drm/amd/amdgpu: disallow replacing fences in timeline syncobjs

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


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 at intel.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
 1 file changed, 2 insertions(+)

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;
 		p->num_post_deps++;
-- 
2.23.0



More information about the dri-devel mailing list