summaryrefslogtreecommitdiff
path: root/tests/syncobj_wait.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2017-10-10 13:02:20 -0700
committerChris Wilson <chris@chris-wilson.co.uk>2017-10-11 08:34:19 +0100
commit136100c2f00b590bc9485100cce012282c1217cf (patch)
tree61ddfb9e925bcd0bbf1a2e91f91f3d7ff3a7b366 /tests/syncobj_wait.c
parenteabe87de4652126480e2211d9c088a8eabea2c8a (diff)
igt/syncobj_wait: Don't close the timeline early in wait_snapshot
Closing the sw_sync timeline now signals any remaining fences upon it; but test_wait_snapshot requires the fence to continue to be busy so that the __syncobj_wait() will return with -ETIME. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103188 References: ea4d5a270b57 ("dma-buf/sw_sync: force signal all unsignaled fences on dying timeline") Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/syncobj_wait.c')
-rw-r--r--tests/syncobj_wait.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/syncobj_wait.c b/tests/syncobj_wait.c
index 5fd37808..49e6d372 100644
--- a/tests/syncobj_wait.c
+++ b/tests/syncobj_wait.c
@@ -525,7 +525,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
{
struct wait_thread_data wait = { 0 };
uint32_t syncobjs[2];
- int timelines[2] = { -1, -1 };
+ int timelines[3] = { -1, -1, -1 };
pthread_t thread;
syncobjs[0] = syncobj_create(fd, 0);
@@ -570,8 +570,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
* the kernel picks up on the new fence (it shouldn't), we'll get a
* timeout.
*/
- close(timelines[0]);
- timelines[0] = syncobj_attach_sw_sync(fd, syncobjs[0]);
+ timelines[2] = syncobj_attach_sw_sync(fd, syncobjs[0]);
sleep_nsec(SHORT_TIME_NSEC / 5);
@@ -589,6 +588,7 @@ test_wait_snapshot(int fd, uint32_t test_flags)
close(timelines[0]);
close(timelines[1]);
+ close(timelines[2]);
syncobj_destroy(fd, syncobjs[0]);
syncobj_destroy(fd, syncobjs[1]);
}